A type system classifies values and governs valid operations, assignments, and relationships. In TypeScript, it supports maintainable, scalable code by catching errors early and making contracts clearer. section 3.6 section 3.7
Interview discussions commonly test whether you can:
- Explain type annotations and type inference, including when explicit annotations improve clarity. section 3.7
- Model APIs and reason about type safety, structural typing, unions, intersections, and advanced generic utilities. section 3.7
- Distinguish flexibility from safety when handling values whose types are uncertain. section 3.7
any versus unknown
any accepts assignment to any type and permits operations without checking, effectively disabling type safety. unknown accepts values of any type but requires narrowing or an assertion before operations. Prefer unknown when the value is uncertain and safety matters; use any sparingly because it can allow runtime errors. section 3.7







