ML Interview Questions List
Technical questions (ML / DL / NLP / CV / LLM)
Below are categorized technical questions you might be asked in interviews. I grouped them so you can focus practice by area.
Fundamentals & Math
- Define bias–variance tradeoff and how you would diagnose it.
- Derive gradient descent update for a simple linear regression and explain convergence conditions.
- Explain cross-entropy loss and why it is used for classification.
- What is softmax? Why can naive softmax be numerically unstable and how to fix it?
- Explain L1 vs L2 regularization and when to use each.
- What is Bayes’ theorem and how is it used in probabilistic models?
- Show how backpropagation works for a 2-layer neural network (write equations).
- Explain vanishing/exploding gradients and how batch norm / residual connections mitigate them.
- What is the Jacobian and Hessian; why are they relevant to optimization?
- Explain the difference between likelihood and posterior.
Optimization & Training
- Compare SGD, SGD+momentum, RMSProp, and Adam (advantages / failure modes).
- What is learning rate scheduling? Describe step, cosine, linear warmup, and cyclical LR.
- How does gradient clipping work and when is it used?
- Explain batch normalization, layer normalization, and group normalization and where each is appropriate.
- What is weight decay and how is it implemented in optimizers like AdamW?
- How do you debug a training run where loss is NaN? Step-by-step checklist.
- How do you choose batch size and how does it affect generalization and training stability?
- What are common initialization schemes (Xavier/He) and why initialization matters.
- Explain mixed-precision training and loss-scaling.
- How to perform hyperparameter tuning at scale (Bayesian, grid, random)?
Losses & Evaluation Metrics
- Write the formulas for MSE, MAE, cross-entropy, focal loss, hinge loss.
- When to use AUC vs accuracy vs precision/recall vs F1?
- Explain mAP (mean Average Precision) and IoU in object detection.
- What is NLL (negative log-likelihood) and how is it related to cross-entropy?
- Explain BLEU, ROUGE, and METEOR for NLP evaluation — strengths/weaknesses.
- How to evaluate a medical imaging model where false negatives are costly?
- What is calibration and how to measure and improve it?
- Explain confusion matrix and derived metrics.
- How to evaluate ranked retrieval systems (MRR, NDCG, precision\@k).
- How do you measure model robustness and adversarial vulnerability?
Convolutional Neural Networks / Computer Vision
- Explain what a convolution operation does (mathematically and intuitively).
- What are depthwise separable convolutions and where are they used?
- Describe residual blocks (ResNet) and why they enable deeper networks.
- Explain dilated/atrous convolutions and use-cases.
- Describe Feature Pyramid Networks (FPN) and why they help detection/segmentation.
- Differences between FCN, U-Net, and UNet++ for segmentation.
- How do object detectors like Faster R-CNN differ from SSD / YOLO?
- How does Non-Maximum Suppression work? Problems and improvements.
- Explain anchor boxes and anchor-free detection approaches.
- What are common data augmentations for images and how can augmentation bias models?
Transformer Architectures & Attention
- Derive scaled dot-product attention and explain the role of the scaling factor.
- What is multi-head attention and why multiple heads help?
- Explain positional encodings and alternatives (learned, rotary).
- What is layer normalization placement (pre-norm vs post-norm) and tradeoffs?
- Describe transformer encoder vs decoder vs encoder-decoder.
- How does attention complexity scale with sequence length and mitigation techniques (sparse, linear attention)?
- Explain relative vs absolute positional encodings.
- What is the mathematical form of softmax attention and its computational bottlenecks?
- How do you implement causal attention for autoregressive models?
- Explain FlashAttention (high-level) or any kernel-level speedups (if asked technically).
NLP / Language Modeling / LLMs
- What is perplexity and how is it computed? Pros and cons.
- Explain autoregressive vs masked language models.
- What is fine-tuning vs instruction-tuning vs parameter-efficient tuning (LoRA, adapters)?
- Explain embeddings: how they are generated and evaluated.
- What is retrieval-augmented generation (RAG) and pipeline components (retriever, index, reader)?
- How to build a vector database and choose similarity metric (cosine vs dot vs L2)?
- How to mitigate hallucinations in LLMs? List strategies.
- What is chain-of-thought prompting and why does it help?
- Explain concepts of few-shot and zero-shot learning with LLMs.
- How to evaluate factuality of LLM outputs at scale?
Self-supervised & Contrastive Learning
- Explain contrastive loss (InfoNCE) and negative sampling.
- What are SimCLR, MoCo, BYOL high-level differences?
- How does contrastive learning apply to multimodal (image-text) setups?
- What are pretext tasks for self-supervision in vision and NLP?
- Describe masked autoencoding (MAE) and why it works.
Generative Models (VAEs / GANs / Diffusion)
- Explain the VAE objective and ELBO derivation.
- What are mode collapse and instabilities in GANs? How to mitigate?
- Explain diffusion models (forward + reverse process) at a high level.
- Compare VAEs, GANs, and diffusion models for image generation.
- How to evaluate generative models (FID, IS, human eval)?
Sequence Models & Time Series
- Compare RNN, LSTM, GRU, and Transformer for sequential data.
- What are teacher forcing and scheduled sampling?
- Explain temporal convolutional networks (TCN).
- How to do time-series cross-validation (walk-forward validation)?
- How to avoid leakage in time-series modeling?
Graph ML
- What is a GNN (GCN/GAT) and how message passing works?
- How do you create graph features for fraud detection?
- What is node2vec? How does it differ from classical embeddings?
- Describe graph sampling strategies for scaling GNNs.
- Explain transductive vs inductive graph learning.
Model Compression, Serving & Inference
- Describe quantization (post-training and quant-aware training).
- What is pruning (structured vs unstructured) and how to retrain after pruning?
- Explain knowledge distillation and student-teacher training.
- How to design a low-latency inference pipeline for on-device LLMs?
- How do you benchmark model latency and throughput? Important metrics.
Safety, Privacy & Ethical ML
- Define differential privacy (ε, sensitivity) and DP-SGD basics.
- Explain federated learning high-level and challenges (heterogeneity, communication).
- What is model inversion and membership inference? Mitigations?
- How to audit a model for bias and unfairness? Procedure and metrics.
- Considerations for medical/clinical ML deployment (regulatory, interpretability).
Scaling, Distributed Training & Systems
- What is data-parallel vs model-parallel training? Pros/cons.
- Explain gradient accumulation and when to use it.
- Describe pipeline parallelism and challenges.
- How to handle large token contexts in training (memory & compute strategies).
- Explain sharded optimizer states (ZeRO stages) at a high level.
Practical Coding & Debugging / Whiteboard-style
- Write pseudocode for a training loop with data loader, forward, loss, backward, optimizer step.
- Given a model with sudden accuracy drop on validation, list systematic debug steps.
- How to implement custom Dataset and DataLoader in PyTorch for multi-modal data?
- How to profile a PyTorch training step and find bottlenecks?
- Implement (or explain) a numerically-stable softmax cross-entropy in code.
Advanced / Researchy
- How to design an ablation study and report it convincingly?
- Explain NTK or the lottery ticket hypothesis at a high level.
- How to read and critique a ML paper (method, experiments, baselines)?
- Tips to ensure reproducibility across hardware and randomness.
- How would you formulate a novel research question in your domain (e.g., low-cost fundus screening)?
Behavioral questions
(Use STAR: Situation, Task, Action, Result — prep concise 1–2 min answers)
- Tell me about yourself / walk me through your resume.
- Describe a challenging technical problem you solved end-to-end.
- Tell me about a time your project failed — what happened and what you learned?
- Describe a conflict with a teammate and how you resolved it.
- Give an example where you led or mentored others.
- Describe how you prioritize work when you have multiple deadlines.
- Tell me about a time you had to convince stakeholders to change direction.
- Describe a time you improved a process (codebase, CI/CD, data pipeline).
- How do you handle criticism of your code or design?
- Tell me about a time you had to learn a new technology quickly for a project.
- Describe a time when you made a tradeoff for product deadlines (quality vs speed).
- Give an example of a time you took ownership beyond your job description.
- How do you approach giving and receiving feedback?
- Tell me about a challenging stakeholder (clinician, customer) in a healthcare project.
- Describe a time you had to explain a complex technical idea to a non-technical audience.
Targeted questions (project- & resume-specific)
Below are focused prompts tied to the projects and roles on your resume (use these to prepare deep dives & demos).
AIFred / Local coding assistant
- Explain the full architecture (ASR → retriever → LLM → UI) and reasons for each component.
- Why pick an on-device LLM (privacy/latency) and what compromises did you accept?
- How did you select and build the retrieval corpus? Embedding model, chunking, indexing?
- How did you measure and optimize end-to-end latency (numbers and techniques)?
- How did you handle user privacy and local storage encryption?
- Describe a bug/perf issue you solved in the Electron/Streamlit UI.
- How would you extend the system to support multi-language code completion?
- How do you keep the assistant up-to-date without uploading user code?
FundusAI / Smartphone fundus imaging
- Walk through the imaging pipeline — optics, capture, preprocessing, model inference.
- How did you validate labels and what inter-rater agreement metrics did you use?
- Describe the hardware adapter (3D-printed) constraints and how they affect model input.
- What clinical metrics did you optimize for and why?
- How did you ensure the model is robust to lighting and device variability?
- What are deployment and regulatory considerations for a screening tool?
- Present an example false positive & false negative and how you’d fix them.
Document Tampering / YOLOv8 Project
- Why YOLOv8 for tampering detection — performance vs complexity?
- How did you annotate tampered regions and ensure label consistency?
- How did you evaluate generalization to unseen tampering types?
- How did you decide metric thresholds and tradeoff precision vs recall?
- Describe data augmentation and synthetic tamper generation (if used).
Fraud detection & Graph-RAG
- Explain the graph schema you used (nodes, edges, attributes).
- Walk through a production alert path: ingestion → scoring → human review.
- How did you measure business impact (recovered $ / false alert rate)?
- How do you handle evolving fraud patterns and model drift?
- Why use Graph-RAG for retrieval, and how does it improve answers over plain RAG?
Open-source, Teaching & Writing
- Examples of PRs you led — what was the technical challenge and community outcome?
- How did you structure tutorials / workshops for non-research audiences?
- How do you measure impact of technical writing (downloads, stars, adoption)?
- How do you ensure documentation stays up to date with code?
GPU / Performance / Triton (if on resume)
- Explain kernel memory access patterns and common optimizations (tiling, shared memory).
- Describe a profiling workflow (Nsight / profiler) and one optimization you implemented.
- How would you convert a slow PyTorch op to a Triton kernel (high-level)?
If you want, I can now:
- Expand any one category into 50+ practice questions with answers.
- Generate concise model answers / formulas (math-focused) for the top 30 technical items.
- Produce STAR-formatted behavioral answers based on your resume content.
Which of those should I do next?
Enjoy Reading This Article?
Here are some more articles you might like to read next: