ML foundations and AI interview prep
Contents
This study guide covers machine learning (ML) and artificial intelligence (AI) interviews. Try the first practice session, then pick the topic your interview calls for. Spend more time on data splits and evaluation for data science, system design for applied ML engineering, and implementation and debugging for research engineering or large language model (LLM) roles.
A 45-minute first pass
- Explain a model for 15 minutes. Spend one minute explaining how you would spot overfitting and what you would check next. Read the answer after you finish. MLQuestions on overfitting and underfitting
- Write code for 20 minutes. Implement softmax from scratch. Test it on large inputs, then add the same constant to every score and check that the output stays the same. Deep-ML softmax exercise
- Spend 10 minutes on a follow-up. For classic ML, explain how raising a threshold changes false positives and false negatives. For language models, sketch which tokens each position can see through a causal mask. Precision vs. recall · GPT causal mask code
ML foundations: explain the choice
Probability Cheatsheet
A compact reference for probability formulas and common distributions.
Study Use a two-stage sampling example to practice conditional probability and total expectation, then use the law of total variance to separate variation within groups from variation between groups. Conditional probability · PDF page 1 · Total expectation and variance · PDF page 4ML-NLP
Chinese-language notes on algorithms with code and interview topics.
Study Compare logistic regression, decision trees, and random forests. Explain what result would make you replace a logistic regression baseline. Logistic regression · Decision trees · Random forestsAIMLInterviews · ML Fundamentals
The fundamentals chapter of a broader technical interview guide.
Study Use training and validation performance to distinguish underfitting from overfitting. Explain how you would split the data. Bias and variance · Data splitting codeEducatum · AI/ML Interview Playbook
Study paths and classic interview questions organized by topic.
Study Explain how logistic regression can handle class imbalance. With only 100 alerts reviewed each day, choose a metric and explain how you would set a threshold on the validation set. Educatum's class imbalance question · ROC and precision–recall curvesData Science Interview Questions and Answers
A question bank covering statistics, probability, and modeling.
Study Use the central limit theorem to reason about uncertainty in a sample mean, then design an A/B test. If each user can visit several times, explain the unit of randomization and the primary metric. Q1 · Central limit theorem · Q2 · A/B testingMLQuestions
Technical interview questions on machine learning and computer vision.
Study Explain why generating a fresh random data split for each model makes the evaluation results harder to compare. MLQuestions on data splitting
ML coding: from NumPy to a Transformer
Deep-ML
Python exercises you can run and test in the browser.
Study Work from matrix operations and gradient descent to multi-head attention. Write down the tensor shapes, then add a causal mask to your own implementation. Matrix–vector product · Gradient descent for linear regression · Multi-head attentionAIMLInterviews · ML Coding
Practice prompts for implementing algorithms and model components in interviews.
Study Implement K-means assignments and updates under a time limit. Test a small example by hand, then test an empty cluster. K-means notebook · Reference implementationKarpathy · Neural Networks: Zero to Hero
A hands-on course that starts with automatic differentiation and builds up to a small language model.
Study Use micrograd to review computation graphs. Implement the forward and backward passes of a two-layer perceptron, then check one weight with finite differences. micrograd notebook · Two-layer backpropagation exercise · Worked notebookStanford CS336 · Assignment 1
A course assignment that brings tokenization, Transformer components, and the training loop together.
Study Implement scaled dot-product attention. Use the tests to check masking and inputs with extra batch dimensions. Assignment problem · PDF page 24 · Attention tests
ML system design: put the model in a product
AIMLInterviews · ML System Design
A framework for answering system design questions, with worked cases.
Study Turn the product goal into something you can measure. Define the label and offline metric, then say what you would check after launch. Problem formulation · Offline and online metricsChip Huyen · Machine Learning Systems Design
A guide to data pipelines, training, and serving.
Study Check which training features are available at prediction time and how you would measure serving latency. Data pipeline · ServingDatawhale fun-rec
A Chinese-language recommendation systems textbook and exercises, from retrieval through reranking.
Study Start with the two-tower model. Explain how many candidates each stage handles, then sketch how impressions become training feedback. Two-tower retrieval · Ranking and preference prediction
Interview follow-up Offline ranking improves and the live click rate stays flat. Which check would you start with among experiment assignment, retrieval coverage, and serving latency? Explain what it could rule out.
Language models and AI engineering: pick a specialty
Model internals and training
Dive into LLMs
Chinese-language labs from Shanghai Jiao Tong University coursework, including fine-tuning and deployment.
Study Use the fine-tuning lab to identify the pretrained weights, the task data, and the parameters that get updated. Say how you would compare results before and after training. Fine-tuning modules · Fine-tuning notebookEducatum · Advanced language model and generative AI questions
A question bank for oral practice on language models and generative AI.
Study Explain how self-attention assigns weights to input positions. Sketch a causal mask, then explain why training can process positions in parallel and generation decodes one token at a time. Educatum's self-attention question · Causal mask code
Retrieval and agents
Hands-On Large Language Models
Code from the book of the same name. Chapter 8 covers semantic search and retrieval-augmented generation (RAG).
Study Run a retrieval example from Chapter 8 and pick a question it gets wrong. Inspect the retrieved evidence and generated answer separately. Chapter 8 notebook · Open in Google Colablearn-harness-engineering
Projects on agent workspaces, execution feedback, and verification.
Study Follow P05’s generator and evaluator setup. Add a rubric check for whether the evidence supports the answer, then try it on an unsupported answer. P05 project brief · Example evaluator rubricEducatum · AI engineering questions
Questions and answers for artificial intelligence engineering interviews.
Study Use the ReAct question to explain how an agent alternates actions and observations. Then say what you would log to reproduce and diagnose a failed task. Educatum's ReAct question · LangSmith on traces
Inference and post-training
vLLM
An inference and serving engine for language models.
Study Read how PagedAttention stores the key–value (KV) cache in blocks. Write a small cache, compare token-by-token decoding with a full forward pass, then reason about memory and latency as context grows. PagedAttention block concepts · Cache allocation functionverl
A framework for post-training language models with reinforcement learning.
Study Trace group relative policy optimization (GRPO). Follow several responses to the same prompt through reward scoring, advantage estimation, and the policy update. GRPO example configuration · Advantage calculation function
More questions and practice
Cheng Zhang’s ML engineering question bank
Interview questions organized by topic and difficulty.
Study Explain why cross-entropy works for classification, then pick two more questions on topics you find difficult. Write down the first follow-up that stops you. Cross-entropy question · jumps in browsers that support text fragmentsSilvia Sapora’s ML interview guide
A preparation guide with programming and debugging exercises.
Study Pick one exercise from the coding and debugging checklist and solve it under a time limit. Redo the part you missed the next day. ML coding and debugging checklist