How do type and interface differ in TypeScript?
Answer out loud or in your head first, then compare.
Answer
Both let you describe the shape of an object, e.g. a user with an ID and a name. In many everyday cases either is fine. type can also directly describe a union of alternatives, e.g. 'loading' | 'success', or a primitive type. interface suits object descriptions that get extended and can take part in declaration merging.
There's no rule that one is always better. Readability and consistency in the project matter more. Neither declaration creates runtime data validation — they're for TypeScript to check the code.
Why it matters: A typical question that tests practical knowledge of TS.
Possible follow-ups: When is a plain union more convenient than an interface?
How did it go? Be honest — “Not yet” puts the question on your review list.
Related questions
- type vs interface — which to choose? — TypeScript
Further reading
- TypeScript for JavaScript Programmers(opens in a new tab)Accessed 22.10.2026. Type basics and their role while you work on code.