PhonePe calls its LLD round machine coding — you build a real, working class design in 90–120 minutes, then defend it in a follow-up review focused on concurrency, thread safety, and how cleanly the design could be extended without a rewrite.
Design a workflow execution engine, similar in spirit to Apache Airflow, that runs a workflow defined as a directed acyclic graph (DAG) of tasks. Independent tasks should execute concurrently, failed tasks should retry automatically, and the engine should never re-run a task that already completed successfully before a crash.
- Clarify what a 'task' and a 'workflow' are before writing any class — is a task guaranteed idempotent by contract, or must the engine enforce that itself?
- Think through how the scheduler decides which tasks are ready to run given partially-completed dependencies in the DAG.
- Be ready to explain how retries interact with idempotency, and how execution state survives a scheduler crash mid-run.
More machine coding prompts PhonePe has asked recently
The class design, entity list, design-pattern reasoning and follow-up discussion for these — plus the full worked solution above — are part of the Placement-Ready PYQ Kit.
1 more machine coding prompts with full class designs in the full Placement-Ready PYQ Kit

