Prepare a Random Courier Selection Service for Production

Quick Overview

Prepare random courier selection for production with clear fairness rules, atomic assignment, changing eligibility, deterministic tests, and operational metrics.

Prepare a Random Courier Selection Service for Production

Company: DoorDash

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Onsite

A service selects a random courier from an eligible set. After fixing a local bug, what would you check before productionizing the feature? Address selection behavior, changing eligibility, concurrency, and failure handling without assuming the unavailable original bug implementation. ### Clarifying Questions to Ask - Should every eligible courier be equally likely, or are weights intended? - Is selection advisory, or does it atomically reserve a courier? - What should happen when the eligible set is empty or changes during selection? ```hint Separate selection from assignment A randomly chosen eligible courier may no longer be available when the assignment is committed. ``` ### What a Strong Answer Covers - A defined random-selection contract and boundary tests. - Snapshot or transactional handling of concurrent eligibility changes. - Observability, reproducible tests, and graceful empty-set behavior. ### Follow-up Questions - How would you test fairness without expecting identical random output every run? - When would deterministic key-to-courier routing be preferable to fresh random selection?

Overview: Prepare random courier selection for production with clear fairness rules, atomic assignment, changing eligibility, deterministic tests, and operational metrics.

Read the full DoorDash Software Engineer interview experience this question came from

DoorDash logo
DoorDash
Nov 15, 2026
mediumSoftware EngineerOnsiteSoftware Engineering Fundamentals
0
0

A service selects a random courier from an eligible set. After fixing a local bug, what would you check before productionizing the feature? Address selection behavior, changing eligibility, concurrency, and failure handling without assuming the unavailable original bug implementation.

Clarifying Questions to Ask Guidance

  • Should every eligible courier be equally likely, or are weights intended?
  • Is selection advisory, or does it atomically reserve a courier?
  • What should happen when the eligible set is empty or changes during selection?

What a Strong Answer Covers Guidance

  • A defined random-selection contract and boundary tests.
  • Snapshot or transactional handling of concurrent eligibility changes.
  • Observability, reproducible tests, and graceful empty-set behavior.

Follow-up Questions Guidance

  • How would you test fairness without expecting identical random output every run?
  • When would deterministic key-to-courier routing be preferable to fresh random selection?