Lesson 1: Quiz on Next.js Basics
Question 1: What is the default port used by a Next.js application in development mode?
- A) 8000
- B) 3000
- C) 5000
- D) 8080
Answer: B) 3000
Question 2: Which method is used to fetch data at build time in Next.js?
- getServerSideProps
- getStaticProps
- getInitialProps
- getDynamicProps
Answer: B) getStaticProps
Question 3: Which of the following is NOT a rendering method in Next.js?
- Static Site Generation (SSG)
- Server-SideRendering (SSR)
- Incremental Static Regeneration (ISR)
- Continuous Site Rendering (CSR)
Answer: D) Continuous Site Rendering (CSR)
Lesson 2: Advanced Quiz
Question 4: How can you define dynamic routes in Next.js?
- Using curlybraces {} in file names
- Using squarebrackets [] in file names
- Using anglebrackets <> in file names
- Using parentheses() in file names
Answer: B) Using square brackets
Question 5: What is the purpose of
- Tofetch data on the server side
in file names
in Next.js?
- Togenerate dynamic routes during build time
- Toset up API routes
- Tohandle CSS imports
Answer: B) To generate dynamic routes during build time
Question 6: Which command is used to start a Next.js application in production mode?
- npm run dev
- npm start
- npm run build
- npm serve
Answer: B) npm start
Leave a Reply