Question presented to candidate: "You are starting a brand-new Next.js project today. Walk me through how you create it, and then explain what each folder and file in the generated project is for."
What a strong answer should cover:
npx create-next-app@latest(or the pnpm, yarn and bun equivalents), the--yesshortcut for recommended defaults, and the Node.js 20.9 minimum.- The defaults: TypeScript, Tailwind CSS, ESLint, App Router, Turbopack, the
@/*import alias and anAGENTS.mdfile; recent versions also turn on Cache Components innext.config.ts. - The
app/folder is the router:layout.tsx(required root layout with html and body),page.tsx(the/route),globals.css,favicon.ico. public/for static files served from/,next.config.tsfor framework settings,tsconfig.jsonwith the@/*alias,next-env.d.tsand.next/as generated files that are not committed.- The scripts
dev,build,start,lintand what each does at a high level.
Clarifying questions expected:
- "Do we want the
src/folder layout, and do we need Tailwind?" β both are create-next-app choices. - "Is this a new app or are we adding Next.js to an existing React project?" β the second case is a manual install.
Code / implementation expected: Yes β the create command, plus a minimal root layout and page.