Design a Refund Workflow as a Directed Acyclic Graph
Last updated: August 2, 2026
Quick Overview
Design a refund workflow for a food delivery service using a directed acyclic graph (DAG) structure.
DoorDash
August 2, 20266
0
50 solved
Design a refund workflow for a food delivery service using a directed acyclic graph (DAG) structure.
This question is typically asked during the onsite interview round for software engineering candidates at DoorDash to evaluate their system design skills. The interviewer is looking for the candidate's ability to conceptualize a complex workflow, understand the dependencies and states involved in a refund process, and articulate how to implement this using a DAG. Candidates are assessed on their ability to think critically about system architecture and the implications of their design choices.
What the Interviewer Expects
- Clearly define the requirements of the refund workflow.
- Illustrate the DAG structure and how different nodes represent states or actions.
- Discuss how to handle various scenarios such as partial refunds or disputes.
- Explain the trade-offs of using a DAG versus other structures.
- Address scalability and performance considerations in the design.
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How would you handle a situation where a refund request is disputed?
- What are the potential bottlenecks in your design?
- How would you ensure data consistency across the workflow?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
To design a refund workflow as a directed acyclic graph (DAG), we first need to outline the key requirements:
- Initiation of Refund: The process begins when a customer requests a refund.
- **Ap...
High-Level Design
The refund workflow can be represented as a directed acyclic graph where:
- Nodes: Each node represents a state in the refund process (e.g., Requested, Under Review, Approved, Completed).
- **Edge...