AI and machine learning: interview questions and model answers
Each question below shows what interviewers look for, a model answer in four parts, the follow-up questions they are likely to ask next and the most common mistake. Read it, then say your own version aloud.
Open the interview drill1. Why do you want to work in machine learning?
What interviewers look for: Genuine interest grounded in solving real problems, with evidence of hands-on work.
Model answer
Answer structure: Direct answer, Main reason, Evidence, and Link to the role
- Direct answer
- I like that machine learning turns messy data into decisions that help real people.
- Main reason
- During my master's degree I built a model to predict hospital appointment no-shows, and seeing a clinic use it to send reminders made the work feel real.
- Evidence
- Since then I've worked as a data analyst, and I've been moving more of my work into building and deploying models.
- Link to the role
- I want a role where I can own models end to end, from framing the problem to monitoring them in production.
Likely follow-up questions
- Which part of the machine learning workflow do you enjoy most?
- What kind of problems do you not want to work on?
Avoid: Avoid answers that are only about the hype around the field, because interviewers want evidence that you care about solving problems.
Practise this question aloud2. Walk me through an end-to-end machine learning project you have built.
What interviewers look for: Problem framing, data, baseline, modelling, evaluation, deployment and measurable impact.
Model answer
Answer structure: Situation, Task, Action, and Result
- Situation
- Our customer support team couldn't keep up with incoming tickets, and urgent ones were often answered late.
- Task
- I was asked to build a model that flags urgent tickets automatically.
- Action
- I worked with agents to define 'urgent', labelled a sample of past tickets, started with a simple keyword baseline and then trained a text classifier that beat it clearly on recall. I deployed it behind an internal service and set up weekly checks on precision with the support leads.
- Result
- Median response time for urgent tickets fell from six hours to under one, and the team now uses the flag to prioritise every morning.
Likely follow-up questions
- Why did you focus on recall rather than precision?
- What would you change if you built it again?
Avoid: Avoid focusing only on the model architecture, because interviewers want to see the whole project and its real impact.
Practise this question aloud3. How do you choose the right evaluation metric for a model?
What interviewers look for: Linking the metric to the business cost of errors, considering class balance and checking against a baseline.
Model answer
Answer structure: Direct answer, Main reason, Evidence, and Link to the role
- Direct answer
- I start with the decision the model supports and the cost of each kind of error.
- Main reason
- For fraud detection, for example, missing a fraud case may cost far more than a false alarm, so I'd focus on recall at an acceptable precision rather than overall accuracy.
- Evidence
- With imbalanced classes I look at precision-recall curves rather than accuracy, which can look high even for a useless model.
- Link to the role
- I always compare against a simple baseline and agree the metric and target with stakeholders before modelling starts.
Likely follow-up questions
- When is accuracy a reasonable metric?
- How would you choose a decision threshold?
Avoid: Avoid defaulting to accuracy for every problem, because it often hides poor performance on the cases that matter most.
Practise this question aloud4. What is overfitting, and how do you prevent it?
What interviewers look for: A clear definition and several practical prevention techniques, including honest validation.
Model answer
Answer structure: Direct answer, Main reason, Evidence, and Link to the role
- Direct answer
- Overfitting is when a model learns patterns specific to the training data, including noise, so it performs well in training but poorly on new data.
- Main reason
- I detect it by comparing training and validation performance on data the model hasn't seen, ideally using a time-based split when the data changes over time.
- Evidence
- To prevent it, I start with simpler models, use regularisation, limit model complexity and get more or better data where possible.
- Link to the role
- Above all, I keep a final test set untouched until the end, so my final estimate is honest.
Likely follow-up questions
- What is underfitting, and how would you spot it?
- How does cross-validation help?
Avoid: Avoid tuning repeatedly against the test set, because it gives an overly optimistic picture of performance.
Practise this question aloud5. How do you handle a heavily imbalanced dataset?
What interviewers look for: Appropriate metrics, resampling or weighting, threshold tuning and understanding the business context.
Model answer
Answer structure: Direct answer, Main reason, Evidence, and Link to the role
- Direct answer
- First I make sure the metrics reflect the imbalance, using precision, recall and precision-recall curves instead of accuracy.
- Main reason
- Then I try class weights or resampling, such as undersampling the majority class, and compare the results on a properly stratified validation set.
- Evidence
- Often the biggest gain comes from tuning the decision threshold to match the cost of each error.
- Link to the role
- I also check whether we can collect more examples of the rare class, because better data usually beats clever techniques.
Likely follow-up questions
- What are the risks of oversampling?
- How would you explain the threshold choice to a manager?
Avoid: Avoid applying resampling before splitting the data, because it leaks information into the validation set.
Practise this question aloud6. Tell me about a model that did not perform as expected in production.
What interviewers look for: Honest ownership, investigation, fixing the root cause and improving monitoring.
Model answer
Answer structure: Situation, Task, Action, and Result
- Situation
- A demand forecasting model I built performed well in testing but started under-predicting sales a few weeks after launch.
- Task
- Store managers were ordering too little stock, so I needed to find the cause quickly.
- Action
- I compared live inputs with the training data and found that a new promotion type wasn't represented in our history. I added a fallback rule for promotion weeks, retrained with the new data and set up alerts when input distributions shifted.
- Result
- Forecast error returned to the tested level within a month, and the drift alerts caught two similar changes later before they caused problems.
Likely follow-up questions
- What would have caught the problem earlier?
- How did you communicate the issue to the store managers?
Avoid: Avoid blaming the data or other teams, because the question tests ownership and learning.
Practise this question aloud7. How would you explain a model's predictions to a non-technical stakeholder?
What interviewers look for: Plain language, focus on decisions, examples, honest limitations and appropriate explanation tools.
Model answer
Answer structure: Direct answer, Main reason, Evidence, and Link to the role
- Direct answer
- I start with what the model does in their terms, such as 'it ranks customers by how likely they are to cancel next month'.
- Main reason
- Then I show a few real examples with the main factors behind each prediction, using simple charts rather than technical terms.
- Evidence
- I'm clear about what it can't do, for example that it's less reliable for new customers with little history.
- Link to the role
- Finally, I connect it to the decision they'll make and how we'll measure whether it's helping.
Likely follow-up questions
- How would you respond if they didn't trust the model?
- When is it important to use an interpretable model?
Avoid: Avoid technical jargon or overstating certainty, because it damages trust when the model makes mistakes.
Practise this question aloud8. How do you detect and respond to data drift?
What interviewers look for: Monitoring inputs and outputs, defining thresholds, investigating causes and retraining sensibly.
Model answer
Answer structure: Direct answer, Main reason, Evidence, and Link to the role
- Direct answer
- I monitor the distribution of key input features and the model's predictions, comparing them with the training data over time.
- Main reason
- Where labels arrive later, I also track actual performance once they're available, because input drift doesn't always hurt accuracy.
- Evidence
- When an alert fires, I investigate the cause first, such as a new data source, a bug upstream or a real change in behaviour.
- Link to the role
- Then I decide whether to fix the pipeline, retrain on recent data or adjust the model, and I document what changed.
Likely follow-up questions
- How would you choose drift thresholds?
- How often would you retrain by default?
Avoid: Avoid retraining automatically on every alert without investigating, because you may train the model on broken data.
Practise this question aloud9. How do you approach bias and fairness in machine learning?
What interviewers look for: Considering who could be harmed, measuring performance across groups, mitigating issues and involving others.
Model answer
Answer structure: Direct answer, Main reason, Evidence, and Link to the role
- Direct answer
- I start by asking who the model affects and how errors could harm different groups, before any modelling begins.
- Main reason
- I check whether the training data under-represents groups or reflects past unfair decisions, and I measure performance separately across relevant groups.
- Evidence
- If I find gaps, I consider better data, different features, adjusted thresholds or not automating that decision at all.
- Link to the role
- I document the results and limitations and involve legal, ethics or domain experts, because fairness isn't only a technical question.
Likely follow-up questions
- Is removing sensitive attributes enough to make a model fair?
- Tell me about a time you found a bias issue.
Avoid: Avoid saying the model is fair because it doesn't use sensitive attributes directly, because other features can act as proxies.
Practise this question aloud10. When would you advise against using machine learning?
What interviewers look for: Judgement about simpler solutions, data limitations, risk and maintenance cost.
Model answer
Answer structure: Direct answer, Main reason, Evidence, and Link to the role
- Direct answer
- I'd advise against it when clear rules can solve the problem reliably, because rules are cheaper to build and easier to explain.
- Main reason
- I'd also be cautious when there isn't enough good-quality data, or when the cost of a wrong decision is very high and the model can't be explained.
- Evidence
- Machine learning adds maintenance work, such as monitoring and retraining, so the benefit has to justify that cost.
- Link to the role
- In my last role, I recommended a rules-based approach for routing invoices, which solved most cases and saved months of work.
Likely follow-up questions
- How would you persuade a manager who wanted machine learning anyway?
- When would you move from rules to a model?
Avoid: Avoid suggesting machine learning is always the best answer, because good practitioners choose the simplest tool that works.
Practise this question aloud11. Describe a time you significantly improved a model's performance.
What interviewers look for: A structured approach to diagnosis, focusing on data and features as well as algorithms, with measured results.
Model answer
Answer structure: Situation, Task, Action, and Result
- Situation
- Our product recommendation model had flat click-through rates despite several tuning attempts.
- Task
- I was asked to find out why and improve it within one quarter.
- Action
- I analysed errors by segment and found that new users got poor recommendations because the model relied on purchase history. I added features based on browsing behaviour in the first session and a fallback ranking for users with no history.
- Result
- Click-through for new users rose by about a quarter in an online test, and overall revenue from recommendations increased.
Likely follow-up questions
- How did you decide where to look first?
- What did you try that didn't work?
Avoid: Avoid describing only hyperparameter tuning, because the best improvements usually come from understanding errors and data.
Practise this question aloud12. How would you evaluate an application built on a large language model?
What interviewers look for: Defining success, building test sets, combining automatic and human evaluation, and monitoring safety and cost.
Model answer
Answer structure: Direct answer, Main reason, Evidence, and Link to the role
- Direct answer
- I'd start by defining what good looks like for the task, such as accuracy, helpfulness, tone and safety, with clear examples.
- Main reason
- Then I'd build a test set of real and difficult cases, including edge cases and harmful requests, and run it on every change to prompts or models.
- Evidence
- I'd combine automatic checks, such as format and factual accuracy against sources, with regular human review of samples.
- Link to the role
- In production I'd monitor user feedback, failure patterns, response time and cost, because behaviour can change as users try new things.
Likely follow-up questions
- How would you reduce made-up answers?
- How would you test for harmful outputs?
Avoid: Avoid judging quality from a few hand-picked examples, because systematic testing is needed to catch failures.
Practise this question aloud13. What is data leakage, and how do you prevent it?
What interviewers look for: A clear definition, common examples and practical safeguards in the pipeline.
Model answer
Answer structure: Direct answer, Main reason, Evidence, and Link to the role
- Direct answer
- Data leakage happens when information that wouldn't be available at prediction time slips into training, making the model look better than it really is.
- Main reason
- Common examples are features calculated using future data, or scaling and resampling done before splitting into training and test sets.
- Evidence
- I prevent it by splitting data first, using time-based splits where relevant and building all preprocessing inside a pipeline fitted only on training data.
- Link to the role
- I'm also suspicious of results that look too good, and I check which features drive them.
Likely follow-up questions
- Tell me about a time you found leakage.
- How would you check for leakage in someone else's model?
Avoid: Avoid accepting very high validation scores without checking for leakage, because they often signal a problem.
Practise this question aloud14. Tell me about a time you worked with engineers to get a model into production.
What interviewers look for: Collaboration, understanding engineering constraints, clear interfaces and shared ownership.
Model answer
Answer structure: Situation, Task, Action, and Result
- Situation
- I'd built a pricing model in a notebook, and the engineering team needed it to respond in under a hundred milliseconds in the checkout.
- Task
- My job was to make it production-ready without losing accuracy.
- Action
- I met the engineers early to agree the interface and latency budget, simplified the features to ones available in real time, packaged the model with tests and agreed who would own monitoring and retraining.
- Result
- The model went live on schedule, met the latency target and increased average order value in its first month.
Likely follow-up questions
- What trade-offs did you have to make?
- How did you handle disagreements with the engineers?
Avoid: Avoid presenting deployment as someone else's problem, because models only create value once they're used reliably.
Practise this question aloud15. How do you handle privacy and sensitive data when training models?
What interviewers look for: Data minimisation, access control, anonymisation, legal compliance and awareness of model risks.
Model answer
Answer structure: Direct answer, Main reason, Evidence, and Link to the role
- Direct answer
- I only collect and use the data the model really needs, and I check the legal basis and consent with the privacy team.
- Main reason
- I work with anonymised or pseudonymised data wherever possible and keep sensitive data in secure, access-controlled environments.
- Evidence
- I'm aware that models can memorise training data, so I avoid including personal details that aren't needed and test for that risk on sensitive projects.
- Link to the role
- I document where data came from and how long we keep it, so we can respond to deletion requests and audits.
Likely follow-up questions
- What would you do if you found personal data where it shouldn't be?
- How do you balance privacy with model performance?
Avoid: Avoid treating privacy as only the legal team's concern, because practitioners make many of the key decisions.
Practise this question aloud16. How do you decide between a simple model and a more complex one?
What interviewers look for: Weighing performance gains against interpretability, latency, cost and maintenance.
Model answer
Answer structure: Direct answer, Main reason, Evidence, and Link to the role
- Direct answer
- I always start with a simple baseline, such as a linear model or a decision tree, because it sets the bar and is easy to understand.
- Main reason
- I move to a more complex model only if it improves the agreed metric enough to matter for the business.
- Evidence
- I also consider interpretability, latency, training cost and how hard it will be to maintain and monitor.
- Link to the role
- In one project, a gradient-boosted model was only slightly better than logistic regression, so we chose the simpler model because the risk team needed to explain every decision.
Likely follow-up questions
- How much improvement would justify a complex model?
- When would interpretability matter less?
Avoid: Avoid choosing the most advanced model by default, because complexity has real costs.
Practise this question aloud17. How would you design an online test to check a new model is better than the current one?
What interviewers look for: Clear hypothesis, primary metric, randomisation, sample size, guardrails and avoiding early stopping.
Model answer
Answer structure: Direct answer, Main reason, Evidence, and Link to the role
- Direct answer
- I'd define the hypothesis and one primary business metric in advance, such as conversion rate, plus guardrail metrics like response time and complaints.
- Main reason
- Users would be randomly assigned to the current or new model, and I'd calculate the sample size needed to detect a meaningful difference.
- Evidence
- I'd run the test for the planned duration, covering full weekly cycles, and avoid stopping early just because results look good.
- Link to the role
- Afterwards I'd check results across key segments and share both the effect and its uncertainty.
Likely follow-up questions
- What would you do if the primary metric improved but a guardrail got worse?
- When would an offline evaluation be enough?
Avoid: Avoid checking results every day and stopping as soon as they look significant, because it greatly increases false positives.
Practise this question aloud18. Describe a time you had to work with messy or limited data.
What interviewers look for: Practical data cleaning, creative solutions, honest limitations and a useful outcome.
Model answer
Answer structure: Situation, Task, Action, and Result
- Situation
- A charity wanted to predict which volunteers would stop attending, but their records were spread across spreadsheets with many gaps.
- Task
- I had two weeks and only about a thousand volunteer records.
- Action
- I cleaned and merged the files, worked with staff to understand missing values, created a few simple features such as time since last shift and used a small, interpretable model with cross-validation. I was clear that results were early and should guide outreach, not decisions about individuals.
- Result
- The model identified a group at higher risk, the charity called them proactively and retention in that group improved over the next quarter.
Likely follow-up questions
- How did you decide how to handle missing values?
- What would you need to make the model more reliable?
Avoid: Avoid hiding data limitations, because honest caveats are part of responsible work.
Practise this question aloud19. How do you keep up with such a fast-moving research field?
What interviewers look for: A realistic learning routine focused on applying ideas, not chasing every new paper.
Model answer
Answer structure: Direct answer, Main reason, Evidence, and Link to the role
- Direct answer
- I follow a small set of trusted newsletters and research summaries rather than trying to read every new paper.
- Main reason
- Each month I pick one idea relevant to our work and try it on a small internal problem.
- Evidence
- I also join a reading group with colleagues, where we each present a paper and discuss whether it would help us in practice.
- Link to the role
- Recently that led me to try a better evaluation method for our text classifiers, which we now use as standard.
Likely follow-up questions
- What's a recent development you're sceptical about?
- How do you decide what's worth trying?
Avoid: Avoid listing the latest trends without showing how you've applied any of them, because interviewers value practical judgement.
Practise this question aloud20. How do you communicate uncertainty in your results?
What interviewers look for: Using ranges and plain language, explaining what drives uncertainty and connecting it to decisions.
Model answer
Answer structure: Direct answer, Main reason, Evidence, and Link to the role
- Direct answer
- I give ranges rather than single numbers, for example 'we expect a five to eight per cent improvement' instead of 'six point three per cent'.
- Main reason
- I explain in plain words what causes the uncertainty, such as limited data for new regions.
- Evidence
- I connect it to the decision, for example by saying the result is strong enough to launch in two regions but not yet everywhere.
- Link to the role
- I also say what would reduce the uncertainty, such as running the test for two more weeks.
Likely follow-up questions
- How do you respond when a manager wants a single number?
- Tell me about a time you overstated a result.
Avoid: Avoid presenting estimates as certain, because it damages trust when results change.
Practise this question aloud
Model answers are examples that show the structure. In a real interview, use your own true experience.
More question sets
- Finance and accounting
- Banking and investment
- Consulting (fit and case)
- Marketing
- Product management
- Project management