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
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.
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.
- Overfitting and Underfitting
- medium
- Pro
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.
- Precision and Recall
- medium
- Pro
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.
- Prepare Features
- medium
- Pro
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.
- How Gradient Descent Learns
- medium
- Pro
Explain in plain language how a model learns its parameters with gradient descent, and what the learning rate does.
- Spot Data Leakage
- hard
- Pro
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.
- Monitor Models in Production
- hard
- Pro
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
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.
- Tokens and Context Windows
- easy
- Pro
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.
- Write a Good Prompt
- easy
- Pro
Your prompt to summarise customer complaints gives vague, inconsistent results. Explain the techniques that make prompts clearer and more reliable.
- Temperature and Sampling
- medium
- Pro
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.
- Reduce Hallucinations
- medium
- Pro
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.
- Get Structured Output
- medium
- Pro
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.
- Let a Model Call Tools
- medium
- Pro
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.
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.
- Evaluate an LLM Feature
- hard
- Pro
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
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.
- Retrieval-Augmented Generation
- medium
- Pro
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.
- Chunk Documents Well
- medium
- Pro
Your retrieval system splits documents every five hundred characters, and answers often miss key details. Explain how you'd choose a better chunking strategy.
- Vector Search at Scale
- medium
- Pro
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.
- Hybrid Search and Reranking
- hard
- Pro
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.
- Evaluate a RAG System
- hard
- Pro
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
- Where Bias Comes From
- easy
- Pro
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.
- Privacy and AI Features
- medium
- Pro
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.
- Explain a Model's Decisions
- medium
- Pro
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.
- Keep a Human in the Loop
- medium
- Pro
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.
- Red-Team an AI Feature
- hard
- Pro
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.