1. Design types for an API response that can be loading, error, or success with data.
Interview promptStrong signal
Uses discriminated union, narrows with kind/status, avoids optional chaining everywhere.
Follow-up probes
- •How would you handle pagination?
- •How does this play with React state?
Red flags
- •Uses any or unknown without narrowing.
- •Models all states with optional fields.