DoorDash Staff Data Scientist Interview Preparation Guide
DoorDash's Staff Data Scientist interview process is comprehensive and multi-stage, designed to assess technical depth, business acumen, and leadership capabilities. The process typically spans 4-6 weeks and includes a recruiter screening, one technical phone screen, and six onsite rounds covering SQL analytics, machine learning, product metrics & A/B testing, data infrastructure & systems design, behavioral & leadership competencies, and a technical take-home project. For Staff level candidates, the emphasis extends beyond technical execution to strategic thinking, mentorship, cross-functional influence, and the ability to drive high-impact initiatives across the organization.
Interview Rounds
Recruiter Screening
What to Expect
Initial screening conversation (15-30 minutes) with a recruiter followed by a deeper technical discussion (20-30 minutes) with a hiring manager or senior data scientist. The recruiter assesses your career trajectory, motivation for the Staff role, and overall alignment with DoorDash's culture and mission. The second discussion with a technical leader explores your background in depth, examining 2-3 key projects where you've demonstrated leadership, mentorship, and cross-functional impact. This round establishes baseline qualifications and cultural fit.
Tips & Advice
Research DoorDash thoroughly: understand their business model, recent product initiatives (e.g., Project Dash, expansion into new markets or services), leadership team, and stated company values. Prepare 2-3 compelling stories using the STAR framework that highlight: (1) a project where data insights directly influenced company strategy or product direction, (2) mentorship of junior data scientists and their career progression, and (3) how you navigated cross-functional complexity or organizational ambiguity to deliver results. Articulate your motivation for Staff level clearly—it should reflect both technical aspiration and readiness for the expanded scope of mentorship and influence. Connect your experience to DoorDash's specific challenges: real-time optimization at scale, marketplace dynamics, logistics efficiency. Ask thoughtful questions about team structure, current initiatives, and how success is measured in the role.
Focus Topics
Cross-Functional Influence & Organizational Navigation
Describe a situation where you influenced product, engineering, or business teams without direct authority. Explain your approach to building consensus, handling disagreements, and driving decisions collaboratively. Show awareness of organizational dynamics and politics.
Practice Interview
Study Questions
Career Progression to Staff Level & Strategic Motivation
Articulate your journey to Staff level with specific inflection points where you took on leadership, expanded scope, and demonstrated impact. Explain what attracts you to DoorDash's data science problems at this stage of your career. Connect your experience to the role's focus areas: marketplace optimization, logistics, customer/merchant retention, dynamic pricing, or growth.
Practice Interview
Study Questions
DoorDash Business Model & Strategic Data Opportunities
Demonstrate deep understanding of DoorDash's three-sided marketplace, key metrics across each stakeholder group (customer acquisition cost, merchant churn, dasher utilization), and data science applications in pricing, logistics, growth, and retention. Show awareness of competitive dynamics and DoorDash's strategic priorities.
Practice Interview
Study Questions
Mentorship & Team Development Track Record
Share concrete examples of junior data scientists you've mentored, how you helped them grow (skill development, project ownership, career advancement), and what approach you take to coaching. Discuss how you balance providing guidance with fostering independence.
Practice Interview
Study Questions
Technical Phone Screen
What to Expect
A 60-minute technical phone screen conducted by a senior data scientist or technical hiring manager using a shared coding environment like CodePair. This round focuses on SQL fluency, analytical reasoning, and real-time problem-solving. You'll solve 1-2 moderately complex SQL problems simulating realistic DoorDash scenarios (e.g., customer cohort analysis, order metrics aggregation, merchant performance evaluation). For Staff level, interviewers evaluate not just correctness but code quality, optimization thinking, and your ability to articulate trade-offs and ask clarifying questions that demonstrate strategic reasoning.
Tips & Advice
Write clean, efficient SQL that prioritizes both readability and performance. Use Common Table Expressions (CTEs) to break complex logic into digestible pieces, employ window functions strategically, and optimize joins carefully. Before coding, ask clarifying questions about data schema, expected volume, and performance requirements—this demonstrates maturity. For Staff level, interviewers will assess your ability to think about scalability and maintainability. Optimize queries with awareness of indexing and execution plans, but don't over-optimize at the expense of clarity. Be prepared to explain trade-offs: when to use a simple loop vs. a complex window function, when denormalization makes sense, how to handle late-arriving or duplicate data. If requirements change mid-problem, adapt gracefully and explain your thought process. Discuss how you'd monitor this query in production and what guardrails you'd implement.
Focus Topics
Query Optimization & Execution Planning
Understand query execution plans, indexing strategies, and how to diagnose performance bottlenecks. Learn to use EXPLAIN/ANALYZE to inspect query performance. Think about join order, filtering early in the pipeline, and when to pre-aggregate data. Discuss trade-offs between normalized and denormalized schemas.
Practice Interview
Study Questions
Problem Decomposition & Strategic Questioning
For ambiguous problems, ask clarifying questions about data structure, expected volume, latency requirements, and business context. Break down complex requirements, propose an approach, and discuss edge cases. Show ability to balance simplicity with accuracy.
Practice Interview
Study Questions
Advanced SQL: Window Functions & Complex Aggregations
Master window functions (ROW_NUMBER, RANK, DENSE_RANK, SUM OVER, LAG, LEAD, etc.) for solving ranking, running total, and sequential analysis problems. Combine with GROUP BY, HAVING, and JOINs to handle multi-level aggregations. Solve realistic scenarios like cohort retention, customer lifetime value within cohorts, and time-series analysis.
Practice Interview
Study Questions
Onsite Round 1: SQL Analytics & Metrics Deep Dive
What to Expect
A 75-90 minute onsite round focused on complex analytical problems using realistic DoorDash data. You'll write SQL to answer nuanced business questions, potentially design metrics dashboards, and communicate findings to stakeholders. The interviewer may present an intentionally vague problem (e.g., 'Analyze why customer engagement declined') requiring you to propose metrics, construct queries, validate results, and derive business recommendations. For Staff level, evaluation extends beyond technical correctness to your strategic thinking, data quality awareness, and ability to translate findings into actionable business insights.
Tips & Advice
Approach each problem with structure: clarify requirements, propose key metrics, design your analytical approach, execute SQL queries, validate results, and summarize findings with business implications. For Staff level, demonstrate strategic thinking by discussing how you'd operationalize the metric (instrument it in production, define SLAs, set up monitoring), handle edge cases (data quality issues, time zone considerations, null handling), and scale the analysis. Be prepared to discuss trade-offs between simplicity and rigor. Consider how your findings would be communicated to different audiences: executives, product managers, engineers. Validate assumptions: check data distribution, look for outliers, confirm numbers make sense. If time permits, propose follow-up analyses that would deepen understanding. Throughout, show that you think about business context—why this metric matters, what decisions it informs, what actions might result.
Focus Topics
Data Quality Validation & Integrity Checks
Identify potential data quality issues: duplicates, null values, late-arriving data, schema mismatches, outliers indicating data problems. Propose validation checks and discuss how to handle edge cases. Communicate caveats and assumptions clearly to stakeholders.
Practice Interview
Study Questions
Time-Series Decomposition & Trend Analysis
Analyze time-series data to identify trends, seasonality, and anomalies. Calculate moving averages, year-over-year comparisons, and day-of-week effects. Discuss how to isolate signal from noise and understand drivers of changes. Use SQL window functions to compute these metrics efficiently.
Practice Interview
Study Questions
DoorDash Key Metrics & KPI Design
Deep mastery of DoorDash's core metrics across customer, merchant, and dasher domains: Customer Acquisition Cost (CAC), Lifetime Value (LTV), churn rate, repeat order frequency, Average Order Value (AOV), Gross Merchandise Value (GMV), merchant retention, dasher acceptance rate, on-time delivery rate, cancellation rate. Understand how each metric relates to business strategy and when to dig deeper with segmentation or cohort analysis.
Practice Interview
Study Questions
Cohort Analysis & Retention Patterns
Master cohort analysis techniques: segment users/merchants by acquisition date or cohort, calculate retention curves over time, identify churn inflection points, and compute cohort-level LTV. Understand how to control for seasonal effects and isolate cohort-specific trends. Use this to identify acquisition quality trends or retention levers.
Practice Interview
Study Questions
Onsite Round 2: Machine Learning & Statistical Modeling
What to Expect
A 60-90 minute round assessing your machine learning design skills and statistical reasoning. You'll be presented with a business problem (e.g., predicting delivery time, customer churn, fraud detection) and expected to propose an end-to-end modeling solution. This includes problem formulation, data strategy, feature engineering, model selection, evaluation strategy, and production considerations. The interviewer will probe your understanding of evaluation metrics, trade-offs, and how models integrate with business decisions. For Staff level, the emphasis is on architectural thinking, mentorship capability, and navigating ambiguity in real-world ML challenges.
Tips & Advice
Structure your response to show end-to-end thinking: (1) Problem formulation—define the prediction task, loss function, and business context; (2) Data strategy—what training data would you use, how would you handle time leakage or distribution shift; (3) Features—propose domain-aware features and discuss engineering at scale; (4) Model selection—justify your choice (linear model for interpretability, tree-based for performance, neural net for complexity) based on constraints; (5) Evaluation—propose metrics that align with business goals, discuss how you'd validate in production; (6) Deployment—discuss latency/throughput trade-offs, monitoring, and how model predictions integrate with business systems. For Staff level, emphasize your ability to think about real-world challenges: class imbalance, model drift, fairness, communication of uncertainty to stakeholders. Be prepared to discuss trade-offs explicitly. Show that you've thought about how to mentor junior team members on these concepts.
Focus Topics
Model Validation, Monitoring & Production Considerations
Discuss rigorous validation strategies: hold-out test sets, cross-validation, and temporal validation for time-series data. Understand how to detect model drift in production and retrain strategies. Discuss latency/throughput constraints in serving models. Address how to communicate model uncertainty and limitations to stakeholders.
Practice Interview
Study Questions
Model Selection & Complexity Trade-offs
Justify model choice based on interpretability, performance, latency, and maintenance requirements. Discuss when a simple linear model suffices vs. when tree-based or neural network approaches are justified. Understand regularization techniques (L1/L2, early stopping, dropout) to prevent overfitting and improve generalization.
Practice Interview
Study Questions
End-to-End ML System Design for DoorDash Use Cases
Design complete ML solutions for business problems: delivery time prediction (enabling customer eta expectations and dasher efficiency), customer churn prediction (identifying at-risk users for retention), demand forecasting (optimizing inventory and supply), fraud detection (protecting marketplace), or dynamic pricing (optimizing revenue). Walk through problem formulation, data collection strategy, feature engineering, model selection, evaluation approach, and production deployment considerations.
Practice Interview
Study Questions
Feature Engineering & Domain Expertise Integration
Engineer features that capture domain knowledge: for delivery time prediction, features like historical dasher performance, traffic patterns, merchant prep time; for churn, user engagement signals, order frequency, price sensitivity. Discuss how to handle feature engineering at scale, manage feature interactions, and maintain reproducibility. Discuss feature selection and avoiding overfitting.
Practice Interview
Study Questions
Evaluation Metrics & Business Trade-offs
Select appropriate evaluation metrics based on business context: precision vs. recall trade-offs for fraud (false positives costly vs. false negatives costly), RMSE/MAE for regression, and business-aligned metrics (e.g., improved dasher utilization). Justify metric choices and discuss threshold selection for classification models. Understand how to communicate model performance to non-technical stakeholders.
Practice Interview
Study Questions
Onsite Round 3: Product Metrics & A/B Testing
What to Expect
A 60-75 minute round focused on experimental design and product analytics thinking. You'll be asked to design an A/B test for a hypothetical DoorDash feature or change. The interviewer will present a vague product scenario (e.g., 'We want to increase customer retention by launching a loyalty program') and expect you to propose a rigorous experimental design, including hypothesis, metrics, randomization strategy, sample size calculation, and interpretation of results. For Staff level, the emphasis is on methodological rigor, ability to handle complex experimental scenarios (network effects, market-level interference), and translating experimental findings into product strategy.
Tips & Advice
Approach experiment design systematically: (1) Hypothesis—clearly state what you're testing and expected direction of effect; (2) Success metrics—define primary metric aligned with business goal and guardrail metrics to catch negative side effects; (3) Unit of randomization—decide whether to randomize at user level, market level, or other (discuss why); (4) Sample size calculation—estimate effect size, power, and minimum sample needed (often 80% power, 95% confidence); (5) Duration & ramp—propose experiment duration and how you'd ramp treatment; (6) Analysis plan—describe statistical tests and how you'd interpret results. For Staff level, go deeper: discuss confounders and how to handle them, address potential network effects (e.g., if some dashers are in same market), discuss how long to run experiment (beware of peeking), and consider heterogeneous treatment effects across segments. Show strategic thinking by connecting experimental findings to product decisions. Be prepared to discuss trade-offs between statistical rigor and speed.
Focus Topics
Complex Experimental Scenarios & Edge Cases
Handle real-world complexity: network effects (one dasher's behavior affects others), marketplace interactions (customer-merchant matches), treatment interference (control and treatment units affecting each other), and time lag for impact realization. Discuss when market-level randomization is needed vs. user-level. Address heterogeneous treatment effects across segments.
Practice Interview
Study Questions
Statistical Significance, Power Analysis & Multiple Testing
Master p-values, confidence intervals, Type I and II errors, and statistical power. Calculate sample sizes for detecting given effect sizes. Understand multiple testing corrections (Bonferroni, FDR) when running many tests. Discuss issues like peeking (early stopping) and how to avoid false conclusions.
Practice Interview
Study Questions
Metric Definition for Product Features & Strategic Alignment
For a proposed feature, define primary metrics (e.g., user engagement, retention, revenue impact), secondary metrics (guardrails), and how to measure them. Align metrics with strategic goals. Consider lag effects (how long until impact is visible) and business trade-offs (short-term revenue vs. long-term engagement).
Practice Interview
Study Questions
A/B Test Design & Hypothesis Formulation
Design rigorous experiments including clear hypothesis, definition of test and control groups, randomization strategy, sample size estimation, and duration. Define primary success metric and guardrail metrics (to catch unintended consequences). Consider minimum detectable effect (MDE) and statistical power (typically 80%). Discuss practical constraints like experiment cost and time-to-decision.
Practice Interview
Study Questions
Onsite Round 4: Data Infrastructure & Systems Thinking
What to Expect
A 60-75 minute round assessing your understanding of data infrastructure, pipelines, and systems design at scale. You'll discuss how to architect data systems that support analytics and ML: data collection and ingestion, transformation and aggregation, storage strategies, real-time vs. batch processing, and data quality assurance. The interviewer may ask you to design a data pipeline for a use case or discuss trade-offs in technology choices. For Staff level, the emphasis is on designing systems that scale, mentoring teams on best practices, and making architectural decisions that balance technical purity with business pragmatism.
Tips & Advice
Prepare by understanding data pipeline architecture patterns, common tools (Apache Airflow for orchestration, Apache Spark for processing, Kafka for streaming, SQL data warehouses like Snowflake or BigQuery), and trade-offs between them. Discuss ETL (Extract-Transform-Load) vs. ELT (Extract-Load-Transform) approaches. Be ready to design a system for a concrete scenario: ingesting order data, customer behavior events, merchant analytics. For Staff level, emphasize your ability to: (1) design systems that scale to high volume and support both batch and real-time use cases, (2) think about data quality, governance, and compliance, (3) mentor teams on architecture trade-offs, (4) balance engineering effort with time-to-value. Discuss challenges like handling late-arriving data, ensuring exactly-once semantics, monitoring data freshness, and schema evolution. Show strategic thinking by discussing when to build custom solutions vs. adopting managed services, and how data infrastructure enables analytics and ML velocity.
Focus Topics
Real-Time Streaming & Event Processing
Understand real-time data systems using tools like Kafka for event streaming and stream processing frameworks. Discuss use cases for real-time analytics (fraud detection, dynamic pricing, real-time dashboards) and challenges (ordering, fault tolerance, exactly-once semantics, state management).
Practice Interview
Study Questions
Scalability, Performance & Cost Optimization
Design systems that handle high data volume, throughput, and low-latency queries. Discuss partitioning strategies, indexing, data compression, and monitoring. Understand trade-offs between latency, throughput, and cost. Optimize for efficient resource utilization and cost-per-query.
Practice Interview
Study Questions
Data Quality, Governance & Compliance
Implement data quality checks: schema validation, completeness checks, uniqueness constraints, and anomaly detection. Establish data governance practices: documentation, ownership, lineage tracking, and access control. Discuss compliance considerations (data privacy, GDPR, PII handling). Design for data reliability and traceability.
Practice Interview
Study Questions
Data Pipeline Architecture & ETL/ELT Patterns
Design end-to-end data pipelines: ingestion from multiple sources (APIs, databases, events), transformation (cleaning, enrichment, aggregation), and consumption (warehousing, dashboards, ML features). Discuss ETL vs. ELT trade-offs, batch vs. real-time processing patterns, and when to use each. Understand orchestration tools like Airflow and how to design for fault tolerance and recovery.
Practice Interview
Study Questions
Onsite Round 5: Behavioral & Leadership
What to Expect
A 60-minute round focused on soft skills, collaboration, leadership, and cultural fit. The interviewer will ask behavioral questions exploring your ability to mentor junior colleagues, influence cross-functional teams, handle conflict, navigate ambiguity, and learn from challenges. Expect questions like 'Tell me about a time you disagreed with a teammate and how you resolved it', 'Describe how you've mentored a junior data scientist', or 'Share an example of a high-impact project where you had to learn a new skill quickly.' For Staff level, the focus is on demonstrated leadership impact, mentorship track record, strategic thinking, and ability to elevate team capability.
Tips & Advice
Prepare 6-8 STAR (Situation, Task, Action, Result) stories that showcase: (1) Driving product decisions through data insights, (2) Mentoring junior data scientists and their career growth, (3) Resolving disagreements or conflicts with teammates, (4) Owning ambiguous problems and bringing structure, (5) Learning a new skill or technology quickly, (6) Navigating organizational constraints to deliver impact, (7) Managing a high-stakes project with tight constraints, (8) Identifying and implementing process improvements. For each story, focus on your agency and impact. Staff-level candidates should emphasize strategic influence, not just individual contributions. Connect stories to DoorDash's values: execution focus, customer obsession, operational excellence, and inclusive culture. Share what you learned from failures and how you adapted. Discuss your leadership philosophy and what you look for in growing talent. Ask thoughtful questions about team dynamics, current challenges, and vision for the data science organization.
Focus Topics
Continuous Learning & Growth Mindset
Discuss how you stay current with data science developments, learn new tools and methodologies, and adapt to changing business needs. Share recent skills you've acquired (new ML frameworks, programming languages, tools). Demonstrate intellectual curiosity and commitment to mastery.
Practice Interview
Study Questions
Ownership & Ambiguity Navigation
Describe an ill-defined problem you tackled, how you brought structure to ambiguity, and how you owned the outcome. Show how you make decisions with incomplete information, validate assumptions, and adapt. Discuss trade-offs you've navigated and why you chose your approach.
Practice Interview
Study Questions
Conflict Resolution & Collaborative Problem-Solving
Describe a time you disagreed with a teammate or stakeholder and how you resolved it. Focus on listening, finding common ground, understanding their perspective, and reaching a resolution that moved the work forward. Avoid defensive language and showcase emotional intelligence and respect.
Practice Interview
Study Questions
Cross-Functional Leadership & Strategic Influence
Demonstrate your ability to lead initiatives across engineering, product, and business teams without direct authority. Share examples of aligning teams on metrics, building consensus on strategy, or influencing prioritization. Discuss your communication style, how you build relationships, and how you handle disagreements. Show strategic thinking in connecting data insights to business decisions.
Practice Interview
Study Questions
Mentorship & Development of Junior Data Scientists
Share specific examples of mentoring junior colleagues: how you helped them develop technical skills, tackle challenging projects, and advance their careers. Discuss your mentorship philosophy, what you look for in mentees, and how you tailor guidance. Show that you've helped others grow into independent, impactful contributors.
Practice Interview
Study Questions
Onsite Round 6: Take-Home Project & Technical Deep Dive
What to Expect
Some DoorDash Staff interviews include a take-home or onsite case study project (1-3 hours) that you'll work on and discuss. You'll be given a realistic data science problem: write SQL queries to answer business questions, conduct exploratory analysis, build a simple model, or investigate a business metric. You'll be expected to deliver clean code, clear reasoning, and actionable insights. This may occur before the onsite as a screening tool or during the onsite day. The follow-up discussion focuses on your approach, problem-solving process, code quality, and ability to articulate findings strategically.
Tips & Advice
Treat the project like real work: clarify requirements, propose an approach, execute with clean code, and communicate findings compellingly. Write well-commented, production-grade SQL and Python/R. For Staff level, go beyond surface-level answers: identify interesting patterns, propose follow-up analyses, and connect findings to business strategy. Consider edge cases and data quality issues. If sharing code, ensure it's clear and maintainable. In the discussion, be prepared to defend your methodology, discuss alternative approaches, and answer follow-up questions. Walk through your analytical process, explaining key decisions. Highlight strategic insights and business implications, not just numbers. Show that you think about how findings would be operationalized or drive decisions.
Focus Topics
Clear Communication & Data Storytelling
Present findings clearly with supporting evidence and visualizations. Articulate the business implication of each insight. Synthesize findings into a compelling narrative. Be prepared to defend your analytical approach and discuss alternatives. Tailor communication to the audience.
Practice Interview
Study Questions
Code Quality & Best Practices
Write SQL and code that is clear, efficient, and maintainable. Use meaningful names, clear structure, helpful comments, and proper formatting. Optimize for performance without sacrificing readability. Demonstrate knowledge of best practices. Code should be something you're proud to show others.
Practice Interview
Study Questions
Strategic Insight Generation & Business Impact Thinking
Move beyond answering the specific question to identifying interesting patterns, proposing follow-up analyses that would deepen understanding, and connecting findings to business strategy. Show curiosity and depth. Discuss how insights would inform decisions or drive action.
Practice Interview
Study Questions
End-to-End Analytical Execution & Problem-Solving
Execute a complete analysis from problem statement to insights: clarify ambiguous requirements, propose analytical approach, write efficient SQL, perform exploratory analysis, identify patterns, validate findings, and present conclusions. Demonstrate logical thinking, attention to detail, and structured problem decomposition. Discuss assumptions and caveats explicitly.
Practice Interview
Study Questions
Frequently Asked Data Scientist Interview Questions
Two stakeholders conflict: Marketing wants a 10% conversions uplift; Legal requires model explainability and bans demographic features. Decompose these into technical and policy requirements, draft negotiation questions to reconcile both, and propose a prioritized implementation plan that satisfies legal constraints while delivering measurable business impact. Discuss trade-offs and timelines.
Sample Answer
Situation: Marketing asks for a 10% conversion uplift from a predictive model; Legal mandates model explainability and forbids using demographic features. My goal: reconcile business impact with compliance and deliver an actionable roadmap.
Decomposition
- Technical requirements
- Target metric: +10% conversion (baseline, measurement window)
- Data: event-level conversion labels, behavioral and product features, A/B test instrumentation
- Models: interpretable baseline models (logistic regression, GAMs), and higher-capacity models (tree ensembles, neural nets) with post-hoc explainability
- Evaluation: holdout/test AUC, calibration, business uplift (incremental conversions), offline causal proxies and online A/B testing
- Instrumentation: logging, feature lineage, model monitoring
- Policy / compliance requirements
- No demographic features in training or inference pipelines
- Explainability standard: feature-level attributions, human-readable rationale, documentation for audits
- Data governance: provenance, retention, access controls, privacy checks
Negotiation questions to stakeholders
- To Marketing: How is the 10% measured (absolute vs relative)? What is baseline and timeline? Are there acceptable interim goals?
- To Legal: Define acceptable explainability standards (local vs global, fidelity thresholds). Are proxy features or derived embeddings acceptable if not correlated with demographics? What audit artifacts satisfy compliance?
- To both: Are controlled experiments (A/B tests) acceptable to validate uplift? What risk tolerance exists for false positives/negatives?
Prioritized implementation plan (phases + timelines)
- Week 0–2: Align & define success
- Confirm baseline conversion, metric, acceptable timelines, and Legal’s explicit explainability requirements.
- Weeks 2–6: Data & guardrails
- Build feature catalog; implement policy checks to block demographic fields and flag correlated proxies. Create logging & lineage.
- Weeks 4–10: Interpretable baseline + monitoring
- Train interpretable models (logistic regression, GAM) with business features; produce feature importance, SHAP-lite explanations; run offline evaluation against uplift proxy.
- Weeks 8–16: High-capacity models with constrained features
- Train XGBoost/NN with explainability pipeline (SHAP, LIME, counterfactuals) and fairness checks. Compare to baseline.
- Weeks 12–20: Experimentation & deployment
- Run A/B tests measuring incremental conversions. Only deploy models meeting Legal explainability criteria and passing fairness checks.
- Ongoing: Monitoring & audits
- Drift, performance, and periodic re-evaluation; maintain audit docs for Legal.
Trade-offs
- Speed vs rigor: Interpretable models give faster compliance but may yield smaller uplift; complex models can boost performance but require stronger explainability and validation.
- Feature utility vs policy: Blocking demographics may reduce predictive power; mitigate via richer behavioral/product features and causal signals.
- Explainability fidelity vs model accuracy: Post-hoc explanations may not perfectly reflect complex models—Legal may prefer inherently interpretable models.
Expected timeline: measurable uplift signal in A/B within 3–5 months; full production with monitoring and audit trail by ~5 months. If Legal requires only interpretable models, expect smaller immediate uplift but faster deployment (6–8 weeks). If complex models are approved with robust explainability, potential to reach 10% within 4–6 months.
I would start by aligning stakeholders on definitions and acceptable trade-offs, deliver an interpretable baseline quickly to build trust, and iterate toward higher-performing models under Legal’s documented explainability guardrails.
Compute the median (50th percentile) of a numeric column using PERCENTILE_CONT, or a manual NTILE/ROW_NUMBER-based workaround in a dialect that lacks it. Then discuss when you'd switch to an approximate method (sketch-based quantile estimation, or an engine's built-in approximate-quantile function) instead of the exact windowed computation, and how you'd communicate that trade-off to a stakeholder who just wants 'the median'. Extend the same exact-versus-approximate framing to a related problem: an exact running-distinct-count of active users by day gets expensive at scale, and HyperLogLog-style sketches are the usual approximate alternative.
Sample Answer
Direct answer: PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY col) is the exact, standard way to compute a median in engines that support ordered-set aggregates (Postgres, Snowflake, BigQuery, DuckDB): it sorts the group and interpolates between the two middle values. Engines without it (MySQL, SQLite, older warehouses) need a manual ROW_NUMBER() workaround that ranks each group and averages the middle row (even count) or takes the single middle row (odd count). Switch to an approximate, sketch-based quantile function once the exact sort-per-group computation becomes the bottleneck at scale, and tell the stakeholder plainly: "this number is very close but not exact, and it will stay fast as the data grows."
Structured elaboration
Approach 1: exact, ordered-set aggregate
PERCENTILE_CONT is an ordered-set aggregate function, not a plain window function. It always needs WITHIN GROUP (ORDER BY ...) and a GROUP BY (or no GROUP BY at all for one global median). PostgreSQL's documentation is explicit that ordered-set aggregates cannot be used as window functions with OVER (...); DuckDB rejects the same syntax outright. On PostgreSQL and DuckDB specifically, if you need a per-partition median attached to every row (window-style), you compute the aggregate in a subquery or CTE (common table expression, a named, reusable subquery introduced with WITH) and join it back, since neither engine lets you bolt OVER (PARTITION BY ...) directly onto PERCENTILE_CONT. That restriction is not universal: Snowflake and Redshift both document PERCENTILE_CONT(...) WITHIN GROUP (ORDER BY ...) OVER (PARTITION BY ...) as valid windowed syntax, so on those two engines the per-partition median can be a single expression with no join-back step.
Approach 2: manual ROW_NUMBER() workaround (portable, works anywhere)
Rank each row within its group by the target column, count the group size, and average the row(s) sitting at the middle rank(s):
WITH numbered AS (
SELECT
category_id,
amount,
ROW_NUMBER() OVER (PARTITION BY category_id ORDER BY amount) AS rn,
COUNT(amount) OVER (PARTITION BY category_id) AS cnt
FROM transactions
WHERE amount IS NOT NULL
)
SELECT category_id, AVG(amount) AS median_amount
FROM numbered
WHERE rn IN (FLOOR((cnt + 1) / 2.0), CEILING((cnt + 1) / 2.0))
GROUP BY category_id;
For an odd group size the two FLOOR/CEILING picks land on the same rank, so AVG of one value is just that value; for an even group size they land on the two middle ranks and AVG interpolates the way PERCENTILE_CONT does. NTILE(2) is sometimes mentioned in the same breath as this workaround, but it is a coarser tool: it splits a group into equal-sized buckets and tells you which bucket a row falls in, it does not interpolate a boundary value, so it is the right primitive for quartile/decile bucketing, not a precise substitute for a point-estimate median.
Approach 3: approximate, sketch-based quantile estimation
Once a partition is large enough that sorting it (the O(n log n) step both approaches above rely on) means spilling to disk or holding the whole group in memory, switch to a probabilistic sketch such as t-digest, a compact, mergeable summary structure that approximates quantiles instead of computing them exactly. These structures process the data in one streaming pass, keep a small, bounded amount of state regardless of how many rows feed into it, and answer a quantile query with a small, known error bound instead of an exact sort. Every major analytical warehouse ships a built-in function for this: DuckDB's APPROX_QUANTILE, Snowflake's APPROX_PERCENTILE (built on a t-digest variant), BigQuery's APPROX_QUANTILES (returns an array of boundary values), and Redshift's APPROXIMATE PERCENTILE_DISC.
When to switch, and how to say it to a stakeholder
Switch when the exact computation is measurably the bottleneck: a group so large that the sort spills to disk, a high-cardinality GROUP BY key producing thousands of small sorts, or a dashboard that needs to stay responsive as the underlying table grows unbounded. Do not switch pre-emptively on a small or medium table just because "approximate" sounds more scalable; exactness is free until it isn't. When a stakeholder asks for "the median" and you plan to serve an approximate one, say what changes in plain terms: the number will be extremely close to the true median (typically within a fraction of a percent for standard sketch sizes) and it will stay fast no matter how much data accumulates, versus an exact number that is guaranteed correct but gets slower, and eventually a background batch job, as volume grows. If the number feeds a regulated or audited report, keep it exact; if it feeds a live operational dashboard, approximate is almost always the right trade.
Extension: exact-vs-approximate distinct counts
The same tension shows up one level over, on COUNT(DISTINCT user_id) for a daily active-users metric. An exact distinct count forces the engine to track every value it has already seen (a hash set or a sort-and-dedupe pass), so memory and compute scale with the number of distinct values, not just the row count, and a single query with several COUNT(DISTINCT ...) metrics can be especially expensive because each one needs its own tracking structure. HyperLogLog-style sketches solve it the same way t-digest solves quantiles: hash each value, keep a small fixed-size register array (kilobytes, not megabytes, regardless of whether the true distinct count is a thousand or a billion), and estimate the cardinality from the distribution of leading zero-bits observed. The error shrinks as the sketch's register count grows, and standard sizes comfortably keep the relative error to a low single-digit percentage, which is normally far tighter than a stakeholder needs for a trend line. DuckDB exposes this as APPROX_COUNT_DISTINCT; BigQuery, Snowflake, and Redshift ship equivalents (BigQuery additionally exposes the raw HLL_COUNT.* sketch functions so you can store and merge partial sketches across days instead of recomputing from scratch).
Worked example
Ran against a real transactions(category_id, amount) table in DuckDB, category_id = '1' has an odd count of five rows (10, 20, 30, 40, 100), category_id = '2' has an even count of four rows (5, 15, 25, 35):
-- Approach 1: exact, ordered-set aggregate
SELECT category_id, PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY amount) AS median_amount
FROM transactions GROUP BY category_id;
| category_id | median_amount |
|---|---|
| 1 | 30 |
| 2 | 20 |
Category 1's median is the literal middle value (30). Category 2 has no single middle value, so PERCENTILE_CONT interpolates between the two middle values 15 and 25, giving (15+25)/2 = 20. The manual ROW_NUMBER() query from Approach 2, run against the same table, returned identical results (30 and 20), confirming the two exact methods agree. APPROX_QUANTILE(amount, 0.5) also returned 30 and 20 on this table, because the demo dataset is far too small for a sketch's approximation error to show up. The whole point of switching to a sketch only pays off at the row counts where an exact sort would actually hurt, which a nine-row demo table cannot honestly simulate; the sketch's real behavior is a bounded-error, bounded-memory summary, not a different answer on small data.
For the distinct-count extension, an active_users(event_date, user_id) table with 3 distinct users on day one and 4 distinct users on day two returned identical results from COUNT(DISTINCT user_id) and APPROX_COUNT_DISTINCT(user_id) for the same reason: at single-digit cardinality there is nothing for a sketch to approximate away.
Key points
PERCENTILE_CONTis an ordered-set aggregate: exact, needsWITHIN GROUPandGROUP BY, and (verified against PostgreSQL's own documentation and by direct execution) cannot take anOVER (PARTITION BY ...)clause the way a true window function can.PERCENTILE_CONTsilently dropsNULLvalues from the ordering before computing the median (verified: a group of 10, 20, NULL, 30 returned a median of 20, the same as if theNULLwere never there).NTILEbuckets rows into N groups; it is a bucketing tool, not an interpolating median calculator.
Complexity
Both exact approaches require a full sort of each group: O(n log n) per group, and the whole group must be materialized before the middle value(s) can be identified, so memory scales with the largest group's size. Sketch-based approximate methods process each row once, O(n) total, using a fixed, small amount of memory per sketch regardless of group size, which is exactly what makes them viable when the exact sort would spill to disk.
Edge cases
- Empty group: both
PERCENTILE_CONTand theROW_NUMBER()approach returnNULL(no rows to rank). NULLvalues in the target column: excluded from the ordering before the median is computed; make surecntin the manual approach is aNULL-excluding count (COUNT(amount), notCOUNT(*)) or the rank-matching math drifts.- Ties at the middle rank(s) are handled correctly by both exact approaches since they operate on sorted position, not on distinct values.
Trade-offs & pitfalls
The trap most candidates miss is reaching for NTILE as if it were a median shortcut; it answers a different question (which bucket) and does not interpolate. The trap on the approximate side is presenting a sketch-based number as if it were exact without saying so: a dashboard KPI silently switching from exact to approximate after a "performance fix" is the kind of change that erodes stakeholder trust in the numbers, even when the approximation itself is well within an acceptable error band. State the switch and its error characteristics explicitly rather than letting it hide inside a query rewrite.
You're building a data-driven pitch for a heavily regulated industry (for example finance or healthcare). Explain how you would adapt your storytelling and delivery: which regulatory constraints affect what you can show, what anonymization or de-identification you would apply, what documentation a regulator or auditor would expect to see, and how you would present the trade-off between compliance and business insight to an executive who wants the fuller picture.
Sample Answer
Direct answer
In a regulated industry the story changes in three ways before you ever open a slide deck: what you're allowed to show gets filtered by regulation first, every number needs a documented trail back to its source, and the audience usually includes someone whose job is to say no. The craft is presenting a defensible, compliant insight that is still genuinely persuasive, not a watered-down one.
Structured elaboration
1. Filter the insight through the regulatory constraint before you design the story.
Start by asking what you are legally or contractually allowed to surface, not what would make the best slide. In healthcare this typically means de-identification requirements in the style of HIPAA (the Health Insurance Portability and Accountability Act, the US healthcare privacy law) (removing or generalizing direct identifiers, applying k-anonymity style aggregation so no small cell size can be re-identified); in finance it often means restrictions on disclosing individual customer positions, fair-lending constraints on which variables can drive a decision, and model-risk-management documentation requirements. The constraint is not a formatting afterthought, it determines which findings you can even lead with. A finding that is only compelling at the individual-customer level may need to be re-cut at a cohort or segment level to be shshowable at all.
2. Choose an anonymization or aggregation method proportionate to the risk, and say so explicitly.
Common options, roughly in order of how much detail they preserve: generalization/binning (age becomes a 10-year band), suppression of small cells (any group below a stated threshold, for example n<10, is not reported individually), k-anonymity (restructuring the data so every individual is indistinguishable from at least k-1 others) or differential privacy (adding carefully calibrated statistical noise so no single record can be reverse-engineered from the released numbers) for released datasets, and full aggregation to segment or cohort level for anything leaving the compliance boundary. State which one you used and why in the deck itself, not just in a footnote; a compliance-literate audience will ask, and pre-empting the question builds trust.
3. Build the documentation trail the regulator or auditor would expect.
At minimum: a data lineage note (where the data came from, what was excluded and why), the exact aggregation/anonymization method applied, the population definition, and any known limitations or exclusions. In a bank this is close to what model-risk-management documentation already requires; in healthcare it is close to what a compliance or privacy officer would ask for before approving external use of a dataset. Producing this alongside the insight, not after someone asks for it, is what separates a defensible story from an accidental disclosure.
4. Present the compliance-versus-insight trade-off to the executive directly, instead of hiding it.
An executive who wants the fuller, more granular picture needs to understand that the constraint is not analyst caution, it is a hard requirement with real penalties for the organization. Frame it as: here is the insight we can show at the compliant aggregation level, here is what more granular view would add, and here is why we cannot show that view without additional legal/privacy sign-off (and what that sign-off would require, e.g., a data use agreement, approval from an institutional review board (the ethics body that approves research involving people's data), legal review). This turns a limitation into a scoped, honest recommendation rather than a vague 'we can't share that.'
Worked example
A healthcare analytics team wants to show a hospital system that a proposed care-pathway change reduces 30-day readmissions. The raw finding is a 2.1 percentage point reduction (from a baseline of 15.0% to 12.9%) in a cohort of 640 patients. Because the cohort includes some very small subgroups (for example, a specific rare-diagnosis subgroup of 6 patients), the team cannot report readmission rates by that subgroup without violating a small-cell suppression rule (commonly a minimum reportable cell size, e.g. n>=11, used across many healthcare reporting standards). The story that ships: the top-line reduction at the full-cohort level (which is well above the suppression threshold and safe to report), a note that subgroup-level results are directionally consistent but suppressed below n=11 per data governance policy, and an explicit statement that a follow-up analysis with a larger sample is planned before subgroup-level claims can be made. The executive sees the real result, understands exactly why the subgroup cut is withheld, and knows what it would take to get it.
Trade-offs and pitfalls
- The biggest pitfall is aggregating so heavily to stay 'safe' that the insight becomes too vague to act on; the discipline is finding the least aggregated view that is still compliant, not the most conservative one available.
- A second common mistake is treating the regulatory constraint as something to mention once in an appendix; a compliance-savvy stakeholder will judge you on whether the constraint shaped the analysis from the start, not whether you disclosed it at the end.
- Do not let 'the regulation requires it' become an excuse for skipping normal storytelling discipline (headline, evidence, recommendation); the compliant version of the insight still needs to lead with the so-what, it just has a narrower evidentiary base.
- When in doubt about whether a cut of the data is disclosable, the right escalation path is your privacy/compliance/legal function, not an individual judgment call, and that escalation itself is worth naming as part of your process when a stakeholder pushes for more granularity.
Explain a coaching framework you use, like the GROW model or Socratic questioning, and walk through how you'd apply it in a real one-on-one with someone who wants to grow a specific skill.
Sample Answer
Direct answer
GROW is a four-stage, question-led coaching structure: Goal (what success looks like), Reality (the current state), Options (possible paths forward), and Way forward (specific commitments). Applied to a 1:1 with someone who wants to grow a specific skill, it turns a vague aspiration into a concrete next step, and the same question-led habit also works inside a work review, not only a scheduled conversation.
Walking through the four stages
- Goal. Get specific: "What would 'better at this' actually look like, concretely, and how would you know it happened?"
- Reality. Surface the current state without judgment: "Tell me about a recent situation where this was hard, what made it hard?"
- Options. Generate paths rather than prescribing one: "What could you try next, and who or what could help?"
- Way forward. Get a specific, small commitment: "Which one thing will you actually do before we talk again, and what support do you need from me?"
Socratic questioning is the companion technique that runs through all four stages: instead of stating the answer, ask a question that leads the person to notice the gap themselves ("what did you expect to happen there, versus what actually happened?"). It works well when there's time to let someone arrive at the insight; it works poorly when someone is genuinely blocked and just needs the direct answer.
Extending this into reviewing someone's work
The same question-led approach makes a review of someone's work (code, a document, a design, an analysis) constructive rather than purely corrective. Concrete techniques: a review template that separates "must fix" from "worth considering" from "just for your awareness," so feedback doesn't read as one undifferentiated pile of criticism; annotated examples that show a better version alongside the original with a short reason, not just a comment naming the problem; and a Socratic question left in the review itself ("what happens here if this is empty?") instead of stating the bug outright, when the goal is teaching and there's no urgency forcing a direct fix.
Worked example
In a 1:1, a mentee said they wanted to get better at making structural decisions independently instead of always checking first. Goal: they described what "independent" would look like in practice (making a defined class of calls without asking). Reality: walking through a recent case, they could explain their reasoning but hadn't trusted it enough to act without confirmation. Options: they proposed trying it on a low-stakes decision first and reviewing the reasoning after the fact rather than before. Way forward: they committed to making the next reversible decision on their own and bringing the reasoning to the following session, with an explicit offer of support if it went wrong.
Trade-offs and pitfalls
A common mistake is treating GROW as a rigid script and marching through all four stages regardless of what the person actually needs that day. A stronger approach holds the structure loosely: skip Reality if it's already obvious, compress stages under time pressure, and know when the moment calls for direct answers instead of more questions, especially if something is safety-critical or urgent. Inside reviews specifically, overusing Socratic questions when someone is genuinely stuck can read as withholding rather than teaching, so it's worth pairing questions with a clear direct answer once the teaching moment has been made.
What's the difference between batch, stochastic, and mini-batch gradient descent? Walk through the update rule, how batch size affects convergence and gradient noise, and why feature scaling matters for all of them.
Sample Answer
Direct answer
Batch, stochastic, and mini-batch gradient descent all use the same update rule, they only differ in how many examples' gradients get averaged before each step. Batch GD averages over the entire dataset (low noise, expensive per step), stochastic GD uses one example at a time (high noise, cheap per step), and mini-batch splits the difference. Feature scaling matters for all three because an unscaled feature distorts the shape of the loss surface itself, which no choice of batch size fixes.
Structured elaboration
w←w−η∇wL(w)
is the shared update rule; what changes between the three variants is what ∇wL(w) is computed from:
| Variant | Gradient computed from | Update variance | Cost per update | Typical fit |
|---|---|---|---|---|
| Batch GD | Entire dataset | Lowest (deterministic direction) | Highest, one full pass per step | Small datasets, convex problems where exact gradients matter |
| Stochastic GD (SGD) | One random example | Highest | Lowest | Streaming/online learning, very large datasets |
| Mini-batch GD | A small random subset | Moderate, decreases as batch size grows | Moderate, tunable to hardware | The default in practice, especially on GPUs |
Why feature scaling matters for all three: the gradient of a linear model's loss with respect to a weight is proportional to that feature's magnitude, so a feature with a much larger numeric range dominates the gradient direction, making the loss surface elongated and ill-conditioned. This slows convergence (forcing a smaller learning rate) regardless of whether you're averaging over the full dataset, one example, or a mini-batch, the batch size changes the noise in the gradient estimate, not the shape of the underlying loss surface.
Worked example
Simple linear model y^=wx with per-example squared loss, gradient ∇wLi(w)=2xi(wxi−yi). Four training points: (1,3),(2,5),(3,7),(4,9), and current weight w=1.
| xi | yi | wxi−yi | ∇wLi=2xi(wxi−yi) |
|---|---|---|---|
| 1 | 3 | -2 | -4 |
| 2 | 5 | -3 | -12 |
| 3 | 7 | -4 | -24 |
| 4 | 9 | -5 | -40 |
Batch gradient (average of all four): (−4−12−24−40)/4=−20
Single-example (SGD) gradients range from -4 (point 1) to -40 (point 4), a 10x spread depending purely on which point got sampled.
Mini-batch of size 2: points {1,2} average to (−4−12)/2=−8; points {3,4} average to (−24−40)/2=−32, a 4x spread, narrower than single-example SGD but still noisier than the fixed batch value of -20.
With learning rate η=0.01, the batch update moves w from 1 to 1−0.01×(−20)=1.2, a single-example update using only point 1 would instead move it to 1−0.01×(−4)=1.04, a visibly smaller and less representative step, which is exactly the variance/noise trade-off in numbers.
Trade-offs & pitfalls
- SGD's noise is a feature, not just a bug: it can help escape shallow local minima or saddle regions, but it requires a decaying learning rate or momentum/Adam to actually settle near a minimum rather than bouncing around it indefinitely.
- Mini-batch size interacts with hardware, not just statistics: very small batches underutilize GPU parallelism, very large batches need learning-rate scaling and warmup to avoid degraded generalization.
- Feature scaling is not optional for any of the three variants, without it, you're forced into a smaller learning rate than the well-scaled problem would need, which slows every variant proportionally.
- Pitfall: tuning batch size as if it were purely a speed knob. It also changes the effective noise in the optimization, which affects both convergence speed and, for non-convex problems, the character of the minimum you land in.
A user requests deletion of their data. Design the end-to-end technical process to make that real: identifying every place their data lives (data lake, warehouse, backups, streaming topics, and derived, aggregated, or denormalized tables and ML training sets built from it), propagating the deletion or an irreversible pseudonymization, and producing verifiable proof for an auditor that it actually happened. What schema pattern, such as isolating PII in a separate table keyed by a pseudonymized ID, would make this tractable as routine operations instead of an emergency scramble each time?
Sample Answer
Direct answer. Make deletion tractable by isolating personal identifiers into a single dedicated table keyed by a pseudonymized ID from the start, so every other system, including the data lake, the warehouse, streaming topics, derived and denormalized tables, and ML (machine learning) training sets, references the pseudonym instead of storing the real identifier. A deletion request then becomes deleting or crypto-shredding one row plus fanning out a tombstone event, instead of hunting through every table in the company. For systems that can't practically delete in place, such as backups and some ML training artifacts, apply irreversible pseudonymization or crypto-shredding, and produce an auditable receipt for every system confirming completion, not just a log line saying the job ran.
Schema pattern that makes this tractable. Assign every subject a stable pseudonymized ID, a random or hashed identifier with no reversible mapping exposed outside the identity system, at first contact. Store the mapping between the pseudonym and any real identifying attributes (name, email, phone, address) in exactly one isolated table, access-controlled separately from everything else. Every other table, topic, and derived dataset references the pseudonym, never the real identifier directly; if a downstream system needs to display a real name, it looks it up from the isolated table at render time rather than copying the name into its own storage. Deletion then reduces to deleting or crypto-shredding (discarding the encryption key so the ciphertext becomes permanently unreadable) the one row in the isolated table, after which the pseudonym everywhere else becomes an opaque, non-personal identifier.
Identifying every place the data lives, and how each is handled
- Data lake, raw and curated zones: tag every dataset containing the isolated PII (personally identifiable information) table or a denormalized copy of it at ingestion; a deletion event triggers a rewrite of affected partitions, not a soft flag.
- Warehouse: derived tables should already reference the pseudonym only, so the mapping table gets the delete; any warehouse table that denormalized real attributes directly needs its own remediation job.
- Backups and snapshots: cannot practically be edited in place. Either let old backups expire naturally within a documented retention window, disclosed as part of the deletion SLA (service-level agreement), meaning the data becomes irretrievable in production but persists in an inaccessible backup until it rolls off, or encrypt the isolated PII table with a per-subject key and crypto-shred the key so the backup contains only permanently unreadable ciphertext.
- Streaming topics: publish a deletion or tombstone event keyed by the pseudonym to a compacted topic so consumers apply the same removal; topics that already stored real attributes directly need a targeted purge or key rotation, which is exactly why the isolation pattern should be enforced at the producer level going forward.
- Derived, aggregated, and denormalized tables (the absorbed hard case): an aggregate that already summed or counted a subject's contribution can't be un-summed for one individual without recomputation. Aggregates where the subject's contribution isn't separable, for example "total monthly signups" among thousands, generally don't need per-subject reconstruction since no personal data is retrievable from them; but any denormalized table that copied the subject's raw attributes directly, the exact anti-pattern the isolated-table design avoids, must be identified and remediated as its own class of hard case, because the schema pattern didn't protect it in the first place.
- ML training sets (the other absorbed hard case): a model trained on data containing the subject's attributes is the hardest case, since deleting the raw training row doesn't remove what the model already learned. If the training pipeline referenced the pseudonym and looked up attributes at training time, deletion cascades the same way as any other pseudonym-keyed dataset. If raw PII was baked directly into stored training files, those artifacts must be identified and deleted, and the affected model scheduled for retraining on its normal cadence; exact "unlearning" from an already-trained model without retraining isn't something that can be reliably promised, so a scheduled retrain, not an in-place model edit, is the honest answer.
Verifiable proof for an auditor. A central deletion service issues a deletion event with a unique request ID and records which systems must acknowledge. Each downstream system, lake job, warehouse job, streaming consumer, backup rotation, writes a signed completion receipt back (system name, request ID, timestamp, rows or partitions affected) to an audit log the service owns. That audit log, not each team's word, is what's shown to an auditor: request R, acknowledged complete by N of N required systems, with receipts. Periodically, not just per request, a scan across systems for the deleted pseudonym confirms it doesn't resurface, for example from a delayed backfill job re-ingesting an old file, and any resurfacing is treated as its own incident.
flowchart TD
A[Deletion request: subject S] --> B[Deletion service]
B --> C[Isolated PII table: delete or crypto-shred row]
B --> D[Tombstone event: pseudonym P]
D --> E[Data lake jobs]
D --> F[Warehouse jobs]
D --> G[Streaming consumers]
D --> H[ML training pipeline: flag for retrain]
E --> I[Signed completion receipt]
F --> I
G --> I
H --> I
I --> J[Audit log: request R, N/N acknowledged]
Worked example. Subject S requests deletion. The deletion service deletes S's row from the isolated pii_identity table (keyed by pseudonym P) and publishes a tombstone for P to a compacted topic. A warehouse job that joined orders to pii_identity for display purposes now resolves no name for P, and needs no rewrite, since the orders table itself only ever stored P, never the name. A denormalized legacy export table that copied customer_name directly two years ago, before the isolation pattern was enforced, is flagged separately by the catalog tag and requires a one-off remediation job. The ML training pipeline had ingested pii_identity fields directly into a stored feature file for a churn model; that file is identified, the row purged, and the churn model queued for its next scheduled retrain rather than promised an immediate in-place fix. Each of the four affected systems, warehouse, streaming, legacy export, and ML pipeline, writes a completion receipt, and the deletion service shows 4/4 acknowledged in the audit log as the auditor-facing proof.
Trade-offs and pitfalls
- The isolated-PII-table pattern only works going forward and for systems built to reference the pseudonym; retrofitting it onto years of tables that denormalized real attributes directly is a real migration project, not a policy memo.
- Backups are the honest limitation almost every design has to disclose: either accept a documented backup-expiry window as part of the deletion SLA, or invest in per-subject encryption keys so backups can be crypto-shredded, which adds real key-management overhead.
- The most common wrong turn is declaring deletion done when the primary systems are clean but derived, denormalized copies and ML artifacts were never inventoried; a completion receipt from every known system is only as good as the catalog's completeness in knowing which systems exist.
For a video streaming product, propose three engagement metrics: one that should be tracked daily, one weekly, and one monthly. For each, explain why that time horizon is the right one and give one concrete product decision the metric would influence.
Sample Answer
For a video streaming product, the right engagement metrics differ by time horizon because a single number can't distinguish a good single session from a habit, so tracking one metric per horizon (daily, weekly, monthly) catches problems a single aggregate would hide.
Three engagement metrics by horizon
| Horizon | Metric | Why it matters | Decision it influences |
|---|---|---|---|
| Daily | Average minutes watched per active user, per day | Captures immediate session quality and whether today's content/recommendations are landing | Whether to roll back or keep a same-day content or UI change |
| Weekly | Number of distinct days active per user, per week (a stickiness signal) | Distinguishes users who binge once from users building a repeat-viewing habit | Whether a new show or feature is building a HABIT, not just a one-time spike |
| Monthly | Percent of users who complete at least one full series or season, per month | Signals whether the catalog and recommendations are delivering satisfying, completed experiences, not just started-then-abandoned viewing | Whether to invest in more content in a genre, or fix the recommendation algorithm's follow-through |
Why one horizon alone misleads
Daily minutes watched can spike from a single viral release without indicating any lasting change in habit; weekly days-active can look healthy from repeat short check-ins that never lead to satisfying, completed viewing; only the monthly completion metric would catch a catalog that hooks people briefly but rarely delivers a satisfying full watch, which is the actual thing a streaming business needs for long-term retention.
Trade-offs and pitfalls
Using only the daily metric invites over-reacting to noise (weekend viewing patterns, one big release) as if it were a durable trend; using only the monthly metric is too slow to catch a real-time regression from a broken recommendation algorithm. The three horizons are meant to be read together, not to replace each other.
Your training pipeline spends more time reading and preprocessing examples than updating weights. Data arrives in many small files from object storage, and every epoch redoes expensive transformations. How would you redesign the input path so the GPUs stay busy while preserving reproducibility and debuggability?
Sample Answer
Redesign the input path
I would separate expensive preprocessing from the training loop and make the input stream sharded, cached, and deterministic.
Main changes
- Compact many small object-store files into larger shards so reads are sequential instead of chatty.
- Precompute expensive transforms once, then store the transformed output or an intermediate cache.
- Use a manifest that records shard order, sample IDs, and versioned transform code.
- Prefetch data to local disk or memory so GPUs do not wait on network reads.
- Keep lightweight, deterministic transforms in the training worker so results are reproducible.
Worked example
If the dataset is 10,000 files of 2 MB each, that is 20 GB spread across many requests. Repacking into 200 shards of 100 MB keeps the same 20 GB, but cuts file open and listing overhead dramatically.
Why this helps
The GPUs stay busy because decoding and network latency happen ahead of time. Reproducibility comes from versioned manifests and fixed seeds. Debuggability comes from keeping raw sample IDs so a bad example can be replayed exactly.
This is usually the highest leverage change when preprocessing time dominates training time.
You're building a churn or customer-segmentation model from usage logs, support tickets, and demographics. Propose at least eight engineered features that could capture churn or segmentation risk, explaining the intuition and how you'd compute each from raw data at scale (roughly two million rows of mixed numeric, high-cardinality categorical, timestamp, and free-text data). Also discuss how you'd decide whether to standardize or bin the behavioral signals you propose, and how you'd detect feature leakage that would artificially inflate offline performance.
Sample Answer
Direct answer: Churn and segmentation feature design at scale needs to combine behavioral counts/rates/recency, cross-source interactions, and time-based signals computed from usage logs, support tickets, and demographics, with an explicit leakage check before trusting any offline lift, since churn labels are especially prone to accidentally encoding future information.
Structured elaboration: Eight concrete engineered features, with intuition and how each is computed at scale (roughly two million rows of mixed numeric, high-cardinality categorical, timestamp, and free-text data):
- Days since last login/usage event (recency) - intuition: a lapsing user's engagement gap widens before they formally churn. Computed via a vectorized groupby-max on the timestamp column per customer, not a row-by-row loop, which is essential at two million rows.
- Login/event frequency over trailing 7/30/90-day windows - intuition: a declining frequency trend is often more predictive than any single-point count. Computed via grouped, windowed aggregation (e.g.
groupby(customer_id).rolling()or a windowed SQL aggregate). - Usage-intensity trend (slope of a simple linear fit or week-over-week ratio of event counts) - intuition: distinguishes "still active but declining" from "steady at a low level," which behave differently for churn.
- Support ticket count and recency - intuition: a recent spike in support contact correlates with dissatisfaction, but must be computed carefully to avoid the leakage case below.
- Support ticket sentiment or category distribution (from free-text ticket bodies, e.g. via a lightweight TF-IDF or keyword-tagging pass) - intuition: ticket TONE (frustrated vs. neutral) often separates at-risk from routine contacts even at similar ticket counts.
- Plan/product tenure (time since signup or since last plan change) - intuition: churn risk is often U-shaped or front-loaded relative to tenure.
- High-cardinality categorical encoding of plan or product identifier - using target encoding (with proper out-of-fold computation to avoid leakage) or frequency encoding rather than naive one-hot, since a high-cardinality plan/product ID field would otherwise blow up the feature space.
- Cross-source interaction: declining usage AND a recent support contact (an explicit interaction feature, e.g. a flag or product of the two normalized signals) - intuition: the combination is a stronger churn signal than either usage decline or ticket volume alone, since users who complain but keep using the product, or who go quiet without complaining, behave differently than users doing both.
At roughly two million rows, computing these efficiently means vectorized, grouped aggregation (pandas groupby/window functions, or an equivalent SQL/Spark aggregation) rather than row-by-row processing, and encoding the high-cardinality categoricals (plan or product identifiers) with target or frequency encoding rather than naive one-hot encoding, which would otherwise create an unmanageably wide sparse matrix.
Whether to standardize or bin a behavioral signal depends on the downstream model and the signal's distribution: a heavily skewed count (most customers have very few support tickets, a small tail has many) often benefits from binning or a log-style transform for a linear model, while a tree-based model is largely indifferent to the raw scale and doesn't need standardization at all.
Detecting leakage specifically for churn: check whether any candidate feature (feature 4 and 5 above are the highest-risk ones) is computed using data from AFTER the point the churn decision would have actually been observable. A support ticket opened in response to a cancellation the customer had already decided on is a classic hidden leak, since it looks predictive but is really a symptom of the outcome, not a cause.
Worked example: A "days until account closure" style feature (however indirectly encoded, e.g. a support-ticket category that only exists post-cancellation) would show enormous offline lift and be completely unusable in production, since at prediction time you don't yet know whether the customer will churn; catching this requires explicitly auditing what information was genuinely available BEFORE the churn decision point for every candidate feature, not just checking whether the feature "looks reasonable."
Trade-offs and pitfalls: A common trap at this scale is trusting an offline metric improvement without an out-of-time evaluation; a feature that looks powerful on a random split can be capturing something that's specific to the historical period (a promotion that ran during part of the data) rather than a durable churn signal.
Define overfitting and underfitting, and explain how learning curves (training versus validation performance as a function of training-set size) let you tell them apart. Given a curve where training error stays low while validation error stays high and roughly flat, what's going on and what would you change? Then describe how the curves would look instead if the model were underfitting, and what you would do in that case.
Sample Answer
Overfitting: a model captures noise or idiosyncrasies in the training data and performs much better on training than on unseen data. Underfitting: a model is too simple to capture the underlying signal and performs poorly on both training and validation.
Learning curves: plot model performance (e.g., accuracy or RMSE) on training and validation sets versus training set size.
- Overfitting signature: training performance is high, validation performance is much lower; gap persists as data grows. Validation may improve slowly with more data. Worked example (train/validation accuracy at increasing training-set size n): n=100: train=99%, val=58%; n=500: train=98%, val=61%; n=1000: train=97%, val=62%; n=2000: train=97%, val=63%. The training curve sits near-flat and high the whole way, the validation curve creeps up only slowly, and the gap between them (roughly 35-40 points) barely narrows even as n quadruples: that persistent, wide, flat gap is exactly the "training error stays low while validation error stays high and roughly flat" pattern the question describes.
- Underfitting signature: both training and validation performance are poor and close to each other; adding more data doesn't help much. Worked example: n=100: train=64%, val=61%; n=500: train=66%, val=64%; n=1000: train=67%, val=65%; n=2000: train=67%, val=66%. Both curves sit low from the start, stay within a couple of points of each other throughout, and neither one climbs meaningfully as n grows: the model has hit a capacity ceiling that more data can't fix, unlike the overfitting case where the gap (not the level) was the problem.
Practical BI pipeline changes
- If I detect overfitting: add regularization or simplify the model used in automated reports (e.g., switch from a high-cardinality decision tree to a regularized logistic regression or apply L1 feature selection). Also enforce cross-validation in model training and reduce dimensionality (aggregate categorical levels, drop redundant features) before publishing predictions to dashboards. Applied to the worked example above, adding L2 regularization and dropping redundant features would be expected to pull training accuracy down from the high-90s toward the mid-80s while lifting validation accuracy from the low 60s toward the low-to-mid 70s, narrowing the gap rather than closing it in one step.
- If I detect underfitting: enrich features and increase model capacity: add derived features (time-based aggregations, interaction terms), loosen regularization, or use a more flexible model (e.g., gradient boosted trees) in the modeling stage. Re-run validation and update ETL to include the new features so dashboards reflect improved predictions. Applied to the worked underfitting example above, swapping in gradient boosted trees and adding derived features would be expected to lift both curves together, e.g. training accuracy from ~67% toward the mid-80s and validation from ~66% toward the high-70s, since the ceiling here was capacity, not overfitting.
These changes balance predictive accuracy with interpretability and operational constraints typical in BI deliverables.
Recommended Additional Resources
- DoorDash Engineering Blog: Articles on machine learning, data infrastructure, and experimental design practices
- DataLemur: DoorDash SQL interview questions and practice problems with detailed solutions
- Interview Query: DoorDash data scientist interview guide with case studies and real question examples
- StrataScratch: Real DoorDash SQL interview questions from actual candidates with community solutions
- Prepfully: Comprehensive DoorDash data scientist preparation with interview walkthroughs
- Books: 'Designing Data-Intensive Applications' by Martin Kleppmann, 'The Art of Statistics' by David Spiegelhalter, 'Lean Analytics' by Alistair Croll and Benjamin Yoskovitz, 'Storytelling with Data' by Cole Nussbaumer Knaflic
- Online Learning: StatQuest with Josh Starmer on YouTube (statistics and ML fundamentals), Andrew Ng's Machine Learning Specialization on Coursera, Stanford CS109 Data Science course materials
- Experimentation: 'Trustworthy Online Controlled Experiments: A Practical Guide to A/B Testing' by Kohavi, Tang, and Xu
- Community Resources: Blind (interview experiences from DoorDash candidates), Levels.fyi (salary and interview data), LinkedIn (DoorDash employee profiles and recent initiatives)
Search Results
Ace the DoorDash Data Scientist interview: Proven 2025 guide
Interview Questions · How do you analyze if a product is successful? · What are the most important metrics for DoorDash? · How do you measure revenue and cost?
DoorDash Data Scientist Interview in 2025 (Leaked Questions)
Can you describe a project where you used data to influence a decision? · How do you approach solving ambiguous problems? · What analytics tools ...
DoorDash Data Scientist Interview Guide: Questions, Case Studies ...
Expect questions on how you've influenced product decisions, aligned on metrics, or resolved ambiguity across teams.
DoorDash Data Scientist Interview Guide | Sample Questions (2025)
Tell me about one of your favorite projects. · How do you work with non-technical stakeholders? · How do you prioritize your work? · How do you handle differences ...
8 DoorDash SQL Interview Questions (Updated 2025) - DataLemur
What Do DoorDash Data Science Interviews Cover? · Probability & Statistics Questions · Python or R Programming Questions · A/B testing Questions ...
DoorDash Data Scientist Interview Question - YouTube
In today's video, let's delve into a common merchant acquisition question asked during DoorDash Data Science interviews.
Most Common DoorDash Data Scientist Interview Questions
DoorDash data scientist interviews test SQL knowledge, including ISODOW, ntile, WINDOW functions, date/time extraction, AVG/SUM, and WHERE/ ...
This interview preparation guide was generated using AI-powered research from the sources listed above. While we strive for accuracy, we recommend verifying critical information from official company sources.
Want to create your own tailored preparation guide using our deep research?
Get Started for FreeInterview-Ready Courses
Visual-first, interactive, structured learning paths