← DoorDash Interview Insights

DoorDash·Software Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
May 2026Remote

Summary

DoorDash system design round for a software engineer role, focused on extending an existing pay calculation system. Two parts: adding peak-hour bonus logic, then handling bad input. Pretty involved for a single session.

Questions Asked (2)

Q1

You have a Dasher pay calculator. Extend it to apply a peak-hour bonus when a delivery falls within a configured time window. How do you handle multiple overlapping windows, and what rule governs which bonus applies?

System DesignTechnical Trade-offsPricing & Monetization
Author's notes

I went with highest-bonus wins and documented it as the policy, which felt cleaner than first-match since first-match is basically arbitrary depending on list order.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: how bonuses are configured, whether they stack, and what the expected behavior is for overlapping windows. Then propose a data model and algorithm that resolves overlaps deterministically, such as selecting the highest applicable bonus or the most specific window, and discuss trade-offs like performance, maintainability, and edge cases.

Pro tip: Mention that you would make the overlap resolution rule configurable or at least clearly documented, because pricing rules often change and hardcoding a single strategy can lead to costly refactors.

1. Clarify requirements and assumptions

Ask about the bonus configuration format, whether bonuses can stack, and what the desired behavior is for overlapping windows (e.g., highest bonus, first match, sum). Confirm if windows are inclusive/exclusive and if time zones matter.

2. Design the data model

Represent each bonus window with start time, end time, bonus amount/rate, and priority. Consider storing them in a list sorted by start time or in an interval tree for efficient lookup.

3. Define the overlap resolution rule

Choose a deterministic rule: e.g., apply the bonus with the highest priority, or the one with the highest value, or the most specific (shortest) window. Document it clearly and make it configurable if possible.

4. Implement the calculation logic

Given a delivery time, find all windows containing that time, then apply the resolution rule to select the bonus. Ensure the base pay calculation remains unchanged and the bonus is added correctly.

5. Discuss trade-offs and edge cases

Talk about performance (e.g., O(n) scan vs. interval tree), handling of boundary times, overlapping windows with equal priority, and how to test the logic thoroughly.

Key Points to Mention

  • Deterministic resolution rule for overlapping windows (e.g., highest priority, highest bonus, most specific window).
  • Data structure choice: sorted list, interval tree, or sweep line for efficient overlap detection.
  • Configurability of the resolution rule to adapt to changing business needs.
  • Edge cases: boundary times (inclusive/exclusive), time zones, zero-duration windows, and equal-priority overlaps.
  • Performance considerations for large numbers of windows and high query volume.
  • Testing strategy: unit tests for overlap scenarios, property-based testing for invariants.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How would you handle invalid or malformed input in the pay calculator? Think missing fields, bad timestamps, negative values, and currency mismatches. What's your policy: reject, fall back, or compute partial pay?

System DesignAPI & IntegrationsTechnical Trade-offs
Author's notes

This is where I actually felt more comfortable.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the business context and requirements: pay accuracy is critical, so invalid input must be handled carefully to avoid incorrect payments. Then propose a tiered validation strategy that rejects clearly invalid inputs, falls back to safe defaults where appropriate, and computes partial pay only when the missing data doesn't affect the core calculation. Emphasize logging, monitoring, and user feedback to handle edge cases gracefully.

Pro tip: Frame your answer around the principle of 'fail fast, but fail safe'—reject invalid inputs early with clear error messages, but design fallbacks for non-critical fields to avoid blocking payments. Also, mention that you'd collaborate with product and legal to define the policy, since pay calculations have compliance implications.

1. Clarify requirements and constraints

Ask about the business impact of incorrect pay, regulatory requirements, and whether partial pay is acceptable. Understand the data sources and typical failure modes.

2. Define validation rules and error categories

Classify inputs as critical (e.g., pay rate, hours) vs. non-critical (e.g., optional modifiers). Specify validation for each field: type, range, format, and cross-field consistency.

3. Choose handling strategy per category

For critical invalid inputs, reject with a clear error. For non-critical, use safe defaults or omit. For partial data, compute pay only if the missing fields don't affect the core calculation; otherwise, flag for manual review.

4. Implement logging, monitoring, and alerts

Log all validation failures with context, monitor rates of invalid inputs, and alert on spikes. This helps identify upstream issues and improve data quality.

5. Provide clear feedback and recovery paths

Return descriptive error messages to the caller, and where possible, suggest corrections. For partial pay, indicate what was missing and how to resolve it.

Key Points to Mention

  • Input validation techniques: schema validation, type checking, range checks, and cross-field validation (e.g., timestamps within pay period).
  • Error handling patterns: fail-fast vs. fallback, and the importance of idempotency and atomicity in payment systems.
  • Business and compliance considerations: pay accuracy, audit trails, and legal requirements for minimum wage and overtime.
  • Observability: logging, metrics, and alerting for invalid inputs to detect and fix upstream data issues.
  • User experience: clear error messages and self-service correction where possible to reduce support burden.
  • Trade-offs: rejecting vs. partial pay—rejecting may delay payments but ensures accuracy; partial pay may be acceptable for non-critical fields but requires clear communication.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.