
Prepare for data science interviews with over 150 questions across machine learning, neural networks, deep learning, statistics, SQL, and interview-facing topics, organized into ten sections with practical answers.
Explain the difference between k nearest neighbors and k means: knn is a supervised classification method using labeled data, while k means is an unsupervised clustering method using unlabeled points.
Explore the bias-variance tradeoff by defining bias and variance, illustrating underfitting with high bias and overfitting with high variance, and identifying the optimal model complexity that minimizes total error.
Implement k-means clustering by choosing K, initializing centroids by shuffling data and selecting K points, elbow method to determine K, assigning points to nearest centroid and updating centroids until stable.
Use the elbow method to determine the optimal number of clusters in k-means by analyzing the distortion—the sum of squared distances to cluster centers.
Data science lecture on k-means highlights its simple, fast, and explainable clustering, while noting the need to choose k, sensitivity to initialization and outliers, struggles with non-spherical shapes, and standardization.
Explain how the ROC curve plots the true positive rate against the false positive rate, linking sensitivity and specificity, and summarize classifier performance with the area under the curve (AOK).
Explain the difference between type one error and type two error, including false positives and false negatives, through the null hypothesis framework and the shepherd and wolf example.
Explain precision and recall by defining precision as the positive predicted value and recall as the true positive rate, using true positives, false positives, and false negatives.
Learn how k-fold cross validation estimates model skill by shuffling data, splitting it into k groups, training on k-1 groups, and testing on the remaining group to produce evaluation scores.
Define false positives as identifying a condition's presence when absent, and false negatives as missing a condition that is present. Use spam filtering and cancer screening as contrasting examples.
Discover when to use random forests instead of SVMs, emphasizing feature importance, faster and simpler training, and scalable multiclass handling for data science interview preparation.
Dimensionality reduction lowers model variance and overfitting by reducing features, speeds training, and saves storage. It also mitigates multicollinearity, aids visualization in 2D–3D, and combats the curse of dimensionality.
Principal component analysis reduces dimensionality by transforming many variables into fewer uncorrelated components that capture most information, enabling compression, faster algorithms, and easier visualization through explained variance in scree plots.
Learn the key assumptions of linear regression, including representative samples, linear X–Y relationship, homoscedastic residuals, independent observations, and normally distributed errors.
Perform data profiling, visualize distributions, and standardize or normalize features to prepare data for machine learning, while handling null values, outliers, and removing duplicates and irrelevant features.
Understand multicollinearity in multiple regression, where highly correlated independent variables count the same feature twice and undermine statistical significance. Use VIF with a threshold of five to remove one variable.
Explore evaluating a cancer detection classification model trained on an imbalanced dataset, where 98% accuracy can be misleading. Learn to use sensitivity, specificity, and f measure to assess production readiness.
Evaluate algorithms on unbalanced data using metrics like precision, recall, F1, MCC, and ROC AUC to avoid misleading accuracy. Use undersampling, oversampling, SMOTE, or cost-sensitive models to balance classes.
Explain why aggregating percentiles across time windows is unreliable. Averaging percentiles yields meaningless results, and the 100th percentile equals the max; accurate percentiles require all raw data.
Apply Bayes' theorem to update probabilities using prior knowledge in machine learning, using conditional reasoning and prior probability to reduce false positives in rare diagnoses like cancer.
Explain why naive Bayes is naive: it assumes feature independence given class, even when features relate. It remains simple to implement and serves as a useful baseline with solid results.
Compare L1 and L2 regularization by showing how L1 drives many coefficients to zero for feature selection, while L2 rarely zeros coefficients, preserving features in datasets.
Use forward chaining for time series cross-validation, training on past data and testing on future data to respect chronological order and avoid random k-fold splits.
Determine whether a time series is stationary by checking if its mean, variance, and covariance remain constant over time, and use the augmented Dickey-fuller test to identify a unit root.
Unlock the non-seasonal arima components: P (autoregressive lags), d (differencing), and Q (moving average order), and see how 000 yields white noise while 011 and 022 relate to smoothing models.
Keep models simple to reduce variance and noise, using a basic baseline to gauge expected error. Apply k-fold cross validation and L1/L2 regularization to prevent overfitting and shrink parameters.
Learn to handle missing data with deletion or imputation, using mean, median, mode, interpolation, and multiple imputation, plus time series considerations and predictive models like logistic regression and ANOVA.
Explore the kernel trick: kernel functions compute inner products in a feature space, enabling higher dimensionality without explicit coordinates and cheaper decision surfaces.
Compare gradient descent and stochastic gradient descent: gradient descent suits small datasets, while SGD converges faster on large datasets; in practice, use SGD for speed and memory efficiency.
Learn to determine whether offering coupons affects purchase decisions by using one-way ANOVA to compare means across three groups (two coupon types and no coupon) using the F distribution.
Understand univariate, bivariate, and multivariate analyses with real examples: univariate sales by territory, bivariate sales and spending, and multivariate variables with multicollinearity.
Explain how the SVM uses support vectors and a maximal margin to define an optimal hyperplane for classification, mapping data to high-dimensional space to handle non-linear problems with a penalty.
Compare bagging and boosting within ensemble learning. Bagging trains models on random samples to reduce variance, and boosting trains sequential models with weighted data to reduce bias and improve accuracy.
Use the Box-Cox transformation to normalize data, enabling normality-based tests and confidence intervals, and potentially boost predictive power by reducing white noise, as shown with a beta(1,3) distribution.
Explore the central limit theorem: as sample size grows, the sampling distribution of the means approaches a normal curve, regardless of population shape, guiding hypothesis testing and confidence intervals.
Sampling is a technique that selects a representative subset of data to identify patterns in a population, using probability-based methods with random numbers or non-probability approaches such as consecutive sampling.
Explore four probability-based sampling methods: simple random sampling, systematic sampling, stratified sampling, and cluster sampling, and learn how each method selects subjects from a population.
Explore four nonprobability sampling methods: convenience, consecutive, purposive or judgmental, and quota sampling, and explain how they work, including bias concerns and the absence of random sampling.
Explore the advantages and disadvantages of neural networks and deep learning, including state-of-the-art performance across image, language, translation, speech, and time series tasks, and challenges like interpretability and data needs.
The popularity of deep learning rises from vast data and faster GPUs, enabling the training of deep neural networks for state-of-the-art results in image recognition.
Explore why convolutional layers excel with images by exploiting local structure and translation equivariance, unlike fully connected layers that ignore spatial shifts and lack weight sharing, requiring many parameters.
Explain epoch, batch size, and iterations in deep learning: one epoch equals a forward and backward pass; batch size impacts memory; iterations per epoch equal examples divided by batch size.
Pooling, including max pooling, drives translation invariance in CNNs by summarizing nearby outputs, so a shifted input yields similar pooled values, while convolution and activation create features used by pooling.
Explore the four main CNN layers: convolutional, ReLU, pooling, and fully connected, and how they build feature learning toward a softmax-classified image output.
Explore the three types of spatial pooling, max pooling, average pooling, and sum pooling, and how they downsample feature maps to reduce dimensionality while retaining important information.
Explore how the stride in convolutional layers determines how far the filter moves over the input matrix, with stride one and two examples, and pooling options.
Explain how large derivatives across n hidden layers cause exploding gradients and unstable updates, while small derivatives cause vanishing gradients and hinder learning in deeper layers.
Explore four strategies to tackle vanishing and exploding gradients: reduce model depth, apply gradient clipping, use weight regularization (l1/l2), and adopt lstm or gru architectures for recurrent networks.
Explore why segmentation cnns use an encoder-decoder structure, where the encoder extracts features and the decoder upscales to classify each pixel into road, footpath, sky, cars, and pedestrians.
Batch normalization stabilizes training by normalizing each layer's mini-batch inputs to zero mean and a standard deviation of one, accelerating learning by feeding next layer outputs normalized before activation.
Use many small 3x3 kernels to achieve the same receptive field with fewer parameters and computations, while enabling more filters and activation functions for a more discriminative CNN.
Explain how generative adversarial networks, consisting of a generator and a discriminator, train to produce images indistinguishable from real ones by fooling the discriminator through their competing objectives.
Apply the softmax non-linearity as the last network operation to convert a real-valued vector into a probability distribution by exponentiating each element and normalizing by the sum of exponentials.
Explore the sigmoid (logistic) activation function, which bounds outputs to 0 to 1 and offers a smooth gradient, but suffers vanishing gradients, is not zero-centered, and is computationally expensive.
Explore the relu activation function, noting its computational efficiency and non-linear backpropagation-friendly nature, while recognizing the dying relu drawback where gradients vanish for zero or negative inputs, hindering learning.
Learn about the leaky relu activation function, which adds a slope for negative inputs to enable back propagation and avoid dying relu, with inconsistency in applications like breast cancer screening.
Explore how backpropagation trains neural networks by performing a forward pass, computing error, propagating gradients to adjust weights, and updating them across batches and epochs.
Explore common hyperparameters shaping neural network structure, including hidden layer count, dropout probability and layer-wise dropout, activation functions like sigmoid and ReLU, and weight initialization methods.
Explore four hyperparameter tuning methods for machine learning, including manual tuning, grid search, random search, and Bayesian optimization, and learn how each affects model accuracy.
Explore neural network architectures by analyzing input, hidden, and output cells alongside memory and convolutional layers. Understand how a classic feedforward network uses backpropagation to model logic gates.
Explore how recurrent neural networks introduce time-dependent memory cells that feed back through time, enabling sequence processing and auto completion. Understand gradient challenges and upcoming solutions like LSTMs and GRUs.
Compare gated recurrent units with lstms by examining the middle cell, its update and reset gates, and the speed-expressiveness trade-offs in time series forecasting and auto completion.
Learn autoencoder architectures with a symmetric encoding and decoding path around a central latent bottleneck, enabling dimensionality reduction and data reconstruction from input to output through backpropagation.
Explain variational autoencoders, highlighting probabilistic hidden cells, Bayesian inference and reparameterization, and discuss their generative applications in images, faces, music, molecules, and drug design.
Explore Hopfield networks, a fully connected recurrent architecture where every neuron connects to all others, with fixed weights that converge to learned patterns as associative memory for pattern recognition tasks.
Explore Boltzmann machines, their stochastic training with contrastive divergence, and how constrained connectivity enables practical use in combinatorial optimization, image recognition, and neural network design.
Explore restricted Boltzmann machines, with visible and hidden units and no intra-layer connections, trained by forward and backward propagation for dimensionality reduction, classification, feature learning, collaborative filtering, and topic model.
Explore convolutional neural networks, including cnn and dcns, with input, convolutional and pooling layers for feature extraction and image classification or recognition.
Explore echo state networks as a variant of recurrent networks with random, nonlayered connections. Train only observer-to-hidden links, with input priming, for efficient time series forecasting and sequence prediction.
Explore generative adversarial networks, where generator and discriminator twin networks compete to generate content and evaluate generated content’s realism through iterative feedback from training data.
Being a data scientist is one of the most lucrative and future proof careers with Glassdoor naming it the best job in America for the third consecutive year in a row with great future growth prospects and a median base salary of $110,000. I have recently made the transition from being a PhD student in Computer Science to a Senior Data Scientist at a large tech company. In this course I give you all the questions and answers that I used to prepare for my data science interviews as well as the questions and answers that I now expect when I am giving interviews to potential data science candidates. The course provides a complete list of 150+ questions and answers that you can expects in a typical data science interview including questions on machine learning, neural networks and deep learning, statistics, practical experience, big data technologies, SQL, computer science, culture fit, questions for the interviewer and brainteasers.
What questions will you learn the answer to?
What is the bias-variance tradeoff?
How would you evaluate an algorithm on unbalanced data?
When would you use gradient descent (GD) over stochastic gradient descent (SDG), and vice-versa?
Why do segmentation CNNs typically have an encoder-decoder style / structure?
Why we generally use Softmax non-linearity function as last operation in-network?
You randomly draw a coin from 100 coins — 1 unfair coin (head-head), 99 fair coins (head-tail) and roll it 10 times. If the result is 10 heads, what is the probability that the coin is unfair?
Given the following statistic, what is the probability that a woman has cancer if she has a positive mammogram result? 1% of women have breast cancer, 90% of women who have breast cancer test positive on mammograms and 8% of women will have false positives.
Write a SQL query to get the second highest salary from the Employee table. If there is no second highest salary the query should return null.
What is the average time complexity to search an unsorted array?
Why do you want to work here?
How can you generate a random number between 1 – 7 with only a die?
About the instructor:
Senior Data Scientist at a large tech company
Recently finished PhD in Computer Science and moved to industry
5+ years teaching experience at university level