Question presented to candidate: "If I know getServerSideProps and getStaticProps, how does data fetching in the App Router map to them, and what actually changes for the user and the payload?"
What a strong answer should cover:
- Pages Router:
getServerSidePropsruns per request,getStaticPropsat build (withrevalidatefor ISR),getStaticPathslists dynamic pages; only the page file can fetch. - Their return value is serialized into
__NEXT_DATA__JSON in the HTML, including props the component never renders. - App Router: any Server Component can
awaitdata; the rendering mode (static, ISR, dynamic) follows from what the code reads and its cache settings. - The mapping: getServerSideProps is a dynamic route, getStaticProps is a static route with fetch caching or
revalidate, getStaticPaths isgenerateStaticParams. - The client receives the RSC payload (rendered output) instead of the raw props JSON.
Clarifying questions expected:
- "Is the app migrating incrementally?" β both routers can run side by side.
- "Which pages need per-request data?" β they become dynamic routes.
Code / implementation expected: Yes β the same page in both routers.