DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
AI for Frontend Developers Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
hard
AI for Frontend Developers
What is the benefit of modeling chat turn state as a discriminated union (pending | streaming | tool_call | done | stopped) rather than several independent boolean flags?
A
It has no real benefit, both are equivalent
B
It guarantees only one valid, well-defined state exists at a time, instead of independent booleans that could drift into inconsistent combinations
C
It makes the API calls faster
D
It's required by TypeScript's type system
Check Answer