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. What is the difference between label encoding and one-hot encoding?

    Label encoding maps each category to an integer, which falsely implies an order. One-hot encoding creates one 0/1 column per category with no implied order. Use one-hot for unordered categories in linear models; integer codes are fine for ordered ones or tree models.

    BeginnerQuick answer1 min read
  2. How would you encode a categorical feature with thousands of values, like a pincode?

    One-hot would create thousands of sparse columns. Better options are target (mean) encoding computed out-of-fold, frequency encoding, grouping rare values into 'other', hashing, or learned embeddings.

    IntermediateQuick answer1 min read