React Developer Interview Questions & Answers

🚀 Senior React Developer Interview Questions & Answers (Asked in a Recent Interview) 1️⃣ Nullish Coalescing (??) vs Logical OR (||) – || returns the right value when the left value is falsy (0, "", false, null, undefined), whereas ?? only returns the right value when the left value is null or undefined, which is safer when handling default props or API data in React. 2️⃣ Git Squash – Combines multiple commits into one to keep commit history clean, often used before merging feature branches using git rebase -i. 3️⃣ Git Cherry-pick – Allows applying a specific commit from one branch to another without merging the entire branch using git cherry-pick <commit-hash>. 4️⃣ Generic Types (TypeScript) – Used in React with TypeScript to create reusable typed components, hooks, and utilities (e.g., generic API response types). 5️⃣ any vs unknown – any disables type checking completely, while unknown enforces type checking before usage, making code safer in TypeScript React applications. 6️⃣ Micro-frontend Communication – React microfrontends communicate using custom events, shared state libraries, module federation, or container-level props/state. 7️⃣ SSR vs ISR vs SSG – In React frameworks like Next.js: SSR renders on every request, SSG generates pages at build time, and ISR regenerates static pages periodically after deployment. 8️⃣ Hoisting vs TDZ (Temporal Dead Zone) – Hoisting moves declarations to the top during compilation, but let and const stay in the TDZ until initialized. 9️⃣ React Performance Optimization – Techniques include React.memo, useMemo, useCallback, lazy loading, code splitting, virtualization, avoiding unnecessary re-renders, and optimizing bundle size. 🔟 useEffect vs useLayoutEffect – useEffect runs after the browser paints, while useLayoutEffect runs synchronously before paint and is used when DOM measurement or layout changes are needed. #reactjs #reactdeveloper #frontendinterview #javascript #typescript #webdevelopment #reacthooks #softwareengineering #techinterview #frontend

Great set of React interview questions! These are really helpful for developers preparing for frontend interviews. Thanks for sharing

To view or add a comment, sign in

Explore content categories