Generics: the basics
Comes up in: Coding, Recruiter screen
This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.
What it covers
- type parameters
- inference from arguments
- constraints with
extends - default type parameters
- generic interfaces and classes
keyofconstraints (getProperty<T, K extends keyof T>)
Words you will know
What you will practise
first<T>,pluck<T,K>, typedgroupBy
Interview questions this answers
- What are generics and why use them?
- Type a generic
debounce.