13How does an SVM work, and what does the kernel trick actually buy you?▼mediumAmazonGoogleMicrosoft2 replies○ sign inSVMs separate the candidates who memorized 'maximize the margin' from the ones who can explain why a kernel gives you non-linear separation without ever touching the high-dimensional space. Here is the answer that lands the second signal.Open full answer →
33How do k-NN and Naive Bayes work, and what are their assumptions and tradeoffs?▼mediumAmazonGoogleMicrosoft2 replies◆ premiumTwo simple classifiers that still appear in interviews because they test whether you understand assumptions and tradeoffs, not just sklearn calls. The signal is k-NN's laziness and curse of dimensionality versus Naive Bayes' independence assumption. Here is the answer.Open full answer →
98Write down the SVM dual, and explain what the Lagrange multipliers and KKT conditions tell you.▼hardGoogleMicrosoftNVIDIA1 replies◆ premiumMost candidates can recite 'maximize the margin'. The dual is where you show you actually understand why only support vectors matter and where the kernel trick comes from. Here is the derivation an interviewer wants.Open full answer →
100When would you use a CRF instead of an HMM for sequence labeling, and why?▼hardGoogleMicrosoftAmazon2 replies◆ premiumBoth tag sequences, but one is generative and one is discriminative, and that difference decides whether you can throw in overlapping features. Here is the comparison that shows you know the modeling tradeoff, not just the acronyms.Open full answer →
101What actually makes a random forest work, beyond 'it averages a bunch of trees'?▼mediumAmazonMicrosoftGoogle2 replies◆ premiumAnyone can say 'ensemble of trees'. The real answer is about decorrelating those trees and why that, not just averaging, is what drops variance. Here is what makes the forest more than the sum of its trees.Open full answer →
102How does LightGBM's histogram binning and GOSS make gradient boosting fast, and what do they cost?▼hardMicrosoftAmazonGoogle1 replies◆ premiumXGBoost made boosting practical; LightGBM made it fast. The answer is histogram binning, gradient-based sampling, and leaf-wise growth, each with a real tradeoff. Here is what they do and where they bite.Open full answer →
104Why does Naive Bayes work so well despite an assumption that is almost always false?▼mediumAmazonMicrosoftGoogle2 replies◆ premiumThe 'naive' independence assumption is wrong on real data, yet the classifier is a strong baseline for text. The interesting answer explains why classification survives a broken assumption, plus smoothing and the variants. Here it is.Open full answer →
105What are the real tradeoffs of k-NN, and what breaks it at scale and in high dimensions?▼mediumAmazonGoogleApple1 replies◆ premiumk-NN looks trivial until you ask about choosing k, why distances stop meaning anything in high dimensions, and how to make prediction fast on millions of points. Here is the tradeoff-aware answer.Open full answer →
107Compare filter, wrapper, and embedded feature selection, and when does each fail?▼mediumAmazonMicrosoftGoogle2 replies◆ premiumUnivariate ranking is the trap everyone falls into: it keeps redundant features and drops ones that only matter in combination. Here is the filter/wrapper/embedded breakdown plus mRMR and Boruta, and where each one bites.Open full answer →
108Why does Elastic Net exist if you already have Lasso and Ridge?▼mediumAmazonMicrosoftGoogle1 replies◆ premiumLasso gives sparsity, Ridge handles correlated features, and each fails where the other shines. Elastic Net blends them for a specific, common failure. Here is when it earns its two hyperparameters.Open full answer →
109Compare SMOTE, class reweighting, and focal loss for imbalanced learning. Which do you reach for?▼hardAmazonGoogleMicrosoft2 replies◆ premiumResampling, reweighting, and focal loss attack class imbalance from different angles, and each has a real downside. The signal is matching the method to the model and metric, not blindly oversampling. Here is the breakdown.Open full answer →