Skip to content
Preptima

Data & AI Engineering interview questions and answers

Data engineering, ML engineering and LLM/RAG interview questions covering pipelines, model evaluation, overfitting, retrieval, embeddings, vector search and production AI systems.

40 published across 8 topics.

Python for Data

2 questions

Idiomatic Python, pandas and vectorisation, memory behaviour, and writing correct transformations.

Data Pipelines

11 questions

Batch versus streaming, orchestration, idempotent backfills, and lakehouse and medallion layering.

hardDesignScenario

You must ingest all of English Wikipedia every day, and the source does not want to be hammered. What runs, how often, and what do you do about the run that fails at hour six?

Do not re-download Wikipedia daily. Use incremental ingestion: load the published dump once, follow the recent-changes feed, and fetch only the latest revision of each changed page in small, polite batches. Checkpointing each batch behind a revision-guarded write lets a run that fails at hour six resume.

6 minmid, senior, staff
hardScenarioDesignConcept

A transform has been writing wrong revenue figures for three days and six downstream tables have consumed it. How do you backfill the corrected data without double-counting anything?

Make the write idempotent before you make it correct: partition-level replace rather than append, so rerunning a day produces the same result whether it runs once or five times. Then work out how far the contamination spread, because a downstream table that accumulated rather than recomputed will not fix itself when the source is repaired.

4 minmid, senior, staff
hardScenarioDesign

A DAG that finished in an hour now takes nine and blocks everything behind it. How do you find out where the time went?

Sum the task durations and compare that with the wall-clock span, because nine hours of waiting and nine hours of work are different problems. If the sum is still an hour, you are queueing on a bounded worker pool, usually behind sensors holding slots; if a task genuinely grew, its own duration history over the last thirty runs tells you whether it stepped or sloped.

6 minmid, senior, staff
hardScenarioDesign

How would you design a data lakehouse to handle petabytes of data with frequent GDPR right-to-be-forgotten requests and rapid schema evolution without sacrificing query latency?

An authoritative discussion on Apache Iceberg's table format, focusing on hidden partitioning, the trade-offs of copy-on-write versus merge-on-read, and managing schema drift at scale. Use this data engineering answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects data lakes to the point an interviewer is testing.

3 minsenior, staff
hardScenarioDesign

How do you implement dynamic PII masking across a highly decentralised data mesh without destroying the analytical utility of the data for downstream machine learning workloads?

An examination of decentralised data governance, exploring dynamic masking in the compute layer, deterministic tokenisation for referential integrity, and standardised tagging. Use this data engineering answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects data governance to the point an interviewer is testing.

2 minsenior, staff
hardDesignScenario

How would you design a data pipeline you can safely re-run?

Design a safely rerunnable data pipeline by making each output partition a deterministic result of its input partition, overwriting instead of appending, and writing into idempotent sinks that tolerate retries and late events.

6 minmid, senior, staff
hardScenarioDesign

How do you diagnose and eliminate extreme data skew in a massive Apache Spark ETL pipeline when standard Adaptive Query Execution (AQE) fails to prevent out-of-memory crashes?

An analysis of distributed processing bottlenecks, addressing the limitations of AQE, implementing manual key salting for shuffle optimization, and restructuring data layouts. Use this data engineering answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects batch processing to the point an interviewer is testing.

3 minsenior, staff
hardScenarioDesign

How do you architect a strictly low-latency, real-time pipeline to ingest, embed, and index tens of thousands of unstructured documents per second into a vector database?

Designing a robust streaming architecture for embedding generation, detailing GPU adaptive batching, Kafka-driven backpressure management, and asynchronous HNSW indexing. Use this machine learning answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects data engineering to the point an interviewer is testing.

3 minsenior, staff
All 11 in Data Pipelines

Spark & Big Data

4 questions

Partitioning and shuffles, skew, joins at scale, catalyst and lazy evaluation, and cluster tuning.

hardDesignScenario

Your Spark batch pipeline now needs results inside a minute. Do you move to Flink, and what breaks if you do?

Usually not yet. Itemise the minute across source, trigger interval, processing and read visibility, because a few-second micro-batch in Structured Streaming often fits it. Flink earns the move at sub-second latency or per-record state, and what breaks is the operational model: a long-lived job whose state you must migrate, and a sink that must be idempotent.

6 minmid, senior, staff
hardDesignScenario

A graph of two billion edges will not fit on one machine and the algorithm needs neighbours. How do you partition it?

Check the premise first, because two billion edges as vertex id pairs is about 32GB and that fits in one large machine. If it genuinely must be distributed, partition edges rather than vertices, since real graphs are power-law and a single high-degree vertex under an edge cut makes its machine the straggler that every synchronous superstep waits for.

6 minsenior, staff
All 4 in Spark & Big Data

Star and snowflake schemas, slowly changing dimensions, and dbt-style transformation layering.

hardDesignScenarioConcept

Analysts want yesterday's numbers to still match after a late-arriving correction. What does the warehouse have to record?

Two time axes, not one: when the fact was true in the world, and when this warehouse first learned it. Corrections append a new version with a knowledge timestamp instead of updating in place, so a report becomes a query with an as-of predicate and reproduces for ever - and the figure you published should be snapshotted alongside it rather than reconstructed later.

7 minmid, senior, staff
All 4 in Warehousing & Modelling

ML Fundamentals

4 questions

Bias and variance, evaluation-metric selection, leakage, imbalanced data, and validation strategy.

mediumConceptScenarioCase Study

A churn model scores 0.94 AUC offline and barely beats the baseline in production. One of its strongest features is populated by a process that runs after the customer has already churned. Explain what happened and how you would fix it.

The feature encodes the outcome, so the model reads the answer rather than predicting it. Offline the label and the feature come from the same snapshot, which is why validation looks excellent; in production the feature is empty at scoring time and the signal vanishes. Fix by defining features by when they were available and validating on a forward time split.

5 minmid, senior, staff
mediumConceptScenario

Your fraud model is 99.4% accurate. Is that good?

Almost certainly not: if fraud is 0.6% of transactions, a model predicting 'not fraud' for everything scores 99.4% and catches nothing. The metric has to follow from which error costs more, which makes it a business decision expressed in numbers rather than a modelling one.

4 minmid, senior
mediumConceptScenario

How do you tell that a model is overfitting, and what do you do about it?

Detect overfitting by comparing training and validation performance on an honest split. Fix it with more or better data, simpler models, regularisation, early stopping and a final test set that is read only once. It also connects model validation to the point an interviewer is testing.

4 minentry, mid, senior
All 4 in ML Fundamentals

MLOps

8 questions

Experiment tracking, model registries, deployment patterns, drift detection, and retraining triggers.

hardDesignScenario

The recommender is good for users with history and useless for the ones who just signed up. What do you serve them?

Serve context instead of history: popularity conditioned on the country, device and referrer you already have, then re-rank on the first two clicks of the session with a model that needs no user identity. Reserve slots for exploration, and segment every offline metric by history length, because a metric averaged over users with history cannot see this cohort at all.

7 minmid, senior, staff
hardConceptScenario

A model has been degrading for months. How do you decide it should be retired rather than retrained again?

Retraining only helps when the model's premise still holds. If the proxy it predicts no longer stands for the outcome you care about, or the feature it depended on has stopped being generated, more data cannot recover it, and the decision is retirement plus a stated fallback. Use this model lifecycle answer to show the decision, trade-off, and evidence rather than a memorised definition.

5 minsenior, staff, lead
hardScenarioDesign

Would you deploy LoRA adapters or a Mixture of Experts (MoE) architecture to serve hundreds of highly specialised enterprise domains from a single foundation model, and why?

An analysis of the cost, performance, and complexity trade-offs between LoRA fine-tuning and MoE architectures for multi-tenant domain adaptation. Use this cost optimization answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects finetuning to the point an interviewer is testing.

3 minsenior, staff
hardDesignScenario

What has to be in place before you would let a model serve live traffic?

Features must be computable at decision time, training and serving must share one transformation implementation, the model and dataset version must be pinned together, drift and realised performance monitored separately because labels arrive late, and rollback must move model and features as one unit.

6 minmid, senior, staff, lead
All 8 in MLOps

LLMs & RAG

3 questions

RAG system design interview questions on embeddings, vector search, chunking, retrieval evaluation, hallucination debugging, guardrails, cost and latency.

hardScenarioDesign

Your RAG system returns confident but wrong answers. How do you debug it?

Debug a RAG system with confident wrong answers by separating retrieval failure from generation failure. Check whether the gold passage was retrieved, then measure recall@k, reranking quality, faithfulness and abstention on a labelled eval set. It also connects retrieval evaluation to the point an interviewer is testing.

5 minmid, senior, staff
hardConceptDesign

You stream the model's answer token by token to the browser. What does that change about error handling, guardrails and cost?

Streaming commits you to the response before you have seen it: the status code is already sent, any check that needs the whole output now runs after the user has read part of it, a mid-stream failure has no clean retry, and an abandoned tab keeps generating tokens you pay for. It also connects llm serving to the point an interviewer is testing.

5 minmid, senior, staff
All 3 in LLMs & RAG

Distributions, hypothesis testing, A/B design, and reading a result honestly.

hardConceptScenarioCase Study

Your A/B test was configured for a 50/50 split but the data shows 53/47 across two million users. The result is significant and positive. What do you do?

Treat it as a broken experiment, not a rounding issue. At two million users a 53/47 split is astronomically unlikely by chance, so something removed users non-randomly - and that something almost certainly correlated with the outcome. The result cannot be trusted in either direction, so find the mechanism, fix it and rerun rather than adjusting the numbers.

5 minmid, senior, staff
All 4 in Statistics & Experimentation