State Machine interview questions
Practice 4 questions on state machine. Each runs in a real in-browser editor with Jest tests and a worked, diagram-backed solution.
4 questions
- MEDIUM
Circuit Breaker
PREMIUMImplement a circuit breaker that trips open after repeated failures, rejects fast while open, then probes half-open.
25 minJavaScript - MEDIUM
Tool-Call Streaming State Machine
PREMIUMTrack streaming LLM tool calls by id, accumulating argument deltas and guarding each pending, running, and done transition.
25 minJavaScript - HARD
Statechart Engine (XState-lite)
PREMIUMBuild a state-machine engine with events, guards, entry and exit actions, and context updates.
40 minJavaScript - HARD
Streaming Markdown State Machine
PREMIUMRender markdown-so-far to HTML, holding and closing unclosed bold, inline code, and fenced code blocks.
40 minJavaScript