DoorDash VO Interview — Maximum Usable Credit | Interval Scheduling | Time Window Overlap | Sweep Line

23 Views
No Comments

Many companies provide their employees time-limited DoorDash credits as perks.
Each credit:

  • Has a time window when it can be used
  • Has a credit amount

A customer placing one order can combine multiple credits, as long as their time windows overlap with the order time.

You are given a list of credits, each represented as:

["START–END", "CREDIT"]

Your task is to determine the maximum credit amount the customer can use at any valid time, by finding the maximum sum of all credits whose intervals overlap.

Return the maximum total credit that can be applied at the same time.


Example 1

[["10:00–11:00", "5"], ["13:00–15:00", "10"]]

Output:

10

Explanation:
The intervals do not overlap.
The maximum credit available at any single time window is simply the largest one → 10.


This DoorDash VO question evaluates your ability to work with time intervals, specifically to compute the maximum overlapping credit sum.

Key skills evaluated:

✅ 1. Interval parsing & normalization

Convert "HH:MM–HH:MM" into comparable numeric values (e.g., minutes).

✅ 2. Overlap analysis using:

  • Sweep line (recommended)
    Transform each credit into two events:
    +start: add credit
    –end: remove credit
    Then sweep chronologically while tracking active credits.
  • Or interval merging + checking intersections (less efficient)

✅ 3. Handling multiple overlapping intervals

If multiple credits overlap at the same point in time, their credit values are summed.

Interviewers test your ability to:

  • Standardize time
  • Apply event-based sweep
  • Keep a running sum
  • Return the maximum possible total
  • Avoid O(n²) pairwise checking

This is a classical “maximum overlapping interval weight” problem.

Time complexity expectation: O(n log n).

The VOprep team has long accompanied candidates through various major company OAs and VOs, including Doordash, Google, Amazon, Citadel, SIG, providing real-time voice assistance, remote practice, and interview pacing reminders to help you stay smooth during critical moments. If you are preparing for Tiktok or similar engineering-focused companies, you can check out our customized support plans—from coding interviews to system design, we offer full guidance to help you succeed.

END
 0