Katkat

Implement a simple service with tests

DoorDashSoftware Engineer · Onsite

Last updated

Implement a simple service with tests evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

You're given a short written specification for a small service class (no external dependencies). Implement the class using clear control flow (primarily if/else) and robust input validation. The exercise has three parts: (

  1. implement the core logic; (
  2. extend it with an additional requirement based on clarified assumptions; (
  3. write unit tests that cover happy paths, edge cases, and error handling for both parts. State all assumptions explicitly and provide method signatures and representative test cases.