KatInterview

Topic

Machine Learning interview problems

Modeling, evaluation, ML systems and LLM engineering. 511 original problems, each with a worked model answer.

Problems511

27 easy274 medium210 hard

Showing 151–180 of 511 results

  • Contrast LayerNorm and RMSNorm formulas, what removing centering changes, and why many large language models adopt the simpler normalization.

    Model answertransformersnormalizationlayernormrmsnorm
  • Evaluate an ML preprocessing codebase for design decisions, sklearn API conventions, data leakage prevention, code quality issues, and critical unit testing strategy.

    Model answerdata-preprocessingscikit-learncode-reviewunit-testing
  • Answer four high-frequency technical questions on LLM inference optimization, evaluation for tool use, and quantization trade-offs.

    Model answerLLMInference OptimizationKV CacheQuantization
  • Write a vectorized k-means routine that groups N points into k clusters by alternating nearest-centroid assignment with mean updates, handling empty clusters and convergence.

    Model answerk-meansclusteringnumpyunsupervised-learning
  • Design a large-scale personalized social network feed architecture and compare pointwise, pairwise, and listwise ranking strategies across training, serving, and business metrics.

    Model answermachine learning system designlearning to rankmulti-task learningrecommendation system
  • Design a daily forecasting pipeline that spots products about to surge in sales, plus a sub-100ms personalized homepage feed that surfaces them, including cold-start handling.

    Model answerml-system-designrecommendationtime-series-forecastingcold-start
  • Pick the option that does not reliably address vanishing gradients in a deep network and justify it, while assessing how the other three techniques work and where they fall short.

    Model answerdeep-learningvanishing-gradientsbackpropagationbatch-normalization
  • Open-ended discussion on what alignment means, how to spot and reduce misalignment, how to handle misuse, and how to design one falsifiable research experiment.

    Model answerai-alignmentai-safetyevaluationinterpretability
  • Decide which statement best explains boosting for classification and justify it using sequential fitting, signed margins, surrogate losses, and the limits of margin guarantees.

    Model answerboostingadaboostmarginensemble-methods
  • Design a production-grade infrastructure for real-time generative AI inference that supports streaming, low-latency SLOs, multi-region failover, and efficient GPU utilization.

    Model answerml system designgenaillm servinggpu scheduling
  • Explain why transformer decoders cache keys and values, size that cache for a given model, and reason about running prefill and decode on separate GPU pools.

    Model answerllm-servingkv-cacheinferencegpu-memory
  • Design a latency-bounded pipeline that averages repeated LLM sentiment scores, measures run-to-run stability, and computes how many samples a 95% error target needs.

    Model answerllm-inferenceconfidence-intervalssample-sizevariance-reduction
  • Design an end-to-end model that forecasts hourly bike pickups at one docked station for the next 24 hours, covering target definition, features, models, and evaluation.

    Model answertime-seriesforecastingcensored-datafeature-engineering
  • Prepare to present a paper you authored to a reviewer who has read it and will probe its experimental design, real-world usefulness, and how newer work changes its claims.

    Model answerresearch-paperexperimental-designself-critiqueablations
  • Architect an ML inference and labeling ecosystem for real-time speech moderation, covering cascading stages, calibration, metadata storage, and active learning loops.

    Model answermachine-learningsystem-designaudio-processingactive-learning
  • Explore techniques to make hard MoE routing differentiable, comparing straight-through estimation, Gumbel-Softmax, REINFORCE, and gate-scaling alongside auxiliary anti-collapse mechanisms.

    Model answermixture of expertsgumbel softmaxreinforcegradient estimation
  • Design a small tensor class that records a computation graph for add, mul, matmul, ReLU and sum, then runs reverse-mode differentiation to give correct gradients for every input.

    Model answerautogradbackpropagationreverse-mode-differentiationpytorch
  • Design a robust data cleaning, pipeline, validation, and threshold-tuning strategy to predict session conversions evaluated on weighted F1 score.

    Model answerdata-preprocessingfeature-engineeringcross-validationclassification
  • Pick precision, recall, or F1 for three moderation models with different error costs, then reason about recall-oriented tuning and how thresholds move the operating point on a PR curve.

    Model answerprecision-recallf1-scoreclass-imbalancethreshold-tuning
  • Design an ML recommendation engine for financial credit offers that balances default risk prediction, user acceptance propensity, risk calibration, fair lending compliance, and feedback loop mitigation.

    Model answermachine-learningsystem-designrecommendation-systemcredit-risk
  • Design an automated active learning system that iteratively proposes, screens, and refines DNA sequences to maximize gene expression within physical synthesis constraints.

    Model answeractive learningbayesian optimizationsequence encodingml system design
  • A broad machine-learning fundamentals question covering model fit diagnostics, augmentation, CNNs, RNNs, transformer encoders, dropout and ensemble methods.

    Model answeroverfittingbias-variancecnntransformers
  • Design a production-grade causal pipeline detailing DAG specifications, doubly robust estimation, off-policy evaluation, sensitivity bounds, and constrained policy deployment.

    Model answercausal-inferenceuplift-modelingdouble-robustoff-policy-evaluation
  • Four connected ML fundamentals: why log loss suits sigmoid outputs, how batch size shapes training, how L1 and L2 differ, and how leaf size controls bias and variance in trees.

    Model answercross-entropysgdregularizationdecision-trees
  • Select and justify the best two evaluation strategies for assessing the factual correctness and domain consistency of a specialized medical RAG pipeline.

    Model answerragllm-evaluationmachine-learningnlp
  • Explain how IO-aware attention kernels, cached keys and values, and rotary position encoding each remove a different bottleneck in transformer training and decoding.

    Model answertransformersflashattentionkv-cacherope
  • Design an end-to-end machine learning system to rank comments on high-traffic posts, balancing user engagement, content quality, low latency, and cold-start handling.

    Model answerranking-systemmulti-task-learningsystem-designrecommendation-systems
  • Design a calibrated probability model that estimates how likely each soccer shot is to score, covering feature design, sparse regions, proper loss functions and calibration.

    Model answerprobability-estimationfeature-engineeringcalibrationlog-loss
  • Walk one request through an LLM serving engine that stores attention state in fixed-size memory blocks, covering scheduling, prefill, decode, block tables, memory reclamation and latency trade-offs.

    Model answerllm-inferencekv-cachepaged-attentioncontinuous-batching
  • Demonstrate how to apply standardization to one column and min-max normalization to another using scikit-learn without data leakage, and explain the theoretical trade-offs of each.

    Model answerpreprocessingfeature-scalingscikit-learndata-leakage

More topics