Interview Q&A / Machine Learning

INTERVIEW Q&A · 55 QUESTIONS

Machine Learning interview questions

Supervised vs unsupervised learning, overfitting, metrics and the classic models, explained simply.

  1. How do you choose k in KNN, and what happens when k is very small or very large?

    Small k (like 1) follows noise and overfits; very large k smooths too much and underfits, at the extreme predicting the majority class for everything. Choose k by cross-validation, and use an odd k for two-class problems to avoid ties.

    BeginnerQuick answer1 min read
  2. What do the C and gamma parameters do in an RBF SVM?

    C controls how much misclassification is tolerated: high C fits training data tightly (risk overfitting), low C allows a wider, smoother margin. Gamma sets how far one point's influence reaches: high gamma gives wiggly, local boundaries, low gamma gives smooth ones.

    IntermediateQuick answer1 min read
  3. Which hyperparameters matter most in a random forest?

    n_estimators (more trees gives stable results with diminishing returns), max_features (how many features each split considers), max_depth, min_samples_leaf and min_samples_split. max_features and min_samples_leaf usually matter most.

    IntermediateQuick answer1 min read