M9-029M9: Senior ML & AI System DesignLLM Serving, RAG & Agent SysDesignHard
⚡Flashcard Drill➔Mastery:
Design a Long-Horizon Checkpointed Multi-Agent DAG Orchestrator with Saga Compensation
🎯 Active Recall Self-Check (Draft First, Verify After)
Login-free practice tracker: recall core answer, audit pitfalls, and log review status.
Step 1 · Draft your concise answer & assumptions
Step 2 · Check Pitfalls & Follow-up Inquiries
📐 Mathematical Definition
⚡ One-Sentence Core Answer
Replace fragile in-memory agent loops with an event-sourced DAG engine featuring durable Postgres/WAL checkpoints, idempotency keys, and Saga rollback handlers.
📌 Key Takeaways
- •L1 Durability Problem: multi-hour DAGs with 40+ tool calls and HITL pauses cannot rely on ephemeral worker RAM
- •L2 Atomic Checkpointing: persist state transitions and tool receipts to durable WAL/Postgres after every super-step for exact resume
- •L2 Idempotency & Sagas: attach deterministic
Idempotency-Keyto external writes and register reversecompensate()handlers for partial failure rollback - •L3 Fan-Out/Fan-In Control: bound parallel subagent branches with barrier timeouts, per-branch token budgets, and DLQ replay
📐 Mathematical Derivations
Replay preserves deterministic equivalence: given event log , any step whose
IdemKey exists in ledger returns recorded output without re-executing side effects.🏭 Production Trade-offs
1) Per-step Postgres checkpointing adds ~15ms overhead, negligible next to multi-second LLM calls; 2) Restrict strict Saga compensators to external-mutation nodes.
⚠️ Common Interview Pitfalls
- ✕Using non-deterministic timestamps or random UUIDs inside replayable DAG transition logic
- ✕Storing raw multi-megabyte tool payloads inline inside state rows instead of S3/blob pointers
🎯 Interviewer Follow-up Inquiries
- ?How do you safely resume a 3-day-old paused workflow after deploying new DAG code or prompts?
- ?How do you prevent parallel fan-out subagents from clobbering shared graph state keys?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
📚