No guarantee the answers here are correct, just for reference!
LinkedIn Stats
One bank has 5 tellers and a single line, another bank has 5 tellers with 5 separate lines — which one would you queue at?
Simple statistical explanation: the "Long Plank Effect" (the opposite of the Weakest Link Effect). In a single queue, your waiting time is determined by the fastest available teller. In multiple queues, your waiting time depends on the slowest teller in your queue, which could be much longer than average if you're unlucky.
Queueing theory (Erlang-C model): a single queue gives more stable wait times, since the next available teller always serves the next customer. Multiple queues have higher variance, since choosing a slow teller's line can drastically increase your wait. Average waiting time ends up the same either way — same mean, but bigger variance for the short line.
Distributions, part 1:
- Draw the distribution of American men's heights (normal distribution)
- Draw the distribution of American women's heights (normal distribution)
- If you combine men and women together, what does the distribution look like? (bimodal distribution)
Distributions, part 2:
- Everyone on LinkedIn has connections — say a has 100 connections, b has 200, c has 500 — draw the distribution of number of connections. (right-skewed)
- Asked about the range of the mean value, and to explain why.
- Compare the size of mean, median, and mode, and explain why (I talked through the reasoning for a while on this one).
For a right-skewed distribution: mode < median < mean. This happens because the long right tail pulls the mean to the right, while the median and mode stay closer to the bulk of the data.
Simpson's paradox
The SF vs NY email campaign question: a marketing team wants to test a new email campaign — how do you determine whether the new email is better? This one tests Simpson's paradox (an old question from the forum), and they also asked whether you could compute a confidence interval for it.
One version of the Simpson's paradox question: two email versions, tested for two consecutive weeks in two different cities, and the results show B beats A. But combined, A comes out ahead. Some points you need to hit: time, city, and balancing the dataset. Imbalanced sample sizes, and different baseline conversion rates in the two cities due to other confounding factors like region and geography (different email delivery times, different timezones, different user habits). You should retest to make sure the data is balanced.
How do you deal with class imbalance?
Data-level approaches: undersample the majority class (works well when the dataset is large, but risks losing useful information), or oversample the minority class (duplicate or generate synthetic data with SMOTE — works well when you need to retain all the data, but risks overfitting if you just duplicate).
Algorithm-level approaches: assign a higher weight to the minority class in the loss function so the model isn't biased toward the majority class, or use anomaly detection instead of classification. Evaluate with metrics suited to imbalanced data — precision & recall, F1 score, AUC, confusion matrix. Precision is how accurate your positive predictions are (TP/(TP+FP)); recall is how many of the actual positives you found (TP/(TP+FN)).
If you sample data from a huge dataset, how do you verify the model built from the sample is good? Check whether the sampled dataset represents the full dataset well — stratified sampling for categorical variables, and check the distribution of key features (histograms, K-S test, differences in mean/median/std). Then check whether the model trained on the sample generalizes to the full dataset — train on the sample and evaluate on a holdout set from the full data, use out-of-sample validation (hold out something like 10% of the full dataset before sampling as your test set), or train on multiple bootstrapped samples and check the variance in performance to see if it's stable.
How do you prevent overfitting with a tree-based model? Use regularization (max depth, min samples per split, pruning), ensemble methods (random forest, boosting), cross-validation and early stopping, and better features plus more data.
Why aren't L1/L2 unbiased? L1/L2 regularization are biased estimators because they shrink coefficients toward zero — but that bias is often a tradeoff for better generalization and lower variance.
Discussion
Loading comments…