6.1 Performance Optimisation
React.memo: skip re-renders when props haven't changed. useMemo + useCallback: memoize values and functions. Code splitting: React.lazy + Suspense for route-based splitting — load only what's needed. Dynamic imports for heavy components (charts, editors). React Profiler: identify slow components. Bundle analysis: vite-bundle-visualizer. The rule: measure first, optimise second — don't premature-optimize.
6.2 Web Vitals & Lighthouse
Core Web Vitals: LCP (Largest Contentful Paint — perceived load speed), INP (Interaction to Next Paint — responsiveness), CLS (Cumulative Layout Shift — visual stability). Lighthouse audit: performance score, accessibility score, SEO score. Optimising images: lazy loading, WebP, srcSet. Font loading: font-display: swap. Why performance matters for SEO and user retention.
6.3 Accessibility (a11y)
Semantic HTML: button vs div, form labels, heading hierarchy. ARIA attributes: aria-label, aria-describedby, aria-hidden, role. Focus management: keyboard navigation, focus trapping in modals. Screen reader testing. Color contrast ratios (WCAG AA: 4.5:1). Skip links for keyboard users. Why a11y matters: legal requirements, better UX for everyone, and increasingly tested in interviews at companies like Google and Microsoft.
6.4 Advanced Component Patterns
Compound components: <Tabs><Tab>...</Tab></Tabs> — related components sharing implicit state. Render props (legacy but in interviews). Higher-order components (legacy but in interviews). Controlled vs uncontrolled components. Portals: render outside the DOM tree (modals, tooltips). forwardRef: pass refs to child components. Polymorphic components: <Button as="a" href="...">.
Placement relevance: "How do you optimise React performance?" is asked in every React interview. Understanding React.memo, code splitting, and profiling demonstrates performance awareness. Accessibility is increasingly tested — Google, Microsoft, and government contract companies require WCAG compliance. Component patterns (compound, render props, HOC) are tested for architectural understanding.