HomeInterview QuestionsHow would you design the system to handle a human-…

How would you design the system to handle a human-in-the-loop step, such as manager approval for a high-value return, without wasting resources?

🟡 Medium Conceptual Mid level
1Times asked
Aug 2026Last seen
Aug 2026First seen

💡 Model Answer

A robust design separates the automated workflow from the human approval step. 1) State machine with a pause state – when a high-value return is detected, the job transitions to a ‘PendingApproval’ state and is persisted. 2) Event-driven approval queue – the job is published to a dedicated approval topic (e.g., Kafka). 3) Approval microservice – a lightweight service consumes the event, sends a notification to the manager, and waits for a callback. 4) Idempotent resume – once approval is granted, the service publishes a ‘Approved’ event that the state machine consumes to resume processing. 5) Resource isolation – the worker pool for the approval queue is separate and scaled independently, preventing idle workers from consuming CPU. 6) Timeout and escalation – if no approval arrives within a configured window, the system escalates or auto-approves based on policy, ensuring no job stalls indefinitely. 7) Audit trail – all state transitions and approvals are logged for compliance. This architecture keeps compute resources free while awaiting human input and guarantees that the system can scale horizontally for both automated and approval workloads.

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

🎤 Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.

Get Assisting AI — Starts at ₹500