Delivery Prioritization: Scope, Speed, Quality, and Cost Questions
Deciding what to deliver first when everything competes in a project or program: prioritization under competing demands, time management, and reasoning through trade-offs between scope, speed, quality, and cost. Covers frameworks for ranking work and justifying trade-off decisions under pressure.
Design a multi-tenant inference service to serve personalized models for millions of users under strict memory and p99 latency constraints of 200 ms, with limited GPU budget. Discuss model caching, on-the-fly personalization versus tiny per-user adapters, batching strategies, model sharding, fallback behavior when a personalized model is unavailable, and cost-performance trade-offs.
Sample Answer
Requirements & constraints:
- Functional: serve personalized inference for millions of users with p99 ≤ 200 ms.
- Non‑functional: strict GPU memory (few GPUs), limited cost, high throughput, multi‑tenant isolation.
High-level architecture:
- Frontend router → Request classifier (model ID, user ID, personalization version) → Model cache manager (GPU & RAM) → Inference workers (GPU/CPU pools) → Response aggregator & fallback logic → Telemetry/monitoring.
Key components & strategies
- Model caching (hot models on GPU, warm in RAM, cold on disk):
- LRU + frequency-aware (TinyLFU) eviction weighted by recent traffic and SLA tier.
- Cache entries: base model + optional per-user adapter (small parameter delta).
- Store adapters separately so many adapters can be composited into a base at request time.
- Tiny per-user adapters vs on-the-fly personalization:
- Tiny adapters (e.g., LoRA / adapter modules, 1KB–1MB) are preferred: cheap to store, fast to apply (merge or runtime fusion), low memory, deterministic latency.
- On-the-fly personalization (fine-tune per request) is too slow and non-deterministic for 200 ms p99; use only in offline workflows or async personalization jobs that produce adapters.
- Batching strategies:
- Dynamic micro-batching with latency budget: assemble small batches (size tuned per model) using async coalescing up to N ms (e.g., 5–20 ms) but always respect remaining latency headroom.
- Group by (model ID, precision, adapter presence) to avoid extra recompute/merge.
- Kernel fusion & mixed precision to maximize throughput on limited GPUs.
- Model sharding & placement:
- Shard large base models across GPUs via tensor/model parallelism for huge models; for smaller base models, replicate hot models across GPUs to reduce routing latency.
- Affinity-based routing: route user to GPU that already holds their base model + many of their adapters to maximize cache hits.
- Fallback behavior:
- If user adapter unavailable or adapter load would violate latency, fallback sequence:
- Serve base generic model (with user context).
- Serve cached last-known adapter version if available.
- Queue personalization update asynchronously and return base; notify telemetry for SLA breach.
- Provide probabilistic sampling for A/B: occasionally serve base vs personalized to detect degradation.
- Observability & autoscaling:
- Track cache hit rate, per-model p99 latency, adapter load time, GPU utilization. Autoscale inference CPU workers and GPU pool (or use spot GPUs with graceful preemption fallback).
Cost-performance trade-offs:
- Storing many adapters favors higher storage cost but saves expensive fine-tuning and reduces latency.
- Replicating base models improves latency at cost of GPU memory — mitigate via mixed precision and offloading infrequently used layers to CPU/RAM.
- Larger micro-batches improve throughput (lower $/req) but increase latency tail; tune batch windows and prioritized queuing for latency‑sensitive requests.
- Using smaller distilled base models reduces memory/latency at quality cost; can tier users (premium get full model, others get distilled).
Example numbers (illustrative):
- Adapter size: 0.5–2 MB → store millions on cheap blob storage; cache hot ~100k adapters in RAM, 10k on GPUs.
- Micro-batch window: 10 ms, batch size 8–32 depending on model.
- Target cache hit p99 > 90% for premium users; fallback rate ≤ 1% for premium SLAs.
Final notes:
- Emphasize predictable, small per-user adapters + intelligent caching and affinity routing. Avoid on-the-fly tuning in the hot path. Balance replication vs sharding based on model size and query distribution; instrument heavily and iterate policies to meet p99 under cost constraints.
When multiple customer support tickets arrive at the same time affecting different ML models, outline the triage and escalation steps you would take as an AI Engineer. Include what you log, how you determine severity, who you involve (data, infra, product), and how you prioritize fixes to minimize customer impact under a service-level focus.
Sample Answer
Situation: Multiple support tickets arrive simultaneously, each reporting anomalies in different ML models (e.g., prediction drift, latency spikes, incorrect outputs).
Triage & escalation steps I take:
- Rapid intake (0–15 min)
- Consolidate tickets into a single incident record (ID, time, reporter, affected models/services).
- Log: timestamps, error messages, sample inputs/outputs, customer impact, request IDs, model versions, deployment IDs, recent deploys/config changes.
- Determine scope: number of customers affected, geography, % requests failing, SLA impact.
- Severity determination (within 15–30 min)
- Use SLA matrix: Severity 1 = system down / >X% customers failing or data breach; Severity 2 = major degradation for subset; Severity 3 = minor / single-customer or cosmetic.
- Quantify impact: error rate, latency percentiles, rollback window risk, revenue/SLI impact.
- Assemble responders
- If infra (latency, infra errors): page SRE/infra.
- If data drift or training-serving mismatch: involve Data Scientist / ML Engineer.
- If model logic/feature issues or product expectation mismatch: involve Product Manager and Domain SME.
- Assign incident owner (AI Engineer) and communications lead.
- Immediate mitigations (first hour)
- If clear, deploy rollback or route traffic to safe model version.
- Apply throttling, circuit breaker, or feature-flag disable.
- Create dashboard/alerts for live monitoring.
- Root cause & fix prioritization
- Prioritize fixes that minimize customer impact and meet SLA: hotfix/rollback > retrain > code refactor.
- Use risk/effort matrix: high-impact low-effort first.
- Track tasks in incident board with owners and ETA.
- Communication & post-incident
- Send regular status updates to stakeholders and affected customers.
- After resolution, run blameless postmortem: timeline, RCA, monitoring gaps, follow-up actions (retraining schedules, improved canary testing, stricter CI for model/schema changes).
- Log final metrics, lessons, and close incident.
This process keeps decisions data-driven, minimizes customer impact, and ensures clear accountability and follow-through.
You discover several experiments use sensitive PII in training data in ways that may violate company policy or regulation and would slow public release. As AI lead, decide whether to pause experiments or continue with stricter controls. Describe your decision process, stakeholders you involve, immediate operational steps to remediate, and how you would minimize impact on timelines and team morale.
Sample Answer
Situation: During a model audit I found multiple experiments had training slices containing sensitive PII (names tied to identifiers, contact info) that likely violate company policy and could trigger regulatory issues before public release.
Decision process:
- Risk-first triage: classify datasets by sensitivity (high/medium/low), exposure (internal only vs. public release), and legal/regulatory severity (GDPR/CCPA risk, contractual obligations).
- If any dataset is high sensitivity AND destined for public release or model capabilities could memorize/expose PII, I lean to an immediate pause for that experiment. For lower-risk internal-only experiments I prefer continuation under strict controls while remediating.
- Balance: safety and compliance are non-negotiable; where risk is manageable with technical and process controls, continue limited work to avoid full stop.
Stakeholders to involve:
- Legal & Compliance (policy interpretation, regulator impact)
- Privacy Officer / Data Protection Officer
- Security (access controls, audit logging)
- Product Manager / Program Manager (timelines)
- Engineering leads and experiment owners
- QA and MLOps (deployment controls)
Immediate operational remediation steps:
- Quarantine: snapshot and isolate affected datasets and checkpoints; revoke broad access; switch experiments to gated environment.
- Short-term halt on any model artifacts destined for release that used high-sensitivity data.
- Rapid assessment: run targeted privacy scans (PII detectors, named-entity checks) and run membership/influence tests to estimate memorization risk.
- Remediation plan: where feasible apply data minimization — remove/replace PII, pseudonymize or synthetic replace using proven methods; retrain/fine-tune from scrubbed data or apply differential privacy/noise during fine-tuning.
- Logging & documentation: record decisions, timelines, and remediation steps for audits.
- Legal sign-off: get Compliance sign-off before any public release.
Minimizing impact on timelines and team morale:
- Parallelize work: while high-risk experiments are paused, allow teams to shift to low-risk tasks (feature engineering, evaluation, infrastructure improvements) and run synthetic-data experiments to preserve model iteration.
- Timeboxed remediation sprints with clear milestones and weekly cross-functional syncs so progress is visible.
- Provide support: allocate an “incident response” squad (privacy + MLOps + senior engineer) to unblock teams quickly.
- Transparent communication: explain why pause is necessary, what’s being done, expected timelines, and celebrate short wins (datasets scrubbed, models revalidated).
- Training and prevention: roll out a checklist, automated PII detectors in data pipelines, and mandatory pre-experiment privacy review to prevent recurrence.
Outcome goal: eliminate regulatory exposure, enable a safe public release with minimal rework, and turn the incident into stronger, faster processes that preserve long-term velocity and trust.
Spotify values speed of iteration: build fast, learn fast. Tell me about a time rapid iteration improved an AI product you worked on and explain how you would apply the same mindset to shipping AI features at Spotify while managing technical debt.
Sample Answer
Situation: At my previous company I owned a generative-AI feature that created short product descriptions for an e-commerce site. Initial quality varied and integration with the CMS was slow, so adoption stalled.
Task: Deliver a reliable MVP quickly, validate value with editors, then iterate to improve quality and throughput while avoiding long-term maintenance pain.
Action:
- I cut scope to a tight MVP: single-category templates + a tuned GPT-based prompt pipeline, deployed behind a feature flag in two weeks.
- Launched A/B tests with 50 editors to collect qualitative feedback and automated metrics (CTR, edit-distance to final copy).
- Ran daily short cycles: gather logs, adjust prompts, fine-tune a small domain model weekly, and deploy improved versions via CI/CD.
- To control technical debt I enforced: modular prompt/transform layers, explicit data contracts, lightweight model-versioning, and automated tests for output format and safety checks. I used feature flags and a migration plan for later model swaps.
Result: Within six weeks editor productivity improved 40% (time to publish), human edits dropped 30%, and the team validated ROI enabling investment in a production-grade pipeline.
How I’d apply this at Spotify:
- Ship a narrow-scope AI feature (e.g., playlist description drafts for one genre) fast to collect real user signals.
- Instrument comprehensive telemetry (engagement, skips, edits) and run short iterative loops (weekly) combining prompt tuning, small fine-tunes, and AB testing.
- Balance speed with debt by designing modular components (inference, prompt manager, post-processing), using clear model/version metadata, CI tests for latency/quality/safety, and gating risky refactors behind feature flags and rollout ramps.
- Prioritize paying down debt that blocks iteration (reproducible training pipelines, deterministic evaluation) and defer deep architectural changes until ROI is proven.
This approach preserves Spotify’s “build fast, learn fast” ethos while keeping long-term maintainability and safety in check.
Design a multi-tenant GPU cluster scheduler that supports priority classes, per-team quotas, fair-share, preemption with checkpoint/restore, job elasticity (scaling 1 to N GPUs), and cost-awareness for cloud bursts. Describe the architecture, queue data model, scheduling algorithms, quota enforcement mechanism, and how you would measure SLO compliance at scale (thousands of jobs/day).
Sample Answer
Requirements & constraints:
- Multi-tenant GPU cluster (on-prem + cloud burst)
- Priority classes, per-team quotas, fair-share, preemption with checkpoint/restore, elastic jobs (1..N GPUs), cost-awareness for cloud bursts
- Scale: thousands of jobs/day, hundreds–thousands of GPUs
High-level architecture:
- API Gateway & Auth → Scheduler Core → Resource Manager → Node Agents (K8s-like with GPU-aware CRI) → Checkpoint Service (object store + metadata) → Cost Controller (cloud APIs, pricing DB) → Monitoring & SLO Engine (Prometheus + TSDB)
- Scheduler Core composed of: Queue Manager, Placement Engine, Preemption Manager, Elasticity Controller, Quota Enforcer.
Queue data model:
- Job: {id, team, priority_class, min_gpus, max_gpus, requested_gpus, elastic_policy, checkpoint_point, cost_limit}
- TeamQuota: {team_id, guaranteed_gpus, burst_limit, fair_share_weight, soft_limit_policy}
- PriorityClass: {name, preemption_level, eviction_policy}
- RuntimeState: {allocated_gpus, node_ids, last_checkpoint, cloud_region, cost_accumulated}
Scheduling algorithms:
- Admission: validate against TeamQuota and cost_limit.
- Allocation: Hybrid multi-resource bin-packing:
- First-fit with topology-awareness for contiguous GPUs.
- Use Dominant Resource Fairness (DRF) variant for multi-tenant fairness weighted by team.fair_share_weight.
- For elastic jobs, allocate starting at min_gpus then opportunistically expand using background resizer.
- Prioritization & preemption:
- Sort by (priority_class, DRF deficit, fair_share_score).
- Preemption Manager selects victims minimizing wasted work: prefer checkpointable, low-priority, small remaining runtime; use cost-aware tie-breaker (evict cloud GPUs before on-prem).
- Preemption & checkpoint/restore:
- Integrate ML frameworks with incremental checkpointing (application-assisted or CRIU where possible).
- Preempt: trigger non-blocking checkpoint to object store, atomically release GPUs; metadata retained to resume.
- Restore: scheduler prefers resuming on the same node for locality, else uses object-store transfer optimization (delta fetch).
- Cost-awareness:
- Cost Controller maintains per-region pricing and spot availability; scheduler tags cloud placements, enforces per-team cost_limit, and prefers on-prem unless SLO/capacity forces burst.
- Spot vs on-demand: schedule speculative low-priority replicas on spot; checkpoint frequently; migrate if spot eviction predicted.
Quota enforcement mechanism:
- Two-layer: hard guaranteed reservation (TeamQuota.guaranteed_gpus) enforced at admission; soft burst with weighted fair-share using periodic allocator.
- Token-bucket per-team for cloud spend and burst_count; admission checks tokens.
- Rebalance loop every T seconds: compute DRF deficits; generate grow/shrink/preempt actions; enforce by issuing CRI commands to Node Agents.
Elasticity:
- Job reports progress/throughput metrics to Elasticity Controller; autoscaler uses policy (throughput-per-GPU diminishing returns) to scale up until marginal gain < cost per GPU.
- Support elastic MPI-like jobs via gRPC lounge for worker join/leave.
SLO measurement at scale:
- SLOs: job-start latency, job-completion percentile per priority, quota compliance, cost-per-job.
- Instrumentation: events + traces ingested to TSDB; compute rolling percentiles (p50/p95/p99) and percent-of-violations per team.
- Alerting: SLA burn-rate and daily SLO dashboards. Use sampling and aggregation; store per-job lifecycle events to compute accurate preemption and resume counts.
- Audit: periodic fairness reports (DRF fairness index), cost reports, per-team utilization.
Scalability & trade-offs:
- Decouple admission (fast path) from packing (batch solver every few seconds) to scale.
- Use hierarchical scheduling: global for quotas & costs, local per-rack for packing.
- Trade-offs: checkpoint frequency vs runtime overhead; spot usage reduces cost but increases restarts; DRF enforces fairness but can reduce throughput for bursty workloads—mitigated by soft burst policies.
Operational notes:
- Encourage apps to support incremental checkpoints and hot-add GPUs.
- Hardening: leader election for Scheduler Core, idempotent actions, consistent state in durable store, simulated chaos tests for preemption/restore.
Unlock Full Question Bank
Get access to all Delivery Prioritization: Scope, Speed, Quality, and Cost interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.