Implement a simple service with tests
Company: DoorDash
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: Medium
Interview Round: Onsite
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.
Quick Answer: This question evaluates implementation skills including clear control flow, robust input validation, requirement clarification, and unit test design for a small service class.