TypeScript
/Advanced
Type Debugging Scenarios
Definition
Interview questions where the candidate is presented with a block of broken TypeScript code containing complex compiler errors, and must debug and fix the type logic.
Explain Like I'm New
The interviewer shares their screen showing a terrifying red underline in VS Code that says: 'Type X is not assignable to type Y. Property Z is missing...'. You have to explain WHY the compiler is angry, and how to appease it.
Real World Example
Fixing the 'Object is of type unknown' error in a `catch(error)` block in modern TypeScript.
Common Use Cases
- •Evaluating real-world TS experience
- •Pair programming interviews
Interactive Example
Loading Code Playground...
Interview Questions
basic
- Why does `catch (error)` throw an 'Object is of type unknown' error?
intermediate
- Why does `Object.keys(user).map(k => user[k])` throw an implicit any error?
advanced
- How do you debug an 'Excess Property Checking' failure on a passed variable?