This repository contains comprehensive notes, examples, and interview-focused guidance for React and related front-end topics. Each topic includes clear explanations, practical code snippets, and interview-ready summaries to help you prepare for technical interviews that focus on React, its ecosystem, and front-end engineering fundamentals.
-
- Covers useState, useEffect, useRef, useMemo, useCallback
- Custom hooks and hook composition
-
- Creating reusable hooks
- Rules of hooks and testing hooks
-
Controlled vs Uncontrolled Components
- Form handling patterns and trade-offs
-
- State ownership and prop drilling
-
React Lifecycle (Class Components)
- Class lifecycle methods and functional equivalents
-
- Error handling strategies in React
-
- Rendering outside the DOM hierarchy
-
Fragments, StrictMode & Suspense
- Useful built-in components and patterns
-
Memoization (React.memo, useMemo, useCallback)
- Preventing unnecessary re-renders and memoization patterns
-
Virtualization (react-window, react-virtualized)
- Efficient large list rendering and windowing strategies
-
Lazy Loading & Code-Splitting (React.lazy, Suspense)
- Reducing bundle size and improving load times
-
Avoiding Unnecessary Re-renders
- Common causes of re-renders and how to mitigate them
-
Efficient List Rendering (keys, windowing)
- Keys, virtualization, and rendering performance techniques
-
- Patterns, pitfalls, and performance considerations
-
- When to use Redux and common patterns
-
- Modern lightweight state solutions
-
Comparison: Local State vs Global State
- When to choose local, lifted, or global state
-
- Overview of v6+ features, route nesting, and hooks
-
- Building nested UI and layout routes
-
Route Protection (PrivateRoute)
- Protecting routes and authentication patterns
-
- Reading and managing params and query strings
-
- Combining layouts with nested routing for page structure
-
Controlled vs Uncontrolled Inputs
- Differences, pros/cons, and when to use each pattern
-
Form Libraries (Formik, React Hook Form)
- Library comparisons, validation strategies, and performance tips
-
Validation (Zod, Yup, custom validation)
- Schema validation, runtime checks, and integration with form libraries
-
- Adding/removing fields, arrays of inputs, and form state management
-
Fetching Data (fetch, axios, GraphQL, etc.)
- fetch, axios, GraphQL, REST patterns and best practices
-
Data Fetching Libraries: React Query (TanStack Query), SWR
- Caching strategies, query invalidation, pagination, and infinite scroll
-
Caching, Pagination, Infinite Scroll
- Patterns for caching, cursor vs page pagination, and UX considerations
-
- Handling loading, error, and empty states in UI
-
- Rate-limiting interactions and improving perceived performance
-
Unit Testing: Jest, React Testing Library
- Writing unit tests for components and hooks
-
- Testing component behavior and props
-
- End-to-end flows and combined module testing
-
- Use MSW to mock network requests in tests
-
- When snapshots help and when they hurt
-
Typing Props, State, Refs, and Hooks
- How to type components, refs, and hooks
-
Generics in Components and Hooks
- Using generics to create reusable typed components and hooks
-
Discriminated Unions for Conditional Rendering
- Pattern matching and safer conditional rendering with unions
-
Utility Types (Partial, Pick, Omit, etc.)
- Common utility types and when to use them
-
CSS Modules, SCSS, Styled Components, Emotion, TailwindCSS
- Styling strategies: CSS Modules, utility-first, and CSS-in-JS trade-offs
-
- Layout strategies, breakpoints, and naming conventions
-
- Theme variables, prefers-color-scheme, and CSS variables
-
- Patterns and trade-offs for CSS-in-JS libraries
-
- Comparison of bundlers and framework-specific tooling
-
ESLint, Prettier, Husky, Lint-staged
- Linting, formatting, and pre-commit automation
-
- Managing env vars across environments and secrets handling
-
Performance Profiling & Dev Tools
- Profiling tools and devtool tips for performance debugging
-
- Passing render logic to components for flexible UI
-
Higher Order Components (HOCs)
- HOC patterns and trade-offs compared to hooks
-
- Building flexible component APIs with composition
-
Controlled vs Uncontrolled Components (Advanced)
- Advanced forms of control and state synchronization
-
- Using reducer patterns to manage complex component state
-
- Reusability, composition, and separation of concerns
-
- Context API, Redux, and Zustand
-
- REST vs GraphQL, and data fetching strategies
-
- Code splitting, lazy loading, and memoization
-
- Unit testing, integration testing, and end-to-end testing
-
- Server-side rendering, static generation, and incremental static regeneration patterns in Next.js
-
- Pages, dynamic routes, and nested folders using the file-system router
-
- New App Router concepts: layouts, server components, and streaming
-
- Building backend endpoints inside a Next.js app and deploying serverless functions
-
- Edge middleware, request handling, and redirects
-
- Implementing authentication with next-auth and session strategies
-
Making Architectural Decisions
- How to reason about architecture choices and justify trade-offs in interviews
-
- Best practices for onboarding, feedback, and growth conversations
-
- How to give actionable feedback and keep reviews efficient and respectful
-
Discussing Trade-offs (e.g., Redux vs Context, SSR vs CSR)
- Framing trade-offs and explaining technical decisions concisely
-
System Design Basics: Structuring a Scalable React App
- High-level patterns for scalable front-end architectures and data flows
- Core React: hooks (useState, useEffect, useRef, useMemo/useCallback) and lifecycle equivalents
- Component design: composition, single-responsibility, controlled vs uncontrolled patterns
- Performance: memoization, virtualization, avoiding unnecessary re-renders, code-splitting
- State management: Context API, Redux/Toolkit, and modern lightweight stores (Zustand, Recoil)
- Routing & Next.js: client vs server rendering, file-based routing, App Router basics, API routes
- Data fetching: REST vs GraphQL, React Query/SWR, caching, pagination, and error/loading states
- Testing: unit/component/integration testing with Jest, React Testing Library, and MSW
- TypeScript: typing props, generics, discriminated unions, and utility types
- Soft skills & design: communicating trade-offs, writing clear PRs, and system-design basics for frontends
- Read the core topics in this repo in order: Core React β State Management β Routing β API Integrations β Testing.
- Build 2β3 small focused apps that exercise multiple areas (e.g., a CRUD app with forms, client-side caching, and tests).
- Add performance improvements iteratively: measure with React DevTools Profiler, then apply memoization or virtualization where needed.
- Write tests for critical flows: unit tests for utils/hooks, component tests for UI, and integration tests for page-level flows using MSW.
- Practice explaining trade-offs out loud: five-minute explanations of choices (e.g., Redux vs Context, SSR vs CSR).
- Explain useEffect with dependency arrays and common pitfalls (stale closures, missing deps)
- Demonstrate controlled vs uncontrolled inputs and when to use each
- Describe memoization patterns (React.memo, useMemo, useCallback) and when they're beneficial
- Compare state management options and pick one for a given scenario (justify choice)
- Show a small data-fetching example using React Query or SWR with caching and error handling
- Write a component test with React Testing Library and a mocked API using MSW
- Type a small component with generics or utility types and explain the trade-offs
- Walk through a simple frontend system-design diagram for a scalable React app (data flow, caching layer, state boundaries)
- Pick a learning path: follow the Table of Contents in order (Core React β State Management β Routing β API Integrations β Testing).
- For each topic, open the linked markdown file, read the explanation, run any example code locally, then try the short exercises.
- Build small projects that combine topics (e.g., a Next.js CRUD app that uses React Query, Redux or Zustand, and has unit + integration tests).
- Use the Practical checklist above to create small, demonstrable artifacts you can show in interviews (code snippets, tests, design diagrams).
- Add your notes or corrections directly into the topic files β filenames contain spaces, so use your editor's file open dialog or click links from this README.
- This repository uses modern React (functional components + hooks).
- Files are organized by topic folders; links in this README are percent-encoded to work with filenames that contain spaces and special characters.
- If you prefer, rename files to simpler names (no spaces) and update links here β I can do that automatically if you want.
- Contributions, issues, and PRs are welcome β follow standard GitHub flow (fork β branch β PR) and include short descriptions of any added examples or corrections.
Happy Learning! π
This repository is designed to help you prepare for React interviews by combining conceptual notes, practical examples, and hands-on exercises.