Search
Lessons (10)
- Two Pointers & Sliding Window
… recompute every window → O(n × k) // ✅ Slide: add the new element, subtract the old one → O(n) function …
- SQL Interview Query Drills
… For an average per class, use a correlated subquery or partitioned window function. Q26: Third-highest distinct salary …
- DSA Interview Patterns Cheat Sheet
… intervals (merge overlapping meetings) js function mergeIntervals(intervals) { const sorted = intervals.toSorted((a, b) = a[0] - b[0 …
- React Hooks in Practice
… never inside if , loops or nested functions. 2. Only call hooks from React functions (components or custom hooks …
- Stacks & Queues
… When a function returns, its frame is popped. js function a() { b(); } function b() { c(); } function c() { console …
- JavaScript Essentials: Event Loop, Closures & this
… Q -- "plain fn()" P["this = undefined (strict) / window"] Q -- arrow function A["this = inherited from the surrounding code …
- State Management (Redux, Zustand, TanStack Query)
… Don't hand-roll that with useEffect + useState . jsx import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; function …
- MVC, MVP & MVVM
… all the state and logic, no JSX function useLoginViewModel() { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const …
- Frontend Performance & Core Web Vitals
… render only the ~20 visible rows (TanStack Virtual, react-window) Context updates re-render everything Split contexts, or …
- Caching & Redis
… SET product:42 (expires in 300 s) end js async function getProduct(id) { const key = product:${id} ; const …