Skip to content

Typescript Generics Patterns And Constraints Practice Exam

Test yourself under real exam conditions: 50 timed questions, 60 on the clock, pass mark 70%%. Instant score with a full review of everything you got wrong. Free — no account needed.

📝 50 questions · ⏱ 60 minutes · 🎯 Pass mark 70% · 🆓 Free, no signup

Exam details

  • 50 questions drawn from 241 cards
  • Countdown timer — auto-submits when time runs out
  • Pass mark 70% (real certification threshold)
  • Full review of wrong answers at the end
  • No signup required — save your score with a free account

Sample Questions

5 shown

Basic generic function signature?

Show ▼

function identity<T>(x: T): T { return x; }

Constrain a generic to be an object with a 'length'?

Show ▼

function len<T extends { length: number }>(x: T) { return x.length; }

Why does T extends string matter?

Show ▼

Restricts T to string-assignable types — required when you use string-specific operations or template literal types.

Pass type arguments explicitly?

Show ▼

identity<number>(42) — usually inferred.

Default type parameter?

Show ▼

function pick<T, K extends keyof T = keyof T>(...) — K defaults to keyof T.

🎯 Take the Typescript Generics Patterns And Constraints Practice Exam