Frontend Interview Cheat Sheet: JavaScript & React Essentials

⚡ Frontend Interview Cheat Sheet (Last-Minute Revision | Mid-Level) Got an interview in a few hours? This is your high-impact revision guide — not fluff, just what actually gets asked. Save it. Skim it. Walk in sharp. 💪 🧠 JavaScript Essentials (Core Thinking Area) 🔹 Closures → Function retains access to its lexical scope even after execution 👉 Used in: data privacy, currying, memoization 🔹 Event Loop → Handles async execution Call Stack → executes sync code Microtasks → Promises (then, catch) Macrotasks → setTimeout, setInterval 👉 Microtasks run before macrotasks 🔹 this keyword Depends on how function is called Arrow functions → no own this (inherits from parent) 🔹 Prototypes & Inheritance JS uses prototypal inheritance, not classical Objects can inherit properties via __proto__ 🔹 Async Patterns Callbacks → Promises → Async/Await Always handle errors (try/catch or .catch) 🔹 Debounce vs Throttle Debounce → wait for inactivity (search input) Throttle → limit frequency (scroll events) ⚛️ React Deep Recall (Most Asked Section) 🔹 Rendering Flow 👉 State/props change → Virtual DOM → Diffing → Reconciliation → DOM update 🔹 useEffect Mastery Runs after render Dependency array controls execution Cleanup function prevents memory leaks 🔹 Re-renders (CRITICAL) Caused by: State changes Parent re-renders 👉 Optimize using React.memo, useMemo, useCallback 🔹 State Management Thinking Local state vs global state (Context/Redux) Lift state up when multiple components need it 🔹 Controlled vs Uncontrolled Controlled → React manages form state Uncontrolled → DOM manages state (refs) 🔹 Common Pitfall 👉 Updating state is async — don’t rely on immediate value 🌐 Browser & Performance (Where You Stand Out) 🔹 What happens when you type a URL? DNS → TCP handshake → HTTP request → Server → Response → Rendering 🔹 Rendering Optimization Minimize reflows & repaints Avoid large DOM trees Use requestAnimationFrame for animations 🔹 Storage localStorage → persistent sessionStorage → per tab Cookies → sent with every request 🔹 CORS Browser security policy Controlled via server headers 🔹 Performance Techniques Lazy loading (images/components) Code splitting (dynamic import) Tree shaking CDN usage 🎨 HTML & CSS (Don’t Underestimate) 🔹 Box Model → content + padding + border + margin 🔹 Flexbox vs Grid Flexbox → 1D layouts (row/column) Grid → 2D layouts (rows + columns) 🔹 Positioning relative, absolute, fixed, sticky → know differences 🔹 Specificity Order Inline > ID > Class > Element 🔹 Display Differences display: none → removes from layout visibility: hidden → keeps space 🔹 Accessibility (A11y) 👉 Semantic tags, alt text, keyboard navigation #FrontendDevelopment #JavaScript #ReactJS #InterviewPrep #WebDevelopment #SoftwareEngineering #Developers #TechCareers #CodingInterview #CareerGrowth #FrontendEngineer

To view or add a comment, sign in

Explore content categories