Academy
The explanations behind the exercises.
One concept per page, written to be read once and understood —
then three exercises that make you use it.
- 01Closures in JavaScriptWhat a closure is, why the variable outlives the function that created it, and the loop bug every JavaScript developer hits once.javascript closuresclosure example
- 02The JavaScript event loopHow one thread runs everything: the call stack, the microtask queue, timers, and why a promise always resolves before a setTimeout of 0.javascript event loopmicrotask vs macrotask
- 03Promise.all, allSettled, race and anyThe four ways to combine promises, what each one does with a rejection, and how to pick the right one without guessing.promise.all vs allsettledpromise.race vs any
- 04How this is decided at call timeThe four rules that fix the value of this at call time, why extracting a method breaks it, and what arrow functions actually change.javascript this keywordthis binding rules
- 05Prototypes and the prototype chainHow property lookup really works, what class is syntax for, and the difference between prototype and __proto__ that trips everyone up.javascript prototype chainprototypal inheritance
- 06Hoisting and the temporal dead zoneWhat is really moved to the top of a scope, why let and const are hoisted too, and the difference between undefined and a ReferenceError.javascript hoistingtemporal dead zone
- 07Equality: ==, === and Object.isWhat loose equality really does, the two cases where === is not what you want, and why comparing objects almost never means what people expect.javascript == vs ===object.is
- 08Shallow copy vs deep copyWhy spreading an object still shares its nested values, what structuredClone fixes, and what JSON round-tripping quietly destroys.javascript deep copyshallow copy vs deep copy
- 09Debounce vs throttleTwo ways to fire less often, and the one question that tells you which you need — do you want the last call, or a steady rate?debounce vs throttlejavascript debounce
- 10Iterators and generatorsThe protocol behind for...of and spread, how a generator writes one for you, and why a paused function is the point.javascript generatorsiterator protocol
- 11Type aliases vs interfacesWhat the two actually differ on — declaration merging, unions, and the error messages you get back — and the rule that settles it in a real codebase.type vs interfaceinterface extends
- 12Where any, unknown and never belongThe three types that are not about your data: one switches the compiler off, one makes you prove things, and one means this cannot happen.any vs unknownunknown type
- 13Structural typing: shapes, not namesTypeScript compares shapes, not names. That is why an unrelated object type-checks, why excess properties sometimes error, and how to make a type nothing else can satisfy.structural typingduck typing
- 14Narrowing: how a union becomes one typeThe checks TypeScript understands — typeof, instanceof, in, truthiness, discriminants — and what makes a narrowing silently fall apart again.type narrowingtype guard
- 15Literal types, unions and as constWhy a string in a variable stops being a literal, what as const freezes, and why a union of strings beats an enum almost every time.literal typesas const
- 16Generics: a type the caller fills inWhat a type parameter actually does, why extends means constrain rather than inherit, and the rule that tells you when a generic is earning its keep.typescript genericsgeneric constraint
- 17Deriving types with keyof and typeofThe three operators that read types out of things you already wrote, so a type never has to be maintained next to the value it describes.keyoftypeof operator
- 18Partial, Pick, Omit and the restPartial, Pick, Omit, Record, Required, Readonly and the rest — what each one is for, which one is unsafe, and how to stop re-declaring the same shape.utility typesPartial Pick Omit
- 19Mapped and conditional typesHow to write the utility types you have been importing: looping over keys, branching on a type, and pulling a type back out with infer.mapped typesconditional types
- 20Type assertions: as vs satisfiesWhat a type assertion actually does to your program, the two places it is defensible, and why satisfies gives you the check without losing the type.type assertionsatisfies operator
- 21List Comprehensions in PythonHow a comprehension differs from a for-loop under the hood, when it trades readability for cleverness, and how the dict and set forms follow the same rule.python list comprehension
- 22Decorators in PythonWhat @decorator actually rewrites, why forgetting functools.wraps breaks introspection, and how a decorator that takes arguments needs a third level of nesting.python decoratorsfunctools wraps
- 23Generators and Iterators in PythonThe iterator protocol every for-loop relies on, what yield actually suspends, and why a generator can process a file too large to fit in memory.python generatorsyield keyword
- 24Args and kwargs in PythonHow the star and double-star collectors turn extra positional and keyword arguments into a tuple and a dict, and where positional-only and keyword-only parameters fit.python args kwargsstar args double star kwargs
- 25Mutable Default ArgumentsWhy a default value written as a list or dict is created once, shared across every call, and the None-then-create idiom that every codebase uses to avoid it.python mutable default argumentdef f(items=[])
- 26Context Managers in PythonWhat with is really calling, why __exit__ runs even when the block raises, and how @contextmanager turns a generator into one without writing a class.python with statementcontext manager protocol
- 27Exceptions and Error Handling in PythonWhat each clause of try/except/else/finally actually guarantees, how raise from chains a new exception to its cause, and why a bare except is almost always wrong.python try except finally
- 28OOP and Dunder Methods in PythonHow __init__, __repr__ and __eq__ hook a class into built-in operators, why super() matters in a diamond hierarchy, and when composition beats inheritance.python dunder methods__init__ vs __new__
- 29The GIL and Concurrency in PythonWhy threading does not speed up CPU-bound Python code, what the GIL actually serialises, and when to reach for multiprocessing or asyncio instead.python GILthreading vs multiprocessing
- 30Slicing and Mutability in PythonHow start:stop:step slicing works on any sequence, why a slice always copies while an index into a list of lists does not, and where is diverges from ==.python slicingshallow vs deep copy
- 31JOINs, and the rows you did not expectWhat a join really computes, the difference INNER and LEFT actually make, and why filtering a LEFT JOIN in the WHERE clause silently turns it back into an INNER one.sql joinleft join vs inner join
- 32GROUP BY and HAVINGThe order the clauses actually run in, why WHERE and HAVING are not interchangeable, and what COUNT(*) counts that COUNT(column) does not.group byhaving vs where
- 33NULL, and the rows it quietly dropsWhy NULL = NULL is not true, which operators quietly swallow rows because of it, and the handful of functions that give you an answer back.sql nullis null
- 34Subqueries: IN, EXISTS and correlatedThe three places a subquery can sit, what makes one correlated, and why EXISTS is the safe default where IN has a NULL problem.sql subqueryexists vs in
- 35Window functions: keeping every rowHow OVER keeps your rows while still computing across them, what PARTITION BY and ORDER BY each change, and the frame clause that decides a running total.window functionsover partition by
- 36CTEs and recursive queriesWhat WITH buys beyond readability, whether a CTE is a fence the planner will not cross, and how a recursive one walks a tree without a loop in application code.sql ctewith recursive
- 37Indexes: what a B-tree cannot doWhy column order in a composite index decides which queries it serves, what makes a condition unindexable, and the reason an index sometimes makes things slower.sql indexcomposite index column order
- 38Transactions and isolation levelsWhat ACID actually promises, which anomalies each isolation level still allows, and why the read-then-write you wrote is a race unless you said otherwise.acid transactionsisolation levels
- 39JSON in a relational databaseReading a field out of a JSON column, turning an array into rows, and the question worth asking first — whether this should have been a column.sql jsonjsonb
- 40DISTINCT, UNION and set operationsWhat deduplication actually costs, the difference between UNION and UNION ALL, and why DISTINCT in a query is often a join that went wrong.union vs union allselect distinct
- 41JSX and the Virtual DOMJSX is sugar for function calls that build plain objects, not templating — and that object tree is the whole reason React can be fast.jsxvirtual dom
- 42Reconciliation and Why Keys MatterThe heuristic React uses to decide what to reuse and what to rebuild, and why the wrong key silently attaches state to the wrong row.react reconciliationreact keys
- 43Controlled vs Uncontrolled ComponentsWhether React state or the DOM itself owns an input value — and the one mistake that flips a field between the two mid-render.controlled component react
- 44Refs and Imperative DOM AccessuseRef is a mutable box that survives re-renders without causing them — the escape hatch for the DOM and for values that are not part of render.react userefreact refs
- 45How useState Batches and UpdatesWhy the value you read right after calling a setter is still stale, when the updater-function form is required, and how React batches several setState calls into one render.react usestateusestate batching
- 46Choosing Between useReducer and useStateuseReducer is useState generalized: a pure reducer plus dispatch instead of a raw setter, and when that trade is worth making.usereducer vs usestatereact usereducer
- 47Lifting State Up and Prop DrillingWhy two components that need to stay in sync must share state owned by their closest common ancestor, and when passing that state down several layers becomes a real problem.lifting state upreact prop drilling
- 48React Context and When to Use ItContext skips prop drilling for broadly needed values, but every consumer re-renders on any change to it — the cost most people miss until it shows up in a profiler.react contextusecontext
- 49Dependencies and Cleanup in useEffectAn Effect synchronizes with something outside React. The dependency array says what it reads, not when to run — get that backwards and you get stale values.useeffect dependenciesuseeffect cleanup
- 50What useMemo and useCallback MemoizeuseMemo caches a value, useCallback caches a function reference — the same mechanism underneath, aimed at two different bugs.usememo vs usecallbackreact memoization
- 51React.memo and Unnecessary Re-rendersA component re-renders whenever its parent does, props unchanged or not — usually fine, and React.memo is the opt-out for when it measurably is not.react memounnecessary re-renders
- 52Writing Custom HooksA custom hook is a plain function that calls other hooks. It shares logic, not state — two components using it get two independent copies.react custom hooksrules of hooks
- 53Error BoundariesWhy a render error unmounts the whole tree by default, how a class component catches it, and what it never catches at all.react error boundarycomponentDidCatch
- 54Portals and Rendering Outside the TreeHow createPortal splits DOM position from React-tree position, why modals need it, and where events actually bubble.react portalcreatePortal
- 55Compound ComponentsHow Context replaces a giant prop API with a group of components that implicitly share state through composition.react compound componentsselect option pattern
- 56Render Props vs Higher-Order ComponentsThe two pre-hooks patterns for sharing behavior between components, their well-known pitfalls, and why a hook replaces both.higher order componentrender props pattern
- 57Template Syntax: Interpolation and BindingsWhat {{ }} can and cannot render, why every dynamic attribute needs v-bind, and how :class and :style differ from a plain HTML string.vue template syntaxvue interpolation
- 58Conditional Rendering and v-for Listsv-if versus v-show is a cost trade-off, not a style choice, and v-for needs a stable :key for the same reason React needs one on map().vue v-if vs v-showvue v-for key
- 59Event Handling: v-on and ModifiersPassing a handler versus calling it in the template is the same pitfall React has with onClick, and modifiers replace the boilerplate everyone hand-writes for it.vue v-onvue event modifiers
- 60Ref vs Reactive: Vue's State Primitivesref wraps any value behind a .value getter/setter; reactive proxies an object directly. The trade-offs explain why most Vue code reaches for ref by default.vue ref vs reactive
- 61Computed Properties: Cached, Derived StateA computed only recalculates when a dependency it read actually changes — the caching a plain method call can never give you.vue computed propertiesvue computed vs method
- 62Form Input Bindings: v-model in Depthv-model.trim, .number and .lazy fix the three most common form bugs, and a checkbox group binds to a shared array with no extra code.vue v-model modifiersvue form input bindings
- 63Watchers: watch() and watchEffect()watch() reacts to sources you name explicitly; watchEffect() auto-tracks whatever it reads — the same trade computed vs method makes, one level up.vue watch vs watcheffectvue watch source
- 64Template Refs: Reaching the Real DOMA template ref is null until onMounted — the component has to exist in the DOM before anything can point at it.vue template refsvue ref dom element
- 65Props & Component EventsProps flow down, events flow up — and the object syntax for both is what actually gives you defaults, validation and v-model.vue propsvue defineEmits
- 66Slots: Passing Templates, Not Just ValuesA slot is a function a parent hands its child — calling it renders the parent's markup, and calling it with data makes that markup scoped.vue slotsvue named slots
- 67Provide / Inject: Skipping the Prop Chainprovide() and inject() pass data straight to any descendant, no matter how deep — but only stay reactive when what you provide is itself reactive.vue provide injectvue injection key
- 68Fallthrough AttributesAn attribute a parent passes but the child never declares as a prop lands on the root element automatically — unless there is more than one root.vue fallthrough attributesvue $attrs
- 69Lifecycle HooksEvery lifecycle hook that sets something up has a matching one that tears it down — onMounted without onUnmounted is a leak waiting to happen.vue lifecycle hooksvue onMounted
- 70Custom DirectivesA directive is the same mounted/unmounted lifecycle a component has, applied to a raw DOM element instead of a component instance.vue custom directivesvue directive hooks
- 71Vue with TypeScript: Props & EmitsA discriminated union prop or a typed emits object only pays off once the component actually branches and matches on it.vue typescript propsvue defineProps generic
- 72Vue with TypeScript: Generics & Type GuardsA generic <T> only constrains what a function accepts — a type guard is the one construct that actually checks a value's shape at runtime.vue typescript genericsvue type guards
- 73Teleport & SuspenseTeleport moves a component's DOM without moving its logical position; Suspense gives an async component a fallback while it loads.vue teleportvue suspense
- 74Performance Patterns: KeepAlive & v-memoKeepAlive caches a component instance instead of destroying it; v-memo skips a re-render entirely when nothing it depends on changed.vue keepalivevue v-memo
- 75Compound ComponentsTabs, Tab and TabPanel coordinate through one shared provide/inject context — each part only has to talk to that context, never to its siblings.vue compound componentsvue tabs pattern
- 76Composables: Reusable Stateful LogicA composable is a plain function using ref, computed and watch — Vue's answer to a custom React hook, without the rules-of-hooks constraints.vue composablesvue use function
- 77Pinia: State Management for Vue AppsA Pinia store is a composable with a fixed shape — state, getters and actions — and understanding it as one demystifies most of what it does.pinia vuepinia vs vuex
- 78Interpolation and Property Binding{{ }} renders text; [prop] sets a DOM property directly. The same distinction as textContent vs. a property assignment, and it decides which one a template needs.angular interpolationangular property binding
- 79Control Flow: @if and @forAngular 17+ replaced *ngIf and *ngFor with built-in @if and @for blocks — faster, stricter about tracking, and no CommonModule import required.angular @ifangular @for
- 80Event Binding and Custom Outputs(event)="handler($event)" binds a native DOM event; @Output() lets a component emit its own, typed the same way any other value in the app is typed.angular event bindingangular $event
- 81Signals: signal(), computed() and effect()signal() holds a value behind a getter/setter pair; computed() derives from it lazily; effect() reacts to it. Angular's answer to Vue's ref or a React hook.angular signalsangular signal()
- 82Two-Way Binding and Reactive Forms[(ngModel)] is sugar over a property and event bound together; reactive forms trade that convenience for FormControl, validators and explicit state.angular ngmodelangular two-way binding
- 83Template Refs, ViewChild and Outlets#ref names an element for the template; @ViewChild reaches the same element from the class. ng-template and ngTemplateOutlet turn a template into a value.angular template reference variable
- 84Input, Output and Content Projection@Input()/@Output() pass data down and events up between components; <ng-content> lets a parent's markup render inside a child it doesn't control.angular input outputangular ng-content
- 85Dependency Injection and Injection Tokensinject() asks Angular's container for a shared instance instead of constructing one privately. InjectionToken<T> does the same for values that aren't classes.angular dependency injectionangular inject()
- 86Attribute Fallthrough and ngOnChangesA class or attribute a caller puts on a component's host element falls through by default; @HostBinding sets one from inside. ngOnChanges reports what changed.angular host binding
- 87Lifecycle Hooks and Custom DirectivesngOnInit is where setup belongs, ngOnDestroy where it gets torn down; a custom attribute directive follows the same discipline for its own listeners.angular ngoninitangular ngondestroy
- 88Services and Async State with SignalsA service is Angular's unit of shared, reusable logic — its composable — and signal() is how it holds async state a component can read reactively.angular servicesangular async signal
- 89Derived State and Strongly-Typed Inputscomputed() replaces a hand-managed boolean that tracks the same thing state already implies; a discriminated-union @Input() lets the compiler enforce every branch.angular computed derived state
- 90Generic Pipes and Type GuardsA pipe that stays generic over its input works for any array shape; a runtime type guard is the only thing standing between an untyped API response and a crash.angular generic pipeangular pure pipe
- 91OnPush Change Detection and model()OnPush skips a subtree until an @Input() reference actually changes; model() gives a component a two-way custom binding without a separate @Output() wiring.angular onpushangular change detection strategy
- 92Compound Components and Dynamic OutletsA compound component's parts coordinate through a shared, injected service instead of local state; NgComponentOutlet renders whichever component a mapping picks at runtime.angular compound component
- 93Linked lists, singly and doublyWhy a linked list trades O(1) lookup for O(1) insertion, the sentinel, reversal and cycle-detection patterns interviewers ask for, and when it actually beats an array.linked list interview questions
- 94Stacks and queues, LIFO and FIFOTwo disciplines built on the same array, why the call stack and the event queue are named what they are, and the monotonic-stack and two-stack patterns.stack vs queuebalanced brackets algorithm
- 95Hash tables: hashing and collisionsHow a key becomes an array index, why collisions are the design, the counting and grouping patterns behind half of all interview questions, and what Map and dict do.hash table implementation
- 96Trees, tries, and traversal orderA hierarchy instead of a chain, the four traversal orders and when each applies, how a binary search tree stays fast, and the tree keyed by character.binary search tree explained
- 97Heaps and priority queuesA tree that lives in a flat array, the one invariant that makes "give me the smallest" an O(log n) operation, and why sorting everything is the wrong tool for "top k".min heap implementationpriority queue javascript
- 98Graphs: BFS, DFS and topological sortNodes and edges instead of a fixed shape: BFS for shortest paths, DFS to flood a grid, topological sort for dependencies, and union-find for connectivity.graph bfs shortest pathunion find disjoint set
- 99Singleton patternThe guarantee that exactly one instance can exist, where it earns its place (database pools, caches, config), the global state it costs, and why it breaks on serverless.singleton pattern interview question
- 100Factory Method patternHiding which concrete class gets built behind one function, the indirection it costs when the choice might never grow, and the leak when a return type still names the class.factory method pattern explained
- 101Abstract Factory patternGuaranteeing a whole family of related objects ships together, the extra interface every product carries, and the mismatch when a factory returns the wrong family.abstract factory pattern explained
- 102Builder patternReplacing a constructor drowning in optional parameters, the extra code it costs for objects simple enough not to need it, and build() handing back the same object twice.builder pattern explained
- 103Prototype patternCloning a configured instance instead of rebuilding from scratch, the per-field copy it costs, nested fields included, and a shallow clone() copying a reference, not a value.prototype pattern cloning
- 104Adapter patternTranslating an interface you cannot change into the one callers expect, the extra hop every call pays, and the moment it adds behavior and becomes a Decorator.adapter pattern explained
- 105Decorator patternStacking behavior onto one object at a time without subclassing, the layers it costs to read through when debugging, and the fixed wrap order every decorator must respect.decorator pattern explained
- 106Facade patternHiding a multi-step subsystem behind one simple call, the second thing to maintain the facade can become, and the wall it becomes once it is the only way in.facade pattern explained
- 107Proxy patternControlling access to, or deferring the cost of, an object behind its own interface, the extra hop easy to forget, and the moment it carries logic and becomes a Decorator.proxy pattern explained
- 108Bridge patternLetting two dimensions of variation grow independently instead of multiplying into N times M classes, the two hierarchies it costs, and the if/else sneaking that growth back.bridge pattern vs adapter
- 109Composite patternTreating a single object and a group of them through one interface, the cost every leaf pays for methods it may never use, and a leaf that accepts children it cannot hold.composite pattern tree structure
- 110Flyweight patternSharing the identical, expensive part of many objects instead of duplicating it, the strict immutability it demands, and one write to shared state corrupting every instance.flyweight pattern memory sharing
- 111Strategy patternSwapping an algorithm without touching the class that uses it, the interface every strategy must implement even for a one-off, and reaching for it before a second case exists.strategy pattern interview question
- 112State patternLetting an object swap what it can do next, decided from inside itself, the state class and transition table it costs, and two states that disagree who owns a transition.state pattern vs strategy pattern
- 113Template Method patternFixing the step order of an algorithm in a base class while subclasses fill in the rest, the subclassing it costs to change one step, and a base class open to rewrites.template method pattern explained
- 114Observer patternNotifying many listeners without the subject knowing who they are, the leak a forgotten unsubscribe causes silently, and why every event system pairs subscribe with teardown.observer pattern explained
- 115Mediator patternRouting communication between many objects through one hub, the god object the hub itself can become, and the temptation to route every interaction through it "to be safe."mediator pattern chat room
- 116Chain of Responsibility patternTrying handlers one at a time until one accepts the request, the dead end when a request reaches the last link unhandled, and why every chain needs a terminal case.chain of responsibility pattern
- 117Command patternTurning "do this" into an object that can be queued, logged or undone, the class every action now needs, and a command that reaches into global state instead of its own.command pattern javascript
- 118Memento patternTurning "go back to this" into an object kept separate from undo logic, the snapshot cost that grows with saved state, and a setter turning a saved state into a mutable copy.memento pattern undomemento pattern explained
- 119Iterator patternWalking a collection without exposing how it is stored, the extra object between caller and data it costs, and the wrong answer when next() runs past the end or data mutates.iterator pattern explained
- 120Visitor patternAdding a new operation to a fixed set of classes without editing them, the every-visitor update a new node type costs, and why it fails once classes change more than the ops.visitor pattern explained
- 121Interpreter patternEvaluating a small tree of grammar rules one node at a time, the class per rule that costs fast past a toy language, and the point a real parser beats one more class.interpreter pattern explained
JavaScript
10 pages
- 01Closures in JavaScriptStartWhat a closure is, why the variable outlives the function that created it, and the loop bug every JavaScript developer hits once.
- 02The JavaScript event loopHow one thread runs everything: the call stack, the microtask queue, timers, and why a promise always resolves before a setTimeout of 0.
- 03Promise.all, allSettled, race and anyThe four ways to combine promises, what each one does with a rejection, and how to pick the right one without guessing.
- 04How this is decided at call timeThe four rules that fix the value of this at call time, why extracting a method breaks it, and what arrow functions actually change.
- 05Prototypes and the prototype chainHow property lookup really works, what class is syntax for, and the difference between prototype and __proto__ that trips everyone up.
- 06Hoisting and the temporal dead zoneWhat is really moved to the top of a scope, why let and const are hoisted too, and the difference between undefined and a ReferenceError.
TypeScript
10 pages
- 01Type aliases vs interfacesStartWhat the two actually differ on — declaration merging, unions, and the error messages you get back — and the rule that settles it in a real codebase.
- 02Where any, unknown and never belongThe three types that are not about your data: one switches the compiler off, one makes you prove things, and one means this cannot happen.
- 03Structural typing: shapes, not namesTypeScript compares shapes, not names. That is why an unrelated object type-checks, why excess properties sometimes error, and how to make a type nothing else can satisfy.
- 04Narrowing: how a union becomes one typeThe checks TypeScript understands — typeof, instanceof, in, truthiness, discriminants — and what makes a narrowing silently fall apart again.
- 05Literal types, unions and as constWhy a string in a variable stops being a literal, what as const freezes, and why a union of strings beats an enum almost every time.
- 06Generics: a type the caller fills inWhat a type parameter actually does, why extends means constrain rather than inherit, and the rule that tells you when a generic is earning its keep.
Python
10 pages
- 01List Comprehensions in PythonStartHow a comprehension differs from a for-loop under the hood, when it trades readability for cleverness, and how the dict and set forms follow the same rule.
- 02Decorators in PythonWhat @decorator actually rewrites, why forgetting functools.wraps breaks introspection, and how a decorator that takes arguments needs a third level of nesting.
- 03Generators and Iterators in PythonThe iterator protocol every for-loop relies on, what yield actually suspends, and why a generator can process a file too large to fit in memory.
- 04Args and kwargs in PythonHow the star and double-star collectors turn extra positional and keyword arguments into a tuple and a dict, and where positional-only and keyword-only parameters fit.
- 05Mutable Default ArgumentsWhy a default value written as a list or dict is created once, shared across every call, and the None-then-create idiom that every codebase uses to avoid it.
- 06Context Managers in PythonWhat with is really calling, why __exit__ runs even when the block raises, and how @contextmanager turns a generator into one without writing a class.
SQL
10 pages
- 01JOINs, and the rows you did not expectStartWhat a join really computes, the difference INNER and LEFT actually make, and why filtering a LEFT JOIN in the WHERE clause silently turns it back into an INNER one.
- 02GROUP BY and HAVINGThe order the clauses actually run in, why WHERE and HAVING are not interchangeable, and what COUNT(*) counts that COUNT(column) does not.
- 03NULL, and the rows it quietly dropsWhy NULL = NULL is not true, which operators quietly swallow rows because of it, and the handful of functions that give you an answer back.
- 04Subqueries: IN, EXISTS and correlatedThe three places a subquery can sit, what makes one correlated, and why EXISTS is the safe default where IN has a NULL problem.
- 05Window functions: keeping every rowHow OVER keeps your rows while still computing across them, what PARTITION BY and ORDER BY each change, and the frame clause that decides a running total.
- 06CTEs and recursive queriesWhat WITH buys beyond readability, whether a CTE is a fence the planner will not cross, and how a recursive one walks a tree without a loop in application code.
React
16 pages
- 01JSX and the Virtual DOMStartJSX is sugar for function calls that build plain objects, not templating — and that object tree is the whole reason React can be fast.
- 02Reconciliation and Why Keys MatterThe heuristic React uses to decide what to reuse and what to rebuild, and why the wrong key silently attaches state to the wrong row.
- 03Controlled vs Uncontrolled ComponentsWhether React state or the DOM itself owns an input value — and the one mistake that flips a field between the two mid-render.
- 04Refs and Imperative DOM AccessuseRef is a mutable box that survives re-renders without causing them — the escape hatch for the DOM and for values that are not part of render.
- 05How useState Batches and UpdatesWhy the value you read right after calling a setter is still stale, when the updater-function form is required, and how React batches several setState calls into one render.
- 06Choosing Between useReducer and useStateuseReducer is useState generalized: a pure reducer plus dispatch instead of a raw setter, and when that trade is worth making.
Vue
21 pages
- 01Template Syntax: Interpolation and BindingsStartWhat {{ }} can and cannot render, why every dynamic attribute needs v-bind, and how :class and :style differ from a plain HTML string.
- 02Conditional Rendering and v-for Listsv-if versus v-show is a cost trade-off, not a style choice, and v-for needs a stable :key for the same reason React needs one on map().
- 03Event Handling: v-on and ModifiersPassing a handler versus calling it in the template is the same pitfall React has with onClick, and modifiers replace the boilerplate everyone hand-writes for it.
- 04Ref vs Reactive: Vue's State Primitivesref wraps any value behind a .value getter/setter; reactive proxies an object directly. The trade-offs explain why most Vue code reaches for ref by default.
- 05Computed Properties: Cached, Derived StateA computed only recalculates when a dependency it read actually changes — the caching a plain method call can never give you.
- 06Form Input Bindings: v-model in Depthv-model.trim, .number and .lazy fix the three most common form bugs, and a checkbox group binds to a shared array with no extra code.
Angular
15 pages
- 01Interpolation and Property BindingStart{{ }} renders text; [prop] sets a DOM property directly. The same distinction as textContent vs. a property assignment, and it decides which one a template needs.
- 02Control Flow: @if and @forAngular 17+ replaced *ngIf and *ngFor with built-in @if and @for blocks — faster, stricter about tracking, and no CommonModule import required.
- 03Event Binding and Custom Outputs(event)="handler($event)" binds a native DOM event; @Output() lets a component emit its own, typed the same way any other value in the app is typed.
- 04Signals: signal(), computed() and effect()signal() holds a value behind a getter/setter pair; computed() derives from it lazily; effect() reacts to it. Angular's answer to Vue's ref or a React hook.
- 05Two-Way Binding and Reactive Forms[(ngModel)] is sugar over a property and event bound together; reactive forms trade that convenience for FormControl, validators and explicit state.
- 06Template Refs, ViewChild and Outlets#ref names an element for the template; @ViewChild reaches the same element from the class. ng-template and ngTemplateOutlet turn a template into a value.
Data Structures
6 pages
- 01Linked lists, singly and doublyStartWhy a linked list trades O(1) lookup for O(1) insertion, the sentinel, reversal and cycle-detection patterns interviewers ask for, and when it actually beats an array.
- 02Stacks and queues, LIFO and FIFOTwo disciplines built on the same array, why the call stack and the event queue are named what they are, and the monotonic-stack and two-stack patterns.
- 03Hash tables: hashing and collisionsHow a key becomes an array index, why collisions are the design, the counting and grouping patterns behind half of all interview questions, and what Map and dict do.
- 04Trees, tries, and traversal orderA hierarchy instead of a chain, the four traversal orders and when each applies, how a binary search tree stays fast, and the tree keyed by character.
- 05Heaps and priority queuesA tree that lives in a flat array, the one invariant that makes "give me the smallest" an O(log n) operation, and why sorting everything is the wrong tool for "top k".
- 06Graphs: BFS, DFS and topological sortNodes and edges instead of a fixed shape: BFS for shortest paths, DFS to flood a grid, topological sort for dependencies, and union-find for connectivity.
Design Patterns
23 pages
- 01Singleton patternStartThe guarantee that exactly one instance can exist, where it earns its place (database pools, caches, config), the global state it costs, and why it breaks on serverless.
- 02Factory Method patternHiding which concrete class gets built behind one function, the indirection it costs when the choice might never grow, and the leak when a return type still names the class.
- 03Abstract Factory patternGuaranteeing a whole family of related objects ships together, the extra interface every product carries, and the mismatch when a factory returns the wrong family.
- 04Builder patternReplacing a constructor drowning in optional parameters, the extra code it costs for objects simple enough not to need it, and build() handing back the same object twice.
- 05Prototype patternCloning a configured instance instead of rebuilding from scratch, the per-field copy it costs, nested fields included, and a shallow clone() copying a reference, not a value.
- 06Adapter patternTranslating an interface you cannot change into the one callers expect, the extra hop every call pays, and the moment it adds behavior and becomes a Decorator.