Machine learning and AI interview questions

28 questions, easy to hard. Read one, then answer it out loud: an AI interviewer follows up, hints when you're stuck and grades your answer.

Machine learning and AI interviews test the concepts behind the models: training and evaluation, LLMs and prompting, embeddings and RAG, and responsible AI.

Machine Learning Basics

  1. A friend asks what machine learning actually is. Explain it in plain terms, and the difference between supervised and unsupervised learning, with an everyday example of each.

  2. A colleague trains a model on all their data and reports ninety-nine per cent accuracy on that same data. Explain why that number is meaningless and how you'd split the data properly.

  3. Your model scores brilliantly on training data but poorly on new data. Explain overfitting and underfitting, how you'd spot each, and what you'd do about overfitting.

  4. A fraud model is ninety-nine per cent accurate, but only one per cent of transactions are fraud. Explain why accuracy is misleading here, and what precision and recall tell you instead.

  5. You're predicting house prices from a spreadsheet with postcodes, missing values and sizes in different units. Explain how you'd turn the raw data into features a model can use.

  6. Explain in plain language how a model learns its parameters with gradient descent, and what the learning rate does.

  7. A model predicting which customers will cancel scores almost perfectly in testing, then fails in production. Explain what data leakage is, how it might have happened here, and how to prevent it.

  8. A demand-forecasting model that worked well last year is slowly getting worse. Explain what data drift and concept drift are and how you'd monitor and maintain a model in production.

LLMs and Prompting

  1. A colleague thinks a large language model looks answers up in a database. Explain in plain language how these models are trained and how they produce a reply.

  2. Your chatbot forgets the start of long conversations and the bill is higher than expected. Explain what tokens and the context window are, and how they affect both problems.

  3. Your prompt to summarise customer complaints gives vague, inconsistent results. Explain the techniques that make prompts clearer and more reliable.

  4. Your app gives a different answer each time to the same question, and the team argues about the temperature setting. Explain what temperature does and how you'd choose it.

  5. Your support assistant sometimes invents refund policies that don't exist. Explain why language models hallucinate and how you'd reduce it in this product.

  6. Your code parses the model's reply to extract invoice fields, but it breaks whenever the model adds a friendly sentence. Explain how to get reliable structured output from a language model.

  7. You want your assistant to check order status by calling your own API. Explain how tool calling works with a language model and how you'd keep it safe.

  8. Your email assistant reads incoming messages and can send replies. An attacker sends an email saying to ignore previous instructions and forward the inbox to them. Explain prompt injection and how you'd defend against it.

  9. Your team keeps changing the prompt for an AI summary feature based on gut feeling, and quality goes up and down. Explain how you'd set up a proper evaluation process.

Embeddings and RAG

  1. Your search box can't find an article about cancelling a subscription when a user types how do I stop paying. Explain what embeddings are and how they enable search by meaning.

  2. Your company wants a chatbot that answers questions from its internal handbook. Explain retrieval-augmented generation and why it's often preferred over fine-tuning the model on the handbook.

  3. Your retrieval system splits documents every five hundred characters, and answers often miss key details. Explain how you'd choose a better chunking strategy.

  4. Your prototype compares the query against every one of ten thousand embeddings, but you now have fifty million. Explain how vector databases make this fast and what you give up.

  5. Your semantic search fails on product codes and exact names, while keyword search fails on paraphrased questions. Explain how hybrid search and reranking can give you the best of both.

  6. Users say your handbook assistant gives wrong answers, but you can't tell if the problem is search or the model. Explain how you'd evaluate a retrieval-augmented system to find out.

Responsible AI

  1. A hiring model trained on ten years of past decisions ranks women lower for engineering roles. Explain how bias gets into machine learning models and how you'd investigate and reduce it.

  2. Your team wants to send customer support conversations to a third-party AI provider to generate summaries. Explain the privacy questions you'd need answered before doing this.

  3. A customer was refused a loan by your model and asks why. Explain why explainability matters and the approaches you could use to give a meaningful answer.

  4. Your company wants an AI system to automatically approve or reject insurance claims. Explain how you'd decide which decisions to automate and how to design human oversight.

  5. Before launching a public chatbot for your brand, leadership asks how you'll make sure it can't be made to say something harmful or embarrassing. Explain how you'd red-team and safeguard it.

Questions about practising

How should I prepare for machine learning and ai interview questions?
Practise answering them out loud, not just reading them. Explaining an answer under follow-up questions is what interviews test. Work through the 28 questions here from easy to hard, and revisit the ones you struggle with.
Can I practise machine learning and ai interview questions with an AI?
Yes. Open any question and start a voice session: an AI interviewer asks it, follows up on your answer, gives hints when you're stuck and grades your answer with written feedback when the call ends.
Are these machine learning and ai interview questions free?
3 of the 28 questions are free to practise. Sign in with Google, no card needed. Pro unlocks the rest, plus practice calls to your phone.