← DoorDash Interview Insights

DoorDash·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
May 2026

Summary

DoorDash coding round, one algorithm question on set membership and subset checking. Not a lot of context given about the role but felt like a standard technical screen.

Questions Asked (1)

Q1

Given a list where each person has a list of favorite companies, return the indices of people whose list is not a subset of any other person's list, in increasing order.

Algorithms & Data Structures
Author's notes

The subset checking part is straightforward enough but the naive approach gets slow fast when the lists are long.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Convert each person's favorite companies list into a set for O(1) lookups, then for each person check if their set is a subset of any other person's set. If not, include their index; finally sort the indices in increasing order.

Pro tip: Mention that you can optimize by first sorting people by list size descending and only checking against larger sets, or by using bitsets if company IDs are small. This shows awareness of performance trade-offs.

1. Clarify and define subset

Confirm that 'subset' means every company in person A's list is also in person B's list, and that a person's list is not a subset of itself. Ask about input size and constraints.

2. Preprocess lists into sets

Convert each person's list of favorite companies into a hash set to allow O(1) membership checks and efficient subset operations.

3. Check subset condition for each person

For each person i, iterate over all other persons j and check if set_i is a subset of set_j. If any such j exists, person i is excluded.

4. Collect and sort indices

Add indices of people whose set is not a subset of any other to a result list, then sort the list in increasing order before returning.

5. Analyze complexity and optimize

Discuss time complexity O(n^2 * k) where k is average list size, and mention possible optimizations like sorting by size or using bitsets.

Key Points to Mention

  • Using hash sets for O(1) lookups and subset checks
  • Time complexity analysis: O(n^2 * k) worst-case, and how to optimize
  • Edge cases: empty lists, duplicate companies, single person
  • Sorting indices in increasing order as required
  • Potential optimization: sort by list size descending to reduce checks
  • Space complexity: O(n * k) for storing sets

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