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 does Naive Bayes classify an email as spam? Work through a small example.

    It uses Bayes' theorem: posterior is proportional to prior times the product of each word's likelihood given the class. Compute that score for spam and for not-spam, then normalise. The class with the higher posterior wins.

    IntermediateQuick answer1 min read
  2. What is Laplace smoothing in Naive Bayes, and why is it needed?

    If a word never appeared with a class in training, its probability is zero and wipes out the whole product. Laplace smoothing adds 1 to every word count so no probability is exactly zero.

    IntermediateQuick answer1 min read
  3. What is the difference between Gaussian, Multinomial and Bernoulli Naive Bayes?

    Gaussian NB assumes each feature is normally distributed within a class, so it suits continuous values. Multinomial NB models word counts. Bernoulli NB models binary present/absent features.

    IntermediateQuick answer1 min read