React Server Components (RSC)
As a Senior engineer, explain React Server Components (RSC). What problem does it solve and how would you describe it in an interview?
Answers use simple, clear English.
Quick interview answer
At Senior depth: start with the problem, then mechanism, then a short example. Server Components render on server, zero client JS by default.
Detailed answer
At Senior depth: start with the problem, then mechanism, then a short example. Server Components render on server, zero client JS by default. Fetch data directly in component. Client Components ('use client') for interactivity — compose both. Core: Server Components render on server, zero client JS by default. Fetch data directly in component. Client Components ('use client') for interactivity — compose both. Real-time example: Next.js page.tsx loads products from DB server-side; AddToCart button is client child. Pros: Smaller bundles; secrets stay server-side; streaming HTML. Cons: Cannot use hooks/state in server components; serialization limits on props. Common mistakes: Importing server component into client without children pattern; fetching in client unnecessarily. Best practices: Push 'use client' boundary low; pass serializable props only. Audience level: Senior.
Full explanation
Server Components render on server, zero client JS by default. Fetch data directly in component. Client Components ('use client') for interactivity — compose both.
Real example & use case
Next.js page.tsx loads products from DB server-side; AddToCart button is client child.
Pros & cons
Pros: Smaller bundles; secrets stay server-side; streaming HTML. Cons: Cannot use hooks/state in server components; serialization limits on props.
Common mistakes
Importing server component into client without children pattern; fetching in client unnecessarily.
Best practices
Push 'use client' boundary low; pass serializable props only.
Follow-up questions
Only answered follow-ups are shown — click to open with full answers