foundation
Basic TypeScript types
Type aliases, interfaces, unions, intersections, literals, optional fields, and readonly fields.
Before advanced generics, interviewers check whether you can choose the right shape primitive: `type` alias versus `interface`, unions for alternatives, intersections for combined requirements, literals for finite domains, and optional or readonly modifiers for partial or immutable contracts.
These tools appear everywhere in API DTOs, React props, configuration objects, and domain models. The design question is not memorizing syntax but matching the type shape to how data is created, consumed, and extended.
On interviews: compare `type` and `interface` pragmatically, explain when unions beat many optional fields, and mention shallow `readonly`.
Checklist:
- Pick child topics for aliases, unions, and modifiers.
- Explain extension and merging trade-offs.
- Connect shapes to API and UI contracts.