Many React interviews ask you to reason about UI architecture problems such as search boxes, large lists, debounced input, reusable forms, caching, modal state, theme switching, and optimistic updates.
- Think in data flow, state ownership, and rendering costs
- Reuse logic with hooks or composition
- Separate server state, UI state, and transient interaction state
React components are reusable UI units, and interviews often compare function components, class components, pure components, and presentation-focused designs.
- Function components are the modern default
- Class components still matter for older codebases
- Good components stay focused and reusable
React wraps browser events in SyntheticEvent and uses a consistent event system for handlers like clicks, inputs, and form interactions.
- SyntheticEvent normalizes event behavior
- Handlers can receive extra arguments with wrappers
- Propagation and default behavior still matter
Fiber is React's internal architecture for scheduling and prioritizing work, and StrictMode helps surface unsafe patterns in development.
- Fiber enables more flexible rendering work
- Concurrent rendering changes scheduling, not your component API directly
- StrictMode may intentionally double-invoke some logic in dev
Class components expose lifecycle methods across mounting, updating, and unmounting phases.
- componentDidMount runs after mount
- componentDidUpdate runs after updates
- componentWillUnmount is for cleanup
React is a declarative UI library for building component-based single-page applications and interactive interfaces.
- React focuses on UI composition
- Often used for SPAs
- Helps manage complex interactive state and rendering
React patterns help organize how behavior, layout, and state are shared across components.
- Compound components coordinate related pieces
- Providers expose shared capabilities
- Headless UI separates behavior from styling
React apps become slow when they re-render too much, do expensive work in render, or ship more code and DOM than needed.
- Measure before optimizing
- Code splitting and virtualization reduce big costs
- Memoization helps only when it prevents meaningful work
Portals let React render children into a DOM node outside the normal parent hierarchy while keeping them in the same React tree.
- Useful for modals and overlays
- Solves stacking and clipping issues
- Events still follow React tree semantics
Safe React code avoids dangerous HTML injection, unnecessary direct DOM manipulation, state mutation, and side effects during render.
- `dangerouslySetInnerHTML` is risky
- Keep components focused and state colocated
- Avoid premature optimization and hidden mutation
React differs from plain DOM code by using declarative rendering, and it differs from Angular or Vue in scope, conventions, and ecosystem philosophy.
- React abstracts UI updates
- Angular is more framework-heavy
- Vue is often seen as more integrated but lighter than Angular
Redux organizes state around actions, reducers, a store, and dispatch, and Redux Toolkit is now the preferred modern way to write Redux code.
- Actions describe what happened
- Reducers compute the next state
- Middleware handles async or side effects around dispatch