Quick recap · Cheat sheet ☷ Flashcards
Quick recap

All 56 questions, one line each

Filter to one category, collapse what you already know, and print the rest. Click any question to open the full explanation.


The syntax card

BindingSyntaxDirection
Interpolation{{ value }}class → view (text only)
Property[prop]="value"class → view
Event(click)="fn()"view → class
Two-way[(ngModel)]="value"both — it's [x] + (xChange)
Lifecycle, in orderUse for
constructorInjection only — inputs are NOT set yet
ngOnChangesRuns BEFORE ngOnInit, and again on every input change
ngOnInitLoad data, subscribe — runs ONCE
ngAfterViewInit@ViewChild, DOM, chart libraries
ngOnDestroyUnsubscribe, clear timers
PipeExample
date{{ d | date:'dd/MM/yyyy' }}
currency{{ n | currency:'INR' }}
uppercase / lowercase{{ s | uppercase }}
json{{ obj | json }} — debugging
async{{ data$ | async }} — subscribes AND unsubscribes
RxJS operatorDoes
map / filter / tapTransform · drop · side effect
switchMapChain, cancelling the previous — search, route params
mergeMap / concatMap / exhaustMapAll at once · in order · ignore while busy
debounceTime + distinctUntilChangedTypeahead
forkJoinPromise.all for observables
takeUntilUnsubscribe on destroy
shareReplay(1)Share one execution — stops duplicate HTTP calls

The 12 things to be sure of

If you remember nothing else, remember these.

1Angular is a framework, React is a library — DI, routing, HTTP and RxJS come in the box.
2Constructor = injection only. Inputs aren't set yet — initialise in ngOnInit.
3ngOnChanges fires before ngOnInit, and again on every input change. ngOnInit runs once.
4*ngIf removes the element from the DOM — it isn't hidden, it's destroyed.
5trackBy is React's key. Without it a reassigned array rebuilds every row.
6providedIn: 'root' = one instance app-wide. Listing it in a component's providers quietly breaks that.
7Reactive forms for anything real. Template-driven only for a login box.
8Route params: subscribe to paramMap, don't read the snapshot — the component is reused.
9An interceptor is the one place for the auth token and global error handling. Requests are immutable — req.clone().
10Observables are lazy and cancellable. Nothing happens until you subscribe, and two subscribes = two HTTP calls.
11switchMap cancels the previous — right for search. mergeMap doesn't — wrong for search.
12OnPush needs immutable data. Push to an array and nothing renders; replace the array and it does.

Words that signal seniority

change detection · OnPush · immutable data · cold observable · lazy loading · tree-shakeable · provider scope · memory leak · debounce · cancel the previous request · feature module · measure first · trade-off

How to answer, whatever they ask

What it is → why it matters → what you'd do in practice, then tie it to something you've actually built. If you don't know, say so and say how you'd find out.