Free AI, ML & Data Science interview questions
150 questions from the AIMLPrep bank, free to read, each with the correct answer and a detailed explanation of the reasoning and the common traps. They cover the topics interviewers ask about for data scientist, ML engineer and AI engineer roles. To practice them as a quiz with progress tracking, or to unlock all 4,000 questions, start free or see the plans.
Probability & Math interview questions
- An image-augmentation step applies a 2 × 2 linear map M to pixel coordinates. The plot shows the unit square (dashed) and its image under M (solid), with the…medium
- The table shows a telecom operator's customer mix and the average monthly revenue per user (ARPU) in each segment. What is the expected monthly revenue of a…easy
- How many times is an SVC model fitted in total when this grid search runs?medium
- An LLM routing service samples one of three candidate reply types from logits with the snippet below, at temperature T = 0.5. Up to simulation noise, what…hard
- A labelling vendor's error rate is either 2% (prior 0.7) or 10% (prior 0.3). You audit two batches of 10 independent labels: the first has 1 error, the second…medium
- A bank fine-tunes a multilingual support assistant on a corpus that is 90% English and 10% Turkish by tokens. Following common multilingual practice, it…medium
- A churn network maps four features x ∈ ℝ⁴ through a = W₁x + b₁ (W₁ is 3 × 4), h = ReLU(a) and z = W₂h + b₂ (W₂ is 2 × 3). Writing the Jacobian with entry (i,…easy
- Each week a loyalty-app user is either Engaged or Idle. An Engaged user becomes Idle the next week with probability 0.10, and an Idle user becomes Engaged…easy
- In RLHF you need the gradient of J(θ) = E[R(y)], where y is a token sequence sampled from the policy LLM π_θ and R is a reward model's score treated as a…hard
- What is the difference between independent events and mutually exclusive events?basic
- What is the dot product of the vectors [1, 2, 3] and [4, 5, 6]?basic
- In the gradient descent update θ ← θ − η∇L(θ), what is the role of the learning rate η?basic
Statistics interview questions
- To stress-test a ratio metric, a data scientist simulates 10,000 draws of the ratio of two independent standard normal noise terms (a standard Cauchy…hard
- before and after hold the weekly spend of the same 40 customers before and after a loyalty-tier change, in the same customer order. What does this ttest_ind…easy
- A pricing team fits the demand model below on weekly store data. How should the coefficient on ln(price) be interpreted?medium
- Two analysts plot kernel density estimates (KDEs) of the same 5,000 basket values from a grocery chain, one with a bandwidth of 10 € and one with 2 €. The two…medium
- A telecom emails a satisfaction survey to a random sample of the customers who have an email address on file (about 70% of all customers). About 12% respond,…easy
- A product team wants to correlate customers' satisfaction rating (1–5 stars) with their number of support contacts last quarter. What are the requirements for…easy
- Crashes on an inference cluster are modelled as a Poisson process, so the 50 observed times between crashes are i.i.d. exponential with rate λ. Their mean is…medium
- An A/B test of a new recommendation widget gives a two-sided p = 0.03 (z ≈ 2.17). Suppose the true effect exactly equals the observed estimate, and you rerun…hard
- A streaming service checks how well a user's recommendation list matches their taste. The user's viewing history p splits drama / comedy / documentary as 0.5…hard
- Two trained fraud models are scored on the same 5,000-transaction test set: AUC 0.912 for the gradient-boosted model and 0.904 for the logistic model. You…medium
- A bank's prior for the mean monthly card spend μ of a new customer segment, based on similar segments, is μ ~ N(400, 20²) €. A pilot with 64 customers gives a…medium
- Which measure of central tendency is more robust to outliers, the mean or the median, and why?basic
- Which statement about the normal distribution is correct?basic
- What does the central limit theorem (CLT) state?basic
- What is the correct definition of a p-value?basic
- When is a one-sample t-test the appropriate test?basic
- What is the correct interpretation of a 95% confidence interval for a population mean?basic
- What does Spearman's rank correlation coefficient measure?basic
- Which set of conditions is the standard list of assumptions behind classical linear regression inference?basic
- In information theory, what does the Shannon entropy H(X) of a discrete random variable measure?basic
- What is the difference between descriptive and inferential statistics?basic
Data Science interview questions
- An inventory agent asks an LLM for a JSON reorder decision and passes the fields to a typed helper. This time the model returned units as a string. What…medium
- The chart plots weekly active users of a new GenAI app on a log scale (the y-axis shows log10 of users). How should the change after week 10 be interpreted?medium
- A test ran at 10% treatment on Friday and was ramped to 50% for the weekend. Treatment converts better within each period but worse when the data are pooled…hard
- In PostgreSQL, converted is an INTEGER column holding 0 or 1. This daily conversion-rate query shows 0 for almost every day, and 1 only on days where every…easy
- A retailer's marketing mix model (MMM) transforms weekly TV spend with geometric adstock aₜ = xₜ + λ·aₜ₋₁, with λ = 0.6 and a₀ = 0, and then passes the…hard
- A telecom's plan names are s = pd.Series(["Max+ 10GB", "Max 20GB", None, "Mini 5GB"]). What do print(s.str.contains("Max+", na=False).sum()) and…medium
- A retailer exports product reviews to CSV with the columns review_id, product_id, rating, review_text, created_at and loads them into a staging table that…easy
- A loyalty system stores points as pts = np.array([1201, 350, 85], dtype=np.int64). For a 1.5× points campaign, a notebook runs boosted = pts 1.5 and then pts…medium
- A bank automatically offers a premium card to customers with an internal score of 700 or higher. You compare customers just above and just below 700 to…medium
- An online grocer's eight baskets in a pilot region have values 12, 15, 18, 22, 30, 41, 55 and 1,007. In PostgreSQL, what do PERCENTILE_CONT(0.5) WITHIN GROUP…medium
- What is an A/B test (an online controlled experiment)?basic
- In product analytics, what is meant by a north star metric?basic
- In a query that uses GROUP BY, how does the WHERE clause differ from the HAVING clause?basic
- In Python, what is the main difference between a list and a tuple?basic
Preprocessing & Feature Engineering interview questions
- A temperature sensor produced 20 readings: 17 between 48 and 52, plus 99, 100 and 101. The table shows their summary statistics. A rule that flags z > 3 using…hard
- A colleague reports a cross-validated AUC of 0.91 with this code on 200 customers and 10,000 features. As a sanity check you rerun it with randomly permuted…hard
- For an offline consumption report (not a forecasting feature), an analyst fills gaps in a building's daily energy readings. The readings were logged on…medium
- A card-fraud dataset was extracted on 30 June. A transaction's label is 1 if a chargeback had arrived by the extraction date, and chargebacks can arrive up to…medium
- A retailer's click model has 200M impressions, 2M of them clicks. To cut training cost, you keep every click and 1 in 10 non-clicks, and give each kept…medium
- A bank vectorizes 2 million support tickets with TF-IDF over a 500,000-term vocabulary; the sparse matrix has about 100 non-zeros per row (≈ 2.4 GB in CSR…medium
- A retailer's store_id has 1,000 levels. Instead of one-hot encoding, a colleague proposes binary encoding: give each store an integer code and write that code…easy
- Your features include age (years), income (TRY) and num_logins (count), on very different scales. For which group of models is feature scaling generally…easy
- A gradient-boosted house-price model for Istanbul uses raw latitude and longitude as features. Prices are highest around a few prime districts and along the…easy
- How do MCAR, MAR and MNAR differ in what the probability of a value being missing depends on?basic
- What does one-hot encoding do to a categorical feature such as color with the values red, green and blue?basic
- In model training and evaluation, what does the term data leakage mean?basic
- What is a main reason to perform feature selection before training a model?basic
Machine Learning interview questions
- Both series below rise at a similar average rate. Series A was generated as a linear trend plus stationary noise; Series B is a random walk with drift. Which…medium
- A churn model produced this confusion matrix on 10,000 customers, and a manager celebrates its 98.8% accuracy. What is the model's balanced accuracy, and what…easy
- For the query "waterproof hiking boots", assessors graded four products as relevant: Boot-X (3), Boot-Y (3), Boot-Z (2) and Sock-K (1); every other product is…hard
- A gradient-boosted tree model was trained on months 1–36 of demand, using month_index as a feature. Its forecast for months 37–48 is the flat line in the…hard
- A telecom churn model (3% churners) is evaluated with the code below and reports a mean CV recall of 0.99. On customers that were set aside before any…medium
- An insurer has 3,000 claims confirmed as fraud and 120,000 claims nobody has investigated. A calibrated classifier trained to separate confirmed (s = 1) from…hard
- A helpdesk routes tickets with a KNN classifier using Euclidean distance on TF-IDF vectors built with norm=None (no length normalisation). Tickets range from…medium
- For a declined credit-card application, an Anchors explainer returns the rule IF utilization > 0.80 AND missed_payments_12m ≥ 2 THEN decline, with precision…medium
- A payments company's fraud team reports F1 and ROC-AUC, yet trains its classifier with gradient descent on log loss. A product manager asks: "Why not minimise…easy
- A food-delivery app ranks restaurants with a Wide & Deep model: the wide part is a linear model on crossed features such as user_last_cuisine ×…medium
- A telecom wants k = 20 segments for 50 million subscribers described by 40 numeric features stored as float64. Full-batch k-means (Lloyd's algorithm)…medium
- An e-commerce team trains pricing agents in a simulator and keeps a large buffer of transitions collected by older versions of its policies. Which grouping of…easy
- A telecom team tunes a churn network with successive halving: 81 configurations, a minimum budget of 1 epoch, a maximum of 81 epochs and η = 3 (keep the best…easy
- What is the difference between model parameters and hyperparameters?basic
- What does the bias–variance trade-off describe?basic
- What does the mean squared error cost J(w) = (1/n) Σ (yᵢ − ŷᵢ)² measure for a linear regression model?basic
- What does the Gini impurity of a decision-tree node measure?basic
- Which statement correctly contrasts bagging and boosting?basic
- What is the "naive" assumption in Naive Bayes?basic
- Which description matches the standard k-means (Lloyd's) algorithm?basic
- What does precision measure for a binary classifier?basic
- How does k-fold cross-validation work?basic
- How does grid search look for good hyperparameters?basic
- What is the difference between batch gradient descent and stochastic gradient descent (SGD)?basic
- In reinforcement learning vocabulary, what is the reward?basic
Deep Learning interview questions
- Two system outputs are scored against a single reference in the table. Which interpretation of the scores is correct?medium
- A telecom's search-box autocomplete uses a bigram language model with add-one (Laplace) smoothing, P(w prev) = (c(prev, w) + 1) / (c(prev) + V). The table…medium
- The table shows how two tokenizers split the same text. What do the ## and Ġ markers mean?medium
- A retailer wants to cut the mobile-app download size of a product-image classifier (dense top-1 76.1%) by pruning it and shipping the weights in a compressed…medium
- A retailer's Stable Diffusion 1.5 pipeline uses classifier-free guidance, ε̂ = ε_uncond + w·(ε_cond − ε_uncond), with w = 7.5. For one latent element at one…medium
- An LLM interpretability team trains a sparse autoencoder (SAE) on residual-stream activations of size 4,096, with a 65,536-unit ReLU code layer and an L1…easy
- As an ablation, you delete every self-attention sublayer from a trained BERT-style encoder but keep the token and position embeddings, the feed-forward (FFN)…easy
- A grocery chain trains a CNN to grade bananas on a conveyor belt as unripe, ripe or overripe from camera images. Which augmentation is most likely to hurt the…easy
- In a deep MLP with sigmoid activations, the error signal reaching the first layer's weights has passed through ten sigmoid derivatives. Ignoring the weight…hard
- A teammate multiplies a recommender's training loss by 100 so the dashboard shows larger numbers. For one weight the gradient has been steady at g = 0.004 per…hard
- In neural network training, what is an epoch?basic
- What is the ReLU activation, and why is it a popular default for hidden layers?basic
- In neural network training, what is backpropagation?basic
- What does dropout do while a neural network is being trained?basic
- What does a 2-D convolutional layer compute at each output position?basic
- In a vanilla recurrent neural network, what is the hidden state?basic
- What is the core idea of an attention mechanism in a neural network?basic
- Which statement best defines transfer learning?basic
Generative AI interview questions
- Asked for "revenue and number of orders that contain electronics, by customer segment", a text-to-SQL bot generated the query below. The Gold segment has…medium
- The table shows the next-token distribution at one decoding step for the context "The customer wants to ___". With top-p = 0.9 (nucleus sampling, no top-k),…medium
- A team reports that a new prompt raised RAGAS faithfulness on a 300-question set from 0.81 to 0.86: the old score is from last month, the new one was computed…hard
- A loan pre-screening step uses the schema below with constrained decoding, which emits properties in schema order. Reviewers find that reasoning usually…easy
- The flow shows one generation step of a decoder-only LLM (GPT- or Llama-style). What happens at the highlighted step?easy
- From the same logits, a teacher LLM gives these next-token probabilities after "I want to ___ my subscription" (restricted to five candidate tokens): cancel…hard
- A retail client wants a customer-facing assistant over ~5,000 public help-center pages and product PDFs, live in six weeks, with a team of two engineers.…medium
- To save tokens, a bank adds an LLM extractor after retrieval that keeps only the sentences relevant to the question from each of the top 8 chunks. Context…hard
- A telecom's support assistant has no reference answers for live traffic, so the team wants implicit signals as quality proxies: the user rephrases the…medium
- A retailer trained a LoRA adapter on acme-8b (the base model). The serving team loads it onto acme-8b-instruct, which has the same architecture. It loads…easy
- Which statement about the HNSW parameters M, efConstruction and efSearch is correct?medium
- An e-commerce team writes product descriptions with a prompt that includes three example descriptions, all for one brand's running shoes. New descriptions for…easy
- What is a large language model (LLM)?basic
- What is the difference between zero-shot and few-shot prompting?basic
- What is retrieval-augmented generation (RAG)?basic
- What does it mean to fine-tune a pretrained LLM?basic
- A chatbot's conversation history is growing longer than the model's context window. What is a common way to handle it?basic
Agentic AI interview questions
- During an outage, a retailer's inventory API answers every request with HTTP 503. The shopping assistant reaches it through the three layers below; assume the…hard
- After one chat, a grocery-delivery assistant's memory extractor proposed the candidate long-term memories below. Which write policy keeps later recall precise?medium
- Trace mining of 50,000 runs of a telecom billing-support agent gives the tool paths below. The team will hard-code the three most frequent paths as…hard
- What control flow does this LangGraph graph implement?easy
- A retail client wants to benchmark a customer-service agent that must follow a written returns policy, call order-management APIs and handle multi-turn…easy
- You are building an MCP server for a retailer's merchandising team. (1) summarize_reviews needs an LLM to condense 500 reviews, but the server must not hold…medium
- A telecom network-diagnosis orchestrator fans out to 8 sub-agents in parallel (one per system: radio network, core, billing, …) and waits for all of them…easy
- A bank's document pipeline in Google's Agent Development Kit (ADK) must always run extract → validate → summarise, in that order. It is built as an LlmAgent…medium
- A bank moves its claims-triage planner from a general chat model to a reasoning model. The old prompt says "Think step by step", lists a fixed 10-step script…medium
- In LLM applications, what is an AI agent?basic
- Why do long-running agents checkpoint (persist) their state after each step?basic
AI Safety & Security interview questions
- A retailer's shopping app calls the LLM provider directly from the client with the code below; the key is injected from an environment variable at build time.…easy
- A consultancy's responsible-AI board reviews the five incidents below. Which mapping to harm types (allocation, quality of service, stereotyping, denigration,…medium
- In this enterprise RAG pipeline, users must never receive content from documents they are not permitted to read. Where should that rule primarily be enforced?medium
- Five banks plan to train a shared fraud model with federated learning: each bank trains on its own transactions and sends only model updates to a coordinating…medium
- An e-commerce company has trained a new jailbreak classifier for its shopping assistant. It scored well on an offline labelled set, but the team worries it…easy
- A bank's research agent answers each analyst question from k = 20 retrieved web chunks and produces 500,000 answers a month. Assume 1% of retrieved chunks…hard
- An open-weight general-purpose AI (GPAI) model was trained with 6 × 10²⁴ FLOP, as its developer documents. A telecom LoRA-fine-tunes it with 2 × 10²⁰ FLOP and…hard
- A retail assistant's release gate is a 2,000-prompt single-turn jailbreak suite plus a classifier that scores each user message on its own. A red-teamer asks…medium
- What is prompt injection in an LLM application?basic
MLOps & Production interview questions
- An 8B support model (≈ 16 GB of BF16 weights) is served with a vLLM-style engine as shown below. At peak, the time per output token (TPOT) spikes and the…hard
- Re-running the training job below from the same git commit one month later gives a validation AUC of 0.861 instead of the logged 0.874. The library versions,…medium
- Estimate the monthly LLM bill for this RAG chatbot workload. Every user turn is a separate API call that re-sends the full prompt.medium
- What does this symmetric INT8 quantization snippet print, and which statement about using an asymmetric (zero-point) scheme for ReLU outputs is correct?medium
- A telecom team adds a new feature, dropped_calls_7d, produced by a streaming job from network events starting today. To train on 18 months of history, past…hard
- A retailer's progressive-delivery pipeline shifts traffic to a new recommendation-API version in steps of 5% → 25% → 50% → 100%. At each step, automated…medium
- A telecom support bot on a self-hosted vLLM server sends a 3,000-token system prompt plus the growing chat history on every turn. After you enable automatic…easy
- A security review of a retail client's Google Cloud project finds that the Vertex AI training pipeline, a GKE scoring service and a nightly export job all run…easy
- On a GKE cluster you deploy a model server as a Deployment with 3 replicas and expose it with a Service. Which statement correctly describes these Kubernetes…easy
- Which statement best defines MLOps?basic