DoorDash Data Scientist Interview Preparation Guide - Junior Level
DoorDash's Data Scientist interview process for junior-level candidates consists of 6 rounds designed to assess SQL proficiency, product analytics thinking, machine learning fundamentals, and behavioral competencies. The process begins with a recruiter screen, followed by a technical phone screen focused on SQL and analytics, and concludes with 4 onsite rounds covering product case analysis, machine learning modeling, advanced SQL challenges, and behavioral/cross-functional collaboration. The entire process typically spans 3-4 weeks from initial application to final decision.
Interview Rounds
Recruiter Screening
What to Expect
Initial conversation with a recruiter to assess basic fit, background, and interest in the role. This 30-45 minute call covers your experience with data science, familiarity with Python/R and SQL, and motivation for joining DoorDash. The recruiter also discusses the role, team structure, and timeline.
Tips & Advice
Be concise about your background and highlight relevant data science experience. Have 2-3 specific examples of data projects ready to discuss. Ask thoughtful questions about the team, the role's impact, and what success looks like in the first 6 months. Research DoorDash's business model beforehand and mention a specific product or initiative you find interesting. This call is mutual fit assessment—be genuinely interested but professional.
Focus Topics
Availability and Timeline
Discuss your availability for interviews, notice period if employed, and timeline expectations. Be clear and realistic about your schedule.
Practice Interview
Study Questions
Motivation for DoorDash
Articulate why you're interested in DoorDash specifically. Connect their mission (empowering local economies) to your interests, mention a recent product initiative or engineering challenge, and explain why the Data Scientist role appeals to you.
Practice Interview
Study Questions
Background and Experience Narrative
Craft a compelling 2-3 minute summary of your data science experience, highlighting SQL, Python/R, statistics, and any relevant projects. Focus on tangible outcomes and skills directly applicable to DoorDash.
Practice Interview
Study Questions
Technical Foundation Check
Be ready to briefly discuss your proficiency with SQL (queries, joins, aggregations), Python or R, statistics concepts (hypothesis testing, distributions), and any experience with A/B testing or analytics tools like Tableau.
Practice Interview
Study Questions
Technical Screen - SQL & Analytics
What to Expect
A 60-minute remote technical interview conducted via a live coding environment (typically CodePair or similar). You'll solve 2-3 SQL problems focused on real-world data analytics scenarios at DoorDash. Problems involve joins across multiple tables, aggregations, window functions, subqueries, and time-based filtering. After solving SQL challenges, expect 1-2 quick follow-up questions on statistics, A/B testing concepts, or interpreting results.
Tips & Advice
Practice writing clean, efficient SQL code beforehand using platforms like LeetCode or DataLemur. Focus on queries involving GROUP BY, window functions (ROW_NUMBER, RANK, SUM OVER), JOINs, and CTEs. Start by clarifying the problem, discuss your approach before coding, and explain your logic as you write. Test edge cases mentally. For follow-up questions on statistics or A/B testing, think through the business context first. The interviewer (usually a senior data scientist or engineer) values your ability to think through data problems, not just syntax correctness. Ask questions if problem statement is ambiguous.
Focus Topics
A/B Testing and Statistics Fundamentals
Understand A/B test design basics: null hypothesis, alternative hypothesis, significance level, p-values, and statistical power. Know when to use t-tests vs. chi-square tests. Understand Type I and Type II errors. Be able to discuss whether a test result is statistically significant and practically meaningful.
Practice Interview
Study Questions
Query Optimization and Efficiency
Write queries that run efficiently. Avoid unnecessary nested queries, use appropriate JOIN types, filter early with WHERE clauses, and choose indexes wisely (though you won't create them in interviews). Explain why your approach is efficient. This shows mature thinking for a junior level.
Practice Interview
Study Questions
Real-World DoorDash Data Scenarios
Familiarize yourself with DoorDash's business model and typical data problems: calculating total order value per customer, finding top customers, analyzing orders by time period, computing delivery metrics, understanding restaurant churn. Think about table structures (customers, orders, restaurants, deliveries) and how they relate.
Practice Interview
Study Questions
Window Functions and Subqueries
Understand window functions like ROW_NUMBER(), RANK(), DENSE_RANK(), SUM()/AVG() OVER (PARTITION BY ... ORDER BY ...). Know how to use CTEs (WITH clause) to structure complex queries. Practice nested queries and when to use subqueries vs. JOINs. These are frequently tested at DoorDash.
Practice Interview
Study Questions
SQL for Analytics - Core Concepts
Master SQL fundamentals for analytics: SELECT, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT. Understand INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN and when to use each. Practice filtering on dates, aggregating metrics like COUNT, SUM, AVG, and combining multiple tables. Ensure comfort with NULL handling and data type conversions.
Practice Interview
Study Questions
Onsite Round 1 - Product Metrics & Case Analysis
What to Expect
A 45-60 minute onsite interview focused on product analytics and metric definition. You'll be asked questions like 'What metrics would you track for a new DoorDash feature?' or 'How would you measure success of a customer loyalty program?' You need to think through the business objective, define appropriate metrics (guardrail, primary, secondary), discuss trade-offs, and propose an experimental design if applicable. The interviewer (typically a senior data scientist or product analytics manager) assesses your ability to think like a product person, understand business drivers, and connect metrics to outcomes.
Tips & Advice
Start by clarifying the business objective and success criteria. Ask questions about constraints and stakeholders. Define 3-5 key metrics aligned to the goal: one primary metric (north star), guardrail metrics (ensure no negative side effects), and secondary metrics (additional insights). Discuss how you'd measure each metric, data sources, and potential biases. For example, if analyzing delivery time improvements, consider customer satisfaction, restaurant experience, and Dasher earnings. Discuss trade-offs: optimizing for speed might hurt restaurant quality or driver pay. Show how you'd iterate and what you'd do if the initial hypothesis failed. Use frameworks like the DoorDash business model (3-sided marketplace) to structure thinking. Draw diagrams if helpful. For junior level, showing structured thinking and asking good questions matters more than having perfect metrics.
Focus Topics
Experimentation and A/B Test Design
Be comfortable outlining an A/B test structure: control vs. treatment, sample size considerations, duration, success criteria, guardrails. Discuss how you'd ensure statistical power and avoid peeking bias. Explain sensitivity: how much lift needs to occur to justify a feature launch? This connects metrics to decision-making.
Practice Interview
Study Questions
Metric Deep-Dives and Problem Diagnosis
When given metrics and told something is wrong (e.g., 'customer orders dropped 5% after a delivery time improvement'), practice diagnosing root cause. Use slicing and segmentation, check data quality, consider external factors, identify if it's real or measurement error. Show your analytical process.
Practice Interview
Study Questions
Defining Success Metrics for DoorDash Features
Learn to define metrics that measure feature success. Understand North Star metrics (company/team level), primary metrics (feature level), guardrail metrics (prevent regressions), and secondary metrics (additional signals). For DoorDash, consider customer satisfaction, restaurant/merchant health, delivery efficiency, and Dasher satisfaction. For example, tracking delivery time improvement but ensuring restaurant quality doesn't drop.
Practice Interview
Study Questions
DoorDash Business Model and Trade-offs
Understand DoorDash's three-sided marketplace: customers want fast delivery and food quality, restaurants want order volume and profitability, Dashers want earnings and flexible work. Every decision involves trade-offs. When designing metrics, consider impact on all three sides. Example: surge pricing increases Dasher availability but may reduce customer orders if price too high.
Practice Interview
Study Questions
Onsite Round 2 - Machine Learning & Modeling
What to Expect
A 50-60 minute onsite interview assessing machine learning knowledge and modeling fundamentals. You'll encounter questions like 'How would you build a fraud detection model for DoorDash?' or 'Design a model to predict delivery times.' You're expected to discuss problem framing (classification vs. regression), feature engineering, model selection, validation approaches, and potential challenges. The interviewer (a senior data scientist or ML engineer) evaluates conceptual understanding, ability to think through end-to-end modeling pipelines, and awareness of real-world constraints like data availability and model serving.
Tips & Advice
Start by clarifying the business problem and success metric. Define it as classification, regression, or clustering. Discuss potential features and data sources. Talk through your feature engineering approach: how would you preprocess data, create new features, handle missing values? Suggest 2-3 candidate models (e.g., logistic regression, random forest, gradient boosting) and explain trade-offs (interpretability vs. accuracy, training time, complexity). Discuss model evaluation: cross-validation, train/test split, appropriate metrics (accuracy vs. F1 vs. AUC depending on problem). Mention potential pitfalls: data imbalance, distribution shift over time, fairness concerns. For junior level, you're not expected to implement models from scratch, but demonstrating structured thinking about ML problems shows you're ready to grow. Mention tools like scikit-learn or TensorFlow conceptually. It's okay to say 'I haven't implemented this exact model yet, but here's how I'd approach it.'
Focus Topics
Real-World ML Challenges at DoorDash
Discuss constraints in production: data drift (model performance degrades over time as data distribution changes), class imbalance (fraud is rare), latency (prediction must be fast for real-time systems), fairness (model bias across regions/demographics), and monitoring. These aren't theoretical—they're daily challenges.
Practice Interview
Study Questions
Model Validation and Evaluation Metrics
Master train/test/validation splits, cross-validation, and appropriate metrics: for regression use RMSE/MAE, for classification use accuracy/precision/recall/F1/AUC. Understand when each metric matters. E.g., for fraud detection, you care about recall (catch most fraud) but false positives hurt trust. Discuss overfitting vs. underfitting.
Practice Interview
Study Questions
Feature Engineering and Data Preprocessing
Discuss creating features from raw data: extracting day of week from timestamps, bucketing continuous variables, one-hot encoding categories, handling missing values (imputation vs. removal), normalization/scaling. For DoorDash, think about features for delivery time prediction: distance, restaurant cuisine, time of day, weather, historical patterns, Dasher experience, order complexity.
Practice Interview
Study Questions
Model Selection and Trade-offs
Understand common algorithms: logistic regression (interpretable, fast), decision trees (interpretable, prone to overfitting), random forests (robust, less interpretable), gradient boosting (powerful but complex). Know trade-offs: accuracy vs. interpretability, training time vs. model quality, complexity vs. maintenance burden. For junior roles, discussing trade-offs is more important than deep mathematical understanding.
Practice Interview
Study Questions
Problem Framing - Classification vs. Regression
Learn to identify problem type: Is it predicting a category (fraud vs. not fraud)? A continuous value (delivery time in minutes)? Once identified, choose appropriate algorithms and evaluation metrics. For junior level, understand that problem framing often matters more than model selection.
Practice Interview
Study Questions
Onsite Round 3 - Advanced SQL & Data Manipulation
What to Expect
A 50-60 minute onsite technical interview diving deeper into SQL and analytics problems. Unlike the phone screen, you'll solve more complex queries with multiple CTEs, intricate window functions, time-series analysis, or data manipulation across many tables. You may also receive messy data and asked to clean/transform it. Some interviewers incorporate a take-home component: you might receive a dataset and asked to write SQL to answer business questions, then present findings. The goal is to assess depth of SQL knowledge, problem-solving approach with complex data, and ability to handle ambiguous scenarios.
Tips & Advice
Think aloud throughout. Start by understanding the problem, sketching out an approach or drawing diagrams if needed, then implement. If stuck, describe your thinking rather than staying silent. For complex queries, build incrementally: start with a simpler version and add complexity. Test your logic with edge cases (empty data, duplicates, NULLs). Optimize for readability first, then efficiency if needed. If asked to analyze messy data, show data quality checks before analysis: check for duplicates, data type inconsistencies, unexplained nulls. For junior level, showing systematic problem-solving and clean thinking is valued over perfect first-attempt queries. Ask clarifying questions about data definitions and business context.
Focus Topics
Analytical Thinking and Results Interpretation
After writing a query that retrieves results, pause and interpret: Do the numbers make sense? Are there unexpected patterns? What might explain anomalies? This moves beyond writing SQL to thinking like an analyst. For junior level, showing curiosity and analytical rigor is valued.
Practice Interview
Study Questions
Time-Series and Date-based Analysis
Work with timestamps and dates: extract components (year, month, day, hour), compute date differences, group by time periods (daily, weekly, rolling windows). Analyze trends over time, find anomalies, and forecast patterns. For DoorDash, common analyses involve daily/hourly order volumes, delivery time trends, or seasonal patterns.
Practice Interview
Study Questions
Data Cleaning and Quality Checks
When given raw data, assess quality first: identify missing values, duplicates, outliers, data type mismatches, and unexpected values. Document assumptions and transformations before analysis. Example: if analyzing delivery times, check for outliers (misclassified data, failed deliveries), timezone issues, etc.
Practice Interview
Study Questions
Complex Multi-table Joins and Aggregations
Solve problems requiring joins across 4+ tables with complex filter conditions. Combine multiple aggregation levels. Example: calculate the average delivery time per restaurant per day, but only for high-volume restaurants, handling NULL values appropriately. Show clarity on join logic and explain expected output size.
Practice Interview
Study Questions
Advanced Window Functions and CTEs
Master complex window functions: running totals using SUM() OVER (ORDER BY), ranking within groups using RANK()/DENSE_RANK() with PARTITION BY, lag/lead for time-series analysis, and nested window functions. Understand Common Table Expressions (CTEs) with multiple steps and recursive CTEs. These are DoorDash favorites.
Practice Interview
Study Questions
Onsite Round 4 - Behavioral & Cross-Functional Collaboration
What to Expect
A 45-60 minute onsite interview assessing behavioral fit, communication, collaboration, and problem-solving approach. Expect 5-7 behavioral questions covering your experience with data-driven decisions, handling ambiguity, working with cross-functional teams, learning new skills, receiving critical feedback, and project delivery. Questions are designed to evaluate DoorDash values: bias for action, intellectual rigor, collaboration, and cultural fit. This round is typically conducted by a mid-level or senior data scientist or engineering manager.
Tips & Advice
Use the STAR method (Situation, Task, Action, Result) for each question. Prepare 5-6 concrete stories beforehand covering: influencing a decision with data, disagreeing productively, learning quickly under pressure, mentoring or helping a colleague, adapting to ambiguity, and delivering despite constraints. For junior level, stories don't need to show leadership of large teams; focus on collaborating effectively, showing growth mindset, and delivering value. Be specific with numbers and outcomes. Avoid generic statements; interviewers value authenticity. If asked about failure, discuss what you learned, not excuses. When asked about communication, give an example of explaining technical concepts to non-technical stakeholders. Show genuine interest in DoorDash's mission and culture. Ask thoughtful questions about team dynamics, how success is measured, and what collaboration looks like.
Focus Topics
Receiving and Acting on Feedback
Describe receiving critical feedback, especially from someone more senior. How did you react? What did you learn? How did you improve? Junior candidates should show humility, openness to feedback, and ability to incorporate it without defensiveness.
Practice Interview
Study Questions
Project Delivery and Accountability
Share a project where you delivered results despite constraints (tight timeline, limited resources, unclear requirements). How did you prioritize? How did you stay organized? What was the outcome? For junior level, focus on showing ownership and follow-through, not necessarily leading large initiatives.
Practice Interview
Study Questions
Learning and Growth Mindset
Share an example of learning a new skill or technology quickly. Why did you need to learn it? What approach did you take? How did you validate learning? For junior level, showing eagerness to grow and ability to pick up new tools matters more than depth of expertise.
Practice Interview
Study Questions
Handling Ambiguity and Disagreement
Describe a situation where a problem wasn't clearly defined or you disagreed with a colleague. How did you navigate ambiguity? How did you resolve disagreement respectfully? For junior level, show that you ask good questions, propose solutions, listen to others, and don't just do as told.
Practice Interview
Study Questions
Cross-Functional Collaboration and Communication
Share an example of collaborating with product, engineering, or business teams. How did you communicate technical findings to non-technical stakeholders? How did you incorporate feedback? For junior level, show that you adapt communication style, ask clarifying questions, and see collaboration as two-way.
Practice Interview
Study Questions
Data-Driven Decision Making
Prepare a story where your analysis directly influenced a business decision. Use the STAR method: What was the situation? What question did leadership ask? How did you approach the analysis? What did you find, and how did it change the decision? For junior level, this could be a project where your insights helped prioritize feature work or optimize a process.
Practice Interview
Study Questions
Frequently Asked Data Scientist Interview Questions
Describe the main differences between OLTP and OLAP systems and how schema design changes for each. Using an e-commerce orders domain, explain how you would design the transactional (OLTP) schema and how you'd design the analytical (OLAP) schema. Discuss normalization, indexing, ETL/ELT patterns, query-latency expectations, and typical query types.
Sample Answer
Direct answer
OLTP systems are optimized for many small, concurrent transactions on current data, so their schemas are normalized to keep writes cheap and consistent; OLAP systems are optimized for large, read-only aggregations over historical data, so their schemas are denormalized (often star-schema-shaped) to keep scans and joins cheap.
Structured elaboration
| Dimension | OLTP | OLAP |
|---|---|---|
| Normalization | High (3NF+), minimizes update anomalies | Lower, denormalized for read speed |
| Query type | Point lookups, small transactional writes | Large aggregations, scans, group-bys |
| Query latency goal | Milliseconds | Seconds is often acceptable |
| Concurrency | Many concurrent short transactions | Fewer, heavier concurrent queries |
| Storage layout | Row-oriented, indexed for point access | Often columnar, indexed/partitioned for scans |
Worked example
For an e-commerce orders domain: the OLTP schema is customers, orders, order_items, payments, all normalized with foreign keys, so that placing an order is a small, fast transaction with ACID guarantees (atomicity, consistency, isolation, durability) touching only the rows involved and never risking an update anomaly on shared data. The OLAP schema built from the same domain, feeding a revenue dashboard, is typically a denormalized fact table like fact_order_line(date_key, customer_key, product_key, quantity, revenue) joined to small dimension tables, so that "total revenue by product category last quarter" is one scan and aggregation over a purpose-built table rather than a multi-way join across the live transactional tables (which would also risk slowing down the transactional workload itself).
Trade-offs and pitfalls
- Running analytical queries directly against the OLTP schema is the most common mistake this comparison is testing for: heavy scans compete for the same locks and buffer-pool space as live transactional writes, so most teams replicate or ETL the OLTP data into a separate OLAP store (a warehouse) rather than analyzing production directly.
- ETL/ELT is the bridge between the two: batch or change-data-capture (CDC) pipelines periodically transform the normalized OLTP shape into the denormalized OLAP shape, meaning the OLAP side is always somewhat stale relative to the OLTP source, by however long that pipeline's latency is.
- The typical enterprise reporting source of truth is the OLAP side, precisely because the OLTP schema is optimized for correctness-under-concurrency, not for the kind of ad hoc, multi-dimensional slicing that reporting needs.
Tell me about a time you recommended rolling back a feature because measurement showed a negative impact. Use the STAR structure: Situation, Task, Action, Result.
Sample Answer
Direct answer: Frame the story around the specific evidence that changed your mind, not just the outcome: what the feature was doing when you called it, what data made you confident enough to recommend rolling it back, and what pushback (if any) you navigated to make the call stick.
Structured elaboration
- Situation: set up what the feature was and what it was supposed to do, briefly, so the listener understands the stakes of the decision.
- Task: state what you were responsible for (owning the metric, or being the person who had to make the recommendation) and what made the call non-obvious (early positive signal, organizational excitement, sunk cost).
- Action: describe the specific analysis or signal that convinced you the feature was net-negative (a guardrail metric breaking, a longer-horizon metric turning negative once enough time had passed, a segment where the harm concentrated), and how you communicated the recommendation, including handling any disagreement.
- Result: state what happened after the rollback (the guardrail recovering, or a quantified cost avoided) and, ideally, what changed in how the team measures or launches features afterward as a result of this experience.
Worked example: A candidate describes owning analytics for a checkout redesign that showed a clean, statistically real lift in conversion in its first two weeks. By week four, the candidate noticed refund requests within 14 days had climbed from a 3% baseline to 5.5% among users exposed to the new flow, driven by a confusing step that made users complete purchases they had not fully intended to finish. The candidate brought the refund data to the team, quantified the net revenue effect once refunds were included (turning a nominal conversion win into a net loss once refunds were netted out), and recommended a rollback despite pushback from stakeholders who were excited about the conversion number. The team rolled back within a week, refund rate returned to baseline, and the team adopted a standing rule to track a 14-day refund guardrail on every checkout experiment going forward.
Trade-offs and pitfalls: A weak version of this story stops at "the metric went down so I said roll it back," without showing the specific evidence and reasoning that made the call defensible under pushback; the strongest version shows a metric that looked good getting reinterpreted once a longer window or a guardrail surfaced the real cost. Avoid overstating your personal authority in the decision if you were one voice among several; credit the process (the guardrail existing, the team's willingness to act on it) rather than framing it as a unilateral heroic call.
You ingest semi-structured JSON payloads where different records use inconsistent sets of keys. Write a single-pass SQL query that infers a schema from the data: list every top-level key observed, its inferred type, the count of non-null occurrences, and a small sample of values, so you can understand what's actually in the payload before designing a stricter schema.
Sample Answer
Unnest every top-level key across all rows in one pass, and aggregate per key: its inferred type, how often it's present, and a small sample of actual values, so you understand the real shape of inconsistent JSON before designing a stricter schema for it.
Approach
```sql
WITH keys AS (
SELECT json_keys(payload) AS ks, payload FROM raw_events
),
unnested AS (
SELECT UNNEST(ks) AS key_name, payload FROM keys
)
SELECT key_name,
COUNT(*) AS non_null_occurrences,
MODE(json_type(json_extract(payload, '$.' || key_name))) AS inferred_type,
ARRAY_AGG(json_extract(payload, '$.' || key_name))[1:3] AS sample_values
FROM unnested
GROUP BY key_name
ORDER BY non_null_occurrences DESC;
```
`json_keys` lists every top-level key present in a given row's payload, so unnesting across all rows and grouping by key name gives you, in one pass, exactly which keys exist across the whole dataset and how consistently.
Worked example
Across 1,000 rows, a key like `user_id` might appear in all 1,000 (always typed as an integer), while a key like `promo_code` appears in only 40 rows and shows a MIXED inferred type (sometimes a string, sometimes null-typed because it's absent), immediately telling you `promo_code` is optional and needs type-coercion handling wherever it's consumed downstream.
Trade-offs and pitfalls
`MODE()` on the inferred type picks the MOST COMMON type per key, which can mask real type inconsistency within that key (a numeric field that's occasionally sent as a string); if type consistency itself is what you're validating, report the DISTINCT set of observed types per key, not just the mode, so a key with genuinely mixed types is visible rather than silently summarized away. This schema-inference query is a useful first pass before designing a stricter, declared validation (checking specific required keys exist and specific values cast correctly), which is a separate, narrower query once you know what "correct" should look like for this payload.
Describe bias and variance in the context of ML models. Give a concrete example of a high-bias model and a high-variance model, and explain a practical step you would take to reduce each issue in a production pipeline.
Sample Answer
Definition: Bias is error from incorrect assumptions underfitting the true pattern; variance is error from sensitivity to training data overfitting.
Concrete examples:
- High-bias model: linear regression on nonlinear data (e.g., quadratic relationship). Remedy: increase model capacity — add polynomial features or switch to a nonlinear model (tree-based or neural net). In production, implement feature engineering or deploy a higher-capacity model and validate with cross-validation and holdout tests.
- High-variance model: deep neural network with small dataset causing overfitting. Remedy: regularization — L2/dropout, data augmentation, early stopping, or collect more labeled data. In production, add regularization hyperparameters, implement robust validation (k-fold), and use monitoring for generalization drift.
Practical pipeline steps: - For bias: add features, choose richer model family, monitor train vs validation error gap to confirm reduced bias.
- For variance: apply regularization, early stopping, ensembling, and expand dataset; track validation stability and reduce model complexity until variance is controlled.
Explain what INTERSECT and EXCEPT (or MINUS) do. Given two same-shaped snapshots of the same population (say two years of customer IDs), write queries that find customers present in both and customers present in one but not the other, and note how NULLs and duplicate rows affect the result.
Sample Answer
Direct answer. INTERSECT returns only the rows that appear in BOTH result sets. EXCEPT (MINUS in Oracle) returns the rows that appear in the FIRST result set but not the second. Both compare whole rows, need the same number of columns with compatible types on each side, and both dedup their output.
Structured elaboration. Think of them as set arithmetic over two same-shaped result sets rather than as joins: there's no join key to specify, the entire row IS the comparison unit. That makes them a natural fit for comparing two snapshots or two populations directly, without writing an explicit join condition.
Worked example. customers_2023(customer_id): 1, 2, 3. customers_2024(customer_id): 2, 3, 4.
-- customers present in BOTH years (returning customers)
SELECT customer_id FROM customers_2023
INTERSECT
SELECT customer_id FROM customers_2024;
-- returns 2, 3
-- customers present in 2023 but not 2024 (lost customers)
SELECT customer_id FROM customers_2023
EXCEPT
SELECT customer_id FROM customers_2024;
-- returns 1
Trade-offs and pitfalls. Both operations dedup by default (like UNION, not UNION ALL), so if you need to know HOW MANY TIMES a row appeared rather than just whether it appeared, INTERSECT/EXCEPT are the wrong tool and you need an explicit join or GROUP BY instead. NULLs in the compared columns are handled specially: unlike an ordinary equality comparison, most engines treat two NULLs in the same position as equal for the purposes of this row comparison, which is the opposite of how NULL behaves in a join predicate, and is a common source of confusion when you've internalized "NULL never equals NULL" from working with joins.
You're setting up shared KPIs and a dashboard for an initiative that spans data, product, and another function. How do you decide which metrics should be owned by a single team versus genuinely shared, and what happens when two teams report different numbers for the same thing?
Sample Answer
Direct answer
Ownership should follow causal control, not who asked for the metric. A number that only one team's actions actually move belongs to that team as a leading indicator. A number that several teams jointly move needs to be treated as a shared outcome with exactly one canonical definition that everyone points to, not each team computing its own version of 'the same' number.
Structured elaboration
1. Decide ownership by who controls the number
Ask: if this metric moved tomorrow, whose decisions would most plausibly explain it? If the answer is one team, it's team-owned. If the honest answer is 'several teams, depending on the week,' it's a shared outcome metric and needs shared governance, not a single team's dashboard.
2. Give every shared metric one canonical definition
Store the computation (the query or transformation logic) in one place, documented with an owner, a last-updated date, and the exact filters and date logic used. Any dashboard or report showing that metric should read from that canonical source, not recompute it independently.
3. When two teams report different numbers, reconcile, don't debate
The canonical definition is the tiebreaker by default. If a mismatch appears, the fix is a reconciliation step: compare the two calculations side by side, find where the logic diverges (a different date window, a different filter, a stale cache), and correct the deviating one, or update the canonical definition itself if it turns out to be wrong. Either way, log the decision so the same disagreement doesn't restart from zero next quarter.
4. Put governance around who can change a shared definition
A shared metric's definition should not change because one team unilaterally decides a different cohort or window looks better. Route changes through a lightweight review involving everyone who reports on that metric, and version the definition so historical numbers can be explained if they shift after a redefinition.
Worked example
A dashboard spans data engineering, product, and marketing for a signup-to-paid-conversion initiative. Splitting ownership this way keeps the dashboard honest:
| Metric | Type | Owner | Why |
|---|---|---|---|
| Data pipeline freshness | Leading indicator | Data engineering | Only their ingestion and processing decisions move it |
| Feature activation rate | Leading indicator | Product | Only their onboarding and UX decisions move it |
| Campaign click-through rate | Leading indicator | Marketing | Only their creative and targeting decisions move it |
| Sign-ups | Shared outcome | Joint; canonical query maintained by data engineering, reviewed by product and marketing | Product, marketing, and the funnel itself all influence it |
| Paid conversion | Shared outcome | Joint | Product, marketing, and pricing decisions all influence it |
When marketing's report shows a different sign-up count than the shared dashboard, the reconciliation step finds that marketing's number excluded a promo-code cohort by mistake. The canonical query is correct; marketing's ad hoc report is fixed to match it, and the discrepancy is logged so the next person who notices a mismatch can find the resolution instead of reopening the debate.
Trade-offs and pitfalls
- Centralizing every metric, including team-level leading indicators, slows down the teams that need to iterate quickly on their own signals; only the genuinely shared outcomes need the heavier canonical-definition process.
- Fully decentralizing shared outcome metrics guarantees mismatched dashboards eventually, which quietly erodes trust in the data even when the underlying numbers are directionally fine.
- A 'single source of truth' only works if using an alternate calculation is treated as a defect to fix, not a valid difference of opinion; without that enforcement, teams drift back to their own numbers within a quarter.
- Late-arriving corrections that change historical values need an explicit policy (do dashboards restate history, or only apply corrections going forward) decided in advance, or every correction becomes its own dispute.
A workload spans many tenants (or many distinct sub-populations) with very different data distributions, and generic table-level statistics lead to bad plans for some of them. What options do you have short of full per-tenant partitioning, and how would you validate that a given fix actually helped the affected tenants without regressing the rest?
Sample Answer
Direct answer. Short of full per-tenant partitioning, you have per-tenant or filtered statistics (where the engine supports collecting statistics scoped to a subset of the data), query-time hints or per-tenant query variants that account for known skew, and, more structurally, isolating the most extreme outlier tenants onto their own physical partition while leaving the rest on shared, generically-planned infrastructure; validate whichever you choose by checking plan quality for BOTH the affected outlier tenants and the unaffected majority, not just the one you noticed complaining.
Structured elaboration. Generic, table-wide statistics describe an "average" distribution across every tenant, which works fine for typical tenants but can badly misdescribe an unusually large or unusually skewed tenant's actual data shape, leading the optimizer to a plan tuned for the average case rather than that specific tenant's reality. Filtered or extended statistics, where available, can capture a more nuanced picture (for instance, statistics conditioned on a tenant-identifying column) without requiring full physical separation. Where that's not available or not granular enough, a smaller, more surgical structural change, moving only the handful of genuinely extreme tenants onto dedicated partitions or even dedicated infrastructure, while leaving the long tail of typical tenants on the shared, generically-planned setup, often captures most of the benefit of full per-tenant partitioning at a fraction of the operational cost.
Testing the chosen approach means checking plan quality and query latency for BOTH ends of the distribution: the outlier tenants you're specifically trying to help, AND a sample of typical tenants, to confirm you haven't traded one group's problem for the other group's regression, since a fix tuned too specifically for the outliers' shape can sometimes make plans worse for the previously-fine majority.
Worked example. A multi-tenant analytics platform where 95% of tenants have a few thousand rows each but a handful of enterprise tenants have tens of millions, generic table-wide statistics will describe something close to "typical tenant size," badly misleading the optimizer for both ends: plans tuned for the (statistically dominant, small) typical tenant can be catastrophic for the enterprise tenants, and, less obviously, statistics skewed by including the enterprise tenants' data can occasionally produce suboptimal plans for the typical tenants too.
Trade-offs and pitfalls. Full physical per-tenant partitioning is the most complete fix but also the most operationally expensive, more partitions to manage, more complexity in every cross-tenant query; reach for it only once you've confirmed lighter-weight options (filtered statistics, isolating just the extreme outliers) genuinely aren't sufficient, rather than defaulting to the heaviest solution first.
A model's error rate has increased sharply for a particular user segment, or SHAP feature importances have shifted noticeably after a data pipeline change. Describe how you would use SHAP values to perform root-cause analysis: computing per-segment attributions, comparing them to a baseline, and the caveats when features are correlated, and how you would determine whether the shift reflects a real population change, a preprocessing bug, newly introduced leakage, or a training artifact.
Sample Answer
Situation: The model's error rate has jumped for a specific user segment (e.g., users in Region X). I would use SHAP to find which features' contributions changed for that segment versus baseline and identify the likely root cause.
Steps:
- Compute instance-level SHAP
- Use the same explainer used in production (TreeExplainer/DeepExplainer/KernelExplainer) and compute SHAP values for: (a) all instances in the failing segment, (b) a baseline set (historical population or recent non-failing users).
- Aggregate across the segment
- Compute per-feature metrics: mean(SHAP), mean(|SHAP|), median, and the sign proportion (fraction positive vs negative). Capture the distribution (violin/histogram) to see heterogeneity.
- Optionally compute interaction SHAP for top features to detect feature-pair effects.
- Compare to baseline
- For each feature compute delta = metric_segment minus metric_baseline. Rank features by change in mean(|SHAP|) and change in signed mean to see which features increased in influence or flipped direction.
- Run statistical tests (bootstrap CIs, permutation test, or a t-test if assumptions hold) to verify significance and compute effect sizes.
- Distinguishing the four possible root causes explicitly
- Real population change: the segment's INPUT feature distributions genuinely shifted (a new user cohort, a seasonal effect, a new device type). Confirm by comparing feature distributions for the segment across time using the raw, non-model data, independent of SHAP. If the SHAP shift tracks a distribution shift that's externally explainable (a marketing campaign, a product launch, a new region), this is the likely cause, and the fix is usually retraining or reweighting rather than a bug hunt.
- Preprocessing bug: the FEATURE VALUES going into the model changed because of a code or pipeline defect (a join breaking, a null-fill changing, a unit change), not because the real world changed. Confirm by re-running the exact preprocessing code on raw logs captured before and after the suspected change and diffing the outputs field by field; a feature that silently changed shape (a categorical suddenly encoded differently, a numeric field's scale shifted by a constant factor) with no real-world reason is a bug, not a population shift.
- Newly introduced leakage: a feature that was NOT available at the true prediction time is now present, or a previously-masked feature briefly saw future or label-correlated information, causing the model to appear to lean on it more heavily. Confirm by explicitly checking the feature's computation window against the label's timestamp for the affected segment (does it use any event at or after the point the label became known?), and by checking whether the SHAP-flagged feature correlates suspiciously strongly with the label -- near-perfect separation is a leakage tell, not a real signal.
- Training artifact: nothing changed in production data at all; the apparent shift is an artifact of HOW SHAP was computed (a different background/reference dataset between the two runs, a different model version, or a small-sample-size segment producing high-variance attributions). Confirm by recomputing SHAP for both time periods with identical explainer settings, background dataset, and model version, and by bootstrapping the segment's SHAP estimates to see if the 'shift' is within noise.
Only after ruling out the preprocessing-bug, leakage, and training-artifact explanations (all fixable infrastructure issues, not real signal) should the SHAP shift be treated as reflecting a genuine change in the world that the model needs to be retrained or reweighted for.
Caveats when interpreting SHAP changes:
- SHAP is descriptive, not causal: a change in SHAP points to association with model output, not that the feature caused the errors.
- Background/baseline choice matters: SHAP values depend on the background dataset; compare using a consistent baseline or test sensitivity to different baselines.
- Correlated features & interactions: SHAP can apportion importance across correlated inputs but may produce unstable attribution; use interaction SHAP and conditional analyses.
- Sample size and variance: small segments yield high variance; use bootstrap CIs.
- Model changes and explainer consistency: if the model version changed, recompute SHAP with the same explainer settings.
- Computation & approximation: kernel approximations may be noisy; prefer exact explainers for trees or validated approximations.
This process links SHAP-driven signals to a specific, testable root cause among the four candidates above, enabling prioritized, testable remediation (relabeling, retraining, feature fixes, or targeted monitoring) instead of treating every SHAP shift as automatically meaningful.
How would you handle class imbalance specifically for a tree-ensemble model: class weighting, balanced subsampling, focal loss, or resampling? What are the tradeoffs for training stability and production deployment?
Sample Answer
Direct answer
For tree ensembles specifically, class weighting is usually the right first move: it's simple, requires no change to the training data, and both random forests and gradient boosting frameworks support it natively (class_weight, scale_pos_weight). Balanced subsampling and resampling change what data each tree actually sees and can help further, but at the cost of discarding majority-class information or duplicating minority-class examples; focal loss is a more surgical tool for boosting frameworks when the imbalance is compounded by many "easy" majority examples drowning out gradient signal from hard ones.
Structured elaboration
| Method | Mechanism | Training stability | Production deployment |
|---|---|---|---|
| Class weighting | Scale the loss contribution of each class (class_weight='balanced', scale_pos_weight) | Stable; no data duplication, same effective sample size | Simple, no preprocessing pipeline to maintain, easy to A/B different weight schemes without retouching data |
| Balanced subsampling | Draw each tree's bootstrap sample with equal counts from each class (random forest's balanced_subsample) | Reduces majority-class information per tree, can raise per-tree variance | Reproducible if seeded; changes what the forest "sees" but not the model artifact's shape |
| Resampling (SMOTE / undersampling) | Change the training set composition before training: duplicate/synthesize minority examples or drop majority examples | Oversampling risks overfitting duplicated points; undersampling discards real majority-class signal, raising variance | Adds a preprocessing step that must be version-controlled and reproduced identically at retrain time; SMOTE's synthetic points can look unrealistic in high-dimensional or categorical-heavy feature spaces |
| Focal loss | Down-weight well-classified ("easy") examples in the loss so gradient signal concentrates on hard, often minority, examples | Adds a tuning parameter (focusing parameter γ); can overfit noisy minority examples if γ too aggressive | Requires a custom objective in gradient boosting frameworks (not always a one-line config flag); complicates probability calibration since the loss no longer directly targets calibrated likelihoods |
Why class weighting is the default starting point for tree ensembles. It leaves the training data itself untouched, so there's no risk of the duplication-driven overfitting that oversampling introduces, or the information loss from undersampling. Both bagged and boosted tree frameworks support it as a first-class option, so it's a one-parameter change rather than a new pipeline step. The main risk is that extreme weight ratios can make optimization noisy: a rare class weighted very heavily can cause a boosting model to overfit the handful of minority examples it does see, since each of their gradient contributions is now large.
When to reach further. If class weighting alone still leaves the model insensitive to the minority class (common under severe imbalance, e.g. beyond roughly 100:1), balanced subsampling or targeted resampling can help by directly changing what fraction of each tree's or boosting round's training signal comes from each class, rather than just reweighting a fixed dataset. Focal loss is worth reaching for specifically when the problem isn't just "too few minority examples" but "too many easy majority examples burying the gradient signal from the hard cases," which plain class weighting doesn't address, since it reweights by class label alone, not by how hard an individual example currently is to classify.
Worked example
Take a dataset with 10,000 negative examples and 500 positive examples (a 20:1 imbalance ratio). For gradient boosting's scale_pos_weight, the standard recommendation is the ratio of negative to positive counts:
For scikit-learn's class_weight='balanced' scheme, each class's weight is wc=nclasses×ncntotal. With ntotal=10,500, nclasses=2:
Note the two schemes give different numbers (20 vs. 10.5 for the positive class) because they normalize differently, scale_pos_weight is a raw ratio applied only to the positive class in a binary boosting objective, while class_weight='balanced' normalizes both classes' weights to average to 1 across the dataset; mixing up which convention a given library expects is a common, silent source of over- or under-weighting in practice.
Trade-offs & pitfalls
- Class weighting changes what the model optimizes for but not what data it sees; if the minority class has very few examples in absolute terms (say, under a few dozen), no amount of reweighting compensates for the model simply never having encountered enough variety in that class to learn robust patterns from it.
- Oversampling (including SMOTE) evaluated with plain k-fold CV is a common leakage trap: if resampling happens before the train/validation split, synthetic or duplicated minority points can leak into the validation fold, inflating the reported score; resampling must happen only inside each fold's training portion.
- Whatever imbalance-handling method is used during training, predicted probabilities are no longer calibrated to the true class balance (they now reflect the reweighted/resampled training distribution), so a separate threshold-tuning or recalibration step (e.g., Platt scaling or isotonic regression against a held-out set with the true class balance) is usually needed before deploying probability outputs to a business rule.
- Prefer the simplest method that closes the gap: class weighting first, escalate to subsampling or resampling only if weighting alone underperforms on the metric that matters (typically AU-PR or F-beta for imbalanced problems, not raw accuracy), and reserve focal loss for cases where the hard-example-mining behavior specifically, not just class rebalancing, is the diagnosed problem.
Implement frequency encoding in Python: given a DataFrame and a categorical column name, return a new column with each category's frequency (count or normalized frequency). Discuss the pitfalls of using frequency encoding in production when categories are high-cardinality or when the training and serving distributions differ.
Sample Answer
Direct answer: Frequency encoding replaces each category with how often it occurs (as a raw count or a normalized proportion), which is cheap, fixed-size regardless of cardinality, and needs no training-time-vs-serving-time complexity, but the same simplicity is exactly what causes its production pitfalls at high cardinality or when the training and serving populations differ.
Structured elaboration:
The implementation: group by the categorical column, compute each category's count (or count divided by total rows, for a normalized frequency), and map each row to its category's computed value. This is a simple, deterministic, table-lookup-style transform once fit on training data.
Worked example: Verified: applying frequency encoding to a small categorical column (['a','a','b','c','a','b']) correctly assigns 'a' a frequency of 0.5 (occurring 3 of 6 times), 'b' a frequency of 0.333 (2 of 6), and 'c' a frequency of 0.167 (1 of 6), confirming the encoding correctly reflects each category's relative prevalence in the fitted data.
Trade-offs and pitfalls: At high cardinality, frequency encoding suffers the same COLLAPSING problem discussed for other encodings in this topic: two entirely distinct categories that happen to occur with the same frequency become indistinguishable to the model, purely by coincidence of prevalence, not any real similarity between them. More importantly for production: if the training-time and serving-time populations differ (a category that was rare in training suddenly becomes common in a later period, or vice versa), the frequency encoding computed once at training time becomes STALE, silently misrepresenting a category's current true prevalence; this is a genuine, easy-to-miss instance of training-serving skew specific to this encoding, and argues for periodically refreshing the fitted frequencies (with a defined, deliberate cadence) rather than treating them as a one-time, forever-fixed lookup.
Recommended Additional Resources
- DataLemur (datalemur.com) - DoorDash SQL interview questions with solutions
- LeetCode Medium-level SQL and database problems for analytics interview preparation
- Mode Analytics SQL Tutorial - practical SQL for analytics and business intelligence
- Preparing Data for Analysis by Klaes Nygard - book on data cleaning and preprocessing
- Netflix Data Scientist Interview Guide - DoorDash and Netflix have similar analytics interview patterns
- InterviewQuery.com - specific DoorDash data science interview guides with real questions
- A/B Testing and Experimentation at Scale by Kohavi, Tang, Xu - understand experimentation frameworks
- Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow by Aurélien Géron - ML fundamentals
- SQL Performance Explained (sqlperformanceexplained.com) - learn query optimization techniques
- DoorDash Engineering Blog - follow recent projects and technical insights
- Glassdoor and Blind - read recent interview experiences from other candidates
- Kaggle datasets - practice real data science projects end-to-end with Python, SQL, and ML
Search Results
DoorDash Data Scientist Interview
2.4 Behavioral / Leadership Questions · Describe a time you used data to influence a business decision at DoorDash. · How do you prioritize ...
DoorDash Data Scientist Interview 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 Guide: Questions, Case ...
Expect questions on how you've influenced product decisions, aligned on metrics, or resolved ambiguity across teams.
DoorDash Data Scientist Interview Guide
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 ...
DoorDash Data Scientist Interview Question - Solving a ...
In today's video, let's delve into a common merchant acquisition question asked during DoorDash Data Science interviews.
8 DoorDash SQL Interview Questions (Updated 2025)
What Do DoorDash Data Science Interviews Cover? · Probability & Statistics Questions · Python or R Programming Questions · A/B testing Questions ...
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