Skip to content

Conversation

@0xsatoshi99
Copy link

Summary

This PR adds 91 comprehensive React interview questions (Q90-Q180) covering modern React features, hooks, performance optimization, and best practices.

Fixes

Closes #238 - Clarifies the differences between Decorators and Higher-Order Components, plus adds extensive modern React coverage

Changes

Topics Covered:

React Hooks (Q90-Q99):

  • useState vs useReducer
  • useEffect vs useLayoutEffect
  • useContext for context consumption
  • useMemo and useCallback for performance
  • useRef for DOM access and mutable values
  • useImperativeHandle for ref customization
  • Custom Hooks creation and patterns
  • React.memo vs useMemo

Modern React 18 Features (Q100-Q106):

  • React Server Components
  • Concurrent Rendering
  • useTransition for non-urgent updates
  • useDeferredValue for deferred rendering
  • useId for stable IDs
  • useSyncExternalStore for external stores
  • useInsertionEffect for CSS-in-JS
  • Automatic Batching

Component Patterns (Q107-Q120):

  • Suspense for code splitting and data fetching
  • Error Boundaries
  • React.lazy and code splitting
  • Controlled vs Uncontrolled components
  • HOC vs Render Props (addresses issue What is the difference between Decorators and HOCs? #238)
  • forwardRef for ref forwarding
  • Component vs PureComponent
  • createElement vs cloneElement
  • React.Children utilities

Performance Optimization (Q121-Q130):

  • React.memo for component memoization
  • useMemo for value memoization
  • useCallback for function memoization
  • Code splitting strategies
  • Tree shaking
  • Lazy loading
  • When NOT to use memoization
  • Performance bottlenecks

Core Concepts (Q131-Q150):

  • State vs Props
  • Prop drilling and solutions
  • Synthetic events vs native events
  • Event pooling (removed in React 17)
  • JSX vs createElement
  • Virtual DOM and reconciliation
  • Keys and refs
  • Lifting state up
  • Composition vs inheritance
  • Lifecycle methods and Hook equivalents

Context and State Management (Q146-Q148):

  • React Context API
  • Context performance implications
  • Context vs Redux

Routing and Navigation (Q149-Q150):

  • React Router basics
  • BrowserRouter vs HashRouter

Testing and Debugging (Q151, Q175-Q179):

  • React Testing Library best practices
  • React DevTools
  • Profiler API
  • Development vs production builds
  • Debugging techniques

Rendering Strategies (Q157-Q159):

  • Server-Side Rendering (SSR)
  • Static Site Generation (SSG)
  • Incremental Static Regeneration (ISR)
  • Hydration process

Styling (Q160-Q162):

  • Different styling approaches
  • CSS-in-JS pros and cons
  • Inline styles vs CSS classes

Advanced Topics (Q163-Q180):

  • Code splitting and tree shaking
  • Shallow vs deep comparison
  • Immutability importance
  • Form handling
  • React vs Vue vs Angular
  • Portals
  • React Fiber architecture
  • StrictMode
  • PropTypes vs TypeScript

Decorators vs HOCs (Q123):

Quality

All 91 questions include:

  • Clear, concise answers
  • Practical explanations
  • Real-world use cases
  • Best practices
  • Common pitfalls
  • Modern React 18+ features
  • Performance considerations

Statistics

  • Lines added: 548
  • New questions: 91 (Q90-Q180)
  • Topics covered: 25+ major React areas
  • React versions: Covers React 16.8+ through React 18

Educational Value

This contribution significantly enhances the repository by:

  • Doubling the number of questions (from 89 to 180)
  • Covering modern React features (Hooks, Concurrent Mode, Server Components)
  • Providing comprehensive performance optimization guidance
  • Explaining component patterns and best practices
  • Addressing the specific issue What is the difference between Decorators and HOCs? #238 about Decorators vs HOCs
  • Including testing and debugging strategies
  • Covering different rendering strategies (SSR, SSG, ISR)

Note: This PR directly addresses issue #238 by clarifying the differences between Decorators and HOCs in Q123, while also providing extensive coverage of modern React development practices.

Fixes sudheerj#238

This PR adds 91 comprehensive React interview questions (Q90-Q180) covering:
- React Hooks: useState, useReducer, useEffect, useLayoutEffect, useContext, useMemo, useCallback, useRef, custom Hooks
- Modern React 18 features: Concurrent Rendering, useTransition, useDeferredValue, useId, Automatic Batching
- React Server Components and SSR/SSG/ISR
- Performance optimization: React.memo, memoization, code splitting, lazy loading
- Component patterns: HOC, Render Props, Composition, Error Boundaries
- Advanced concepts: React Fiber, Virtual DOM, Reconciliation, Hydration
- Testing and debugging: React Testing Library, DevTools, Profiler
- Styling approaches: CSS-in-JS, CSS Modules, inline styles
- State management: Context API, lifting state, prop drilling
- Forms and events: Controlled/Uncontrolled components, synthetic events
- Lifecycle methods and their Hook equivalents
- Best practices and common pitfalls

Addresses issue sudheerj#238 about clarifying differences between Decorators and HOCs, plus comprehensive modern React coverage.

Total additions: 548 lines of interview Q&A content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

What is the difference between Decorators and HOCs?

1 participant