System Design
81 bites tagged System Design — interview questions with model answers, and 60-second explainers.
Why is FastAPI BackgroundTasks poor for multi-minute PDF generation?
Tests whether you know BackgroundTasks is same-process and for seconds, not minutes. Answer: propose a task queue with broker, workers, and result backend; return HTTP 202 with a job ID. Red flag: suggesting FastAPI workers instead of persistence and retries.
Architect a 14-day Pro trial with abuse prevention
Tests stateful billing lifecycle and anti-abuse tradeoffs. Strong answers cover: idempotent trial state machine with scheduled expiry; retention on downgrade; progressive friction via device intel and rate limits; and behavioral monitoring.
How would you design architecture to sidestep a competitor's proprietary dataset?
Tests architecture without data moats. Strong answers pick asymmetric plays like real-time loops, federated learning, or synthetic pipelines and link them to defensible design. Red flag: buying or copying the dataset.
Design a centralized model registry for a large enterprise
Tests ML artifact governance at scale. Strong answers cover immutable versioned artifacts with dependency manifests, a framework-agnostic API, and pluggable deployment targets. Red flag: treating models as opaque files without environment reproducibility.
Describe a Model Registry and how it differs from versioned storage
It tests governance and lifecycle metadata beyond file storage. A strong answer covers lineage, stage transitions, approval gates, and artifact metadata, contrasting with buckets that only store file versions.
Expose a trained model as a simple web service
Practical MLOps knowledge from model serialization to serving. Package the model into a standard format, containerize it, expose a REST endpoint behind a load balancer, and add monitoring. A bare Flask server without containers or health checks is a red flag.
Design a near real-time cost visibility system for ML teams
Tests cost attribution across shared ML infrastructure and streaming pipeline design. Strong answers combine billing exports with resource labels, sub-hour aggregation, and anomaly detection for training spikes.
How do you monitor thousands of per-customer models as a fleet?
Tests fleet-level statistical aggregation versus per-instance alerting. Strong answers propose tiered telemetry, cohort baselining for drift, and hierarchical alerting to prevent fatigue.
Design an automated system to diagnose model performance drop root causes
Tests causal attribution between pipeline bugs and drift. Strong answers sequence schema/null audits, feature drift via PSI/KS, then concept drift via holdout decay. Red flag: skipping pipeline checks to retrain immediately.
Design a system to monitor a real-time prediction service for feature drift
Async feature logging, distribution comparison via PSI/KS against training baseline, and threshold-based anomaly alerts. production ML observability beyond accuracy checks.
Where to place feature transformations: client, serving API, or upstream service?
Tests separation of concerns in ML systems. Client causes duplication and skew; serving API couples compute to requests; dedicated service adds a network hop but centralizes logic. Red flag: ignoring training-serving skew.
Design training job submission to a shared Kubernetes cluster
Gateway with artifact caching; namespace quotas; GPU schedulers like Volcano; Prometheus metrics and cost attribution. Multi-tenant ML infrastructure with usability, fairness, observability.
Design on-demand containerized dev environments for data scientists
Tests multi-tenant notebook infrastructure design. Cover a Notebook Controller, curated Jupyter and VS Code images, namespace isolation with RBAC, resource quotas, and persistent storage. Red flag: a single shared VM without tenancy or idle shutdown.
How would you design a system to detect training-serving skew using model registry metadata?
This tests statistical monitoring between production data and registry training baselines. Strong answers: schema-bound metadata, incremental stats, drift metrics PSI, tiered alerting. Red flag: schema validation mistaken for drift or manual checks only.
Argue for declarative or imperative feature platforms with trade-offs
This tests whether you weigh control flow against data flow. A strong answer argues from org maturity: declarative systems abstract DAG topology, while imperative ones offer Spark control at the cost of manual idempotency. Red flag: ignoring org culture.
Design a system to detect training-serving skew for a numerical feature
Tests ML monitoring design via statistical distribution comparison between training and live data. Strong answers cover PSI/KS tests, windowed thresholding, and tiered alerting. Red flag: comparing raw values instead of distributions or ignoring alert fatigue.
Online vs offline feature store architecture and use cases
This tests latency trade-offs between real-time and batch infrastructure. Contrast fast online lookups against batch offline stores; fraud detection maps to online and model training to offline. Red flag: treating them as interchangeable and ignoring latency.
Design a sub-50ms real-time bidding feature pipeline
Tests merging batch historical and streaming data under sub-50ms latency. Strong answers use dual paths: batch backfills a KV store, streaming writes to an in-memory cache, serving merges both at request time. Red flag: one database without hot-cold split.
How do you guarantee identical feature engineering for training and real-time inference?
Tests unifying feature engineering across batch and online paths to eliminate skew. Answer: shared transformation libraries, versioned feature stores, and logged feature validation. Red flag: separate training and serving code without a single source of truth.
Design an MLOps platform for a mid-sized company: components and build-vs-buy trade-offs
Tests pragmatic scoping and build-vs-buy reasoning. Strong answers rank data estate, feature store, registry, CI/CD/CT, and monitoring above exotic serving, buying commodity and building differentiators. Red flag: custom orchestrators or missing governance.
How would you architect a multi-turn conversational RAG system?
This tests memory and query reformulation design beyond single-turn RAG. A strong answer covers 5-10 turn windows, LLM-based rewriting with coreference resolution, hybrid fallbacks, and summarized memory.
Identify RAG latency bottlenecks and propose optimizations
This tests systems thinking across the RAG pipeline. A strong answer names four bottlenecks—embedding, search, chunking, and generation—and pairs each with caching, index tuning, and distillation. Red flag: GPU scaling without indexing fixes.
Describe a basic RAG architecture and its two main components
This tests retrieval-generation separation. Good answers name the retriever, which fetches relevant documents, and the generator, which synthesizes an answer using those documents plus the query.
Design a pre-aggregation architecture for low-latency experiment results
Tests OLAP-at-scale trade-offs. Strong answers design streaming rollups into a real-time OLAP store, use partial cubes for high-cardinality dimensions, and retain raw events.
Get System Design bites daily.
Five a day, five minutes, offline. With quizzes so it sticks.
Open testing — you’ll join as an early tester.