Astro is designed for building fast, content-focused websites by shipping less JavaScript to the browser and using a component island architecture.
Click to reveal answer
intermediate
How does Next.js handle rendering?
Next.js supports multiple rendering methods including Server-Side Rendering (SSR), Static Site Generation (SSG), and Client-Side Rendering (CSR), allowing flexible app development.
Click to reveal answer
beginner
What is Gatsby best known for?
Gatsby is best known for its strong static site generation capabilities and rich plugin ecosystem for sourcing data from many places.
Click to reveal answer
intermediate
Which framework uses a component island architecture to reduce JavaScript sent to the browser?
Astro uses a component island architecture, which means only interactive parts load JavaScript, improving performance.
Click to reveal answer
intermediate
What is a key difference between Next.js and Gatsby in terms of data fetching?
Next.js allows dynamic data fetching at runtime with SSR, while Gatsby pre-fetches data at build time for static sites.
Click to reveal answer
Which framework focuses on shipping the least JavaScript to the browser?
ANext.js
BAstro
CGatsby
DReact
✗ Incorrect
Astro uses a component island architecture to minimize JavaScript sent to the browser.
Which framework supports Server-Side Rendering (SSR) out of the box?
ANext.js
BAstro
CGatsby
DVue
✗ Incorrect
Next.js supports SSR, SSG, and CSR for flexible rendering.
Which framework is known for a rich plugin ecosystem for sourcing data?
AGatsby
BNext.js
CAstro
DAngular
✗ Incorrect
Gatsby has many plugins to source data from CMS, APIs, and files.
Which framework is best suited for dynamic web apps with frequent data updates?
AJekyll
BAstro
CGatsby
DNext.js
✗ Incorrect
Next.js supports dynamic data fetching with SSR, ideal for frequently updated apps.
Which framework builds mostly static sites with pre-fetched data at build time?
ANext.js
BAstro
CGatsby
DSvelteKit
✗ Incorrect
Gatsby pre-fetches data during build to generate static sites.
Explain the main differences in rendering approaches between Astro, Next.js, and Gatsby.
Think about when and how each framework loads data and JavaScript.
You got /3 concepts.
Describe scenarios where you might choose Astro over Next.js or Gatsby.
Consider performance and JavaScript usage.
You got /3 concepts.
Practice
(1/5)
1. Which framework is best suited for building a fast, simple website that can use components from multiple frontend frameworks?
easy
A. Gatsby
B. Next.js
C. Astro
D. Vue.js
Solution
Step 1: Understand Astro's main feature
Astro is designed to build fast, simple sites and supports using components from different frontend frameworks together.
Step 2: Compare with Next.js and Gatsby
Next.js focuses on dynamic React apps with server features, and Gatsby is for static React content sites, so they don't emphasize mixed frameworks.
Final Answer:
Astro -> Option C
Quick Check:
Fast, simple, mixed frameworks = Astro [OK]
Hint: Astro = fast + mixed frameworks [OK]
Common Mistakes:
Confusing Next.js as supporting multiple frameworks
Thinking Gatsby supports mixed frameworks
Choosing Vue.js which is not part of the comparison
2. Which of the following is the correct way to describe Next.js?
easy
A. A React framework with server-side rendering and API routes
B. A CSS framework for styling React apps
C. A tool for building websites using multiple frontend frameworks
D. A static site generator focused on markdown content
Solution
Step 1: Identify Next.js features
Next.js is a React framework that supports server-side rendering and API routes for dynamic apps.
Step 2: Eliminate incorrect options
A static site generator focused on markdown content describes Gatsby more closely, a CSS framework for styling React apps is unrelated, and a tool for building websites using multiple frontend frameworks describes Astro.
Final Answer:
A React framework with server-side rendering and API routes -> Option A
3. Given the following scenario: You want to build a blog with lots of static content and React components. Which framework will generate a fully static site optimized for fast loading?
medium
A. Astro
B. Gatsby
C. Next.js
D. Express.js
Solution
Step 1: Identify Gatsby's strength
Gatsby is known for generating static sites optimized for content-rich blogs using React components.
Step 2: Compare with other frameworks
Astro is fast but focuses on mixed frameworks, Next.js supports dynamic server features, and Express.js is a backend framework, not for static sites.
Final Answer:
Gatsby -> Option B
Quick Check:
Static React blog = Gatsby [OK]
Hint: Static React content = Gatsby [OK]
Common Mistakes:
Choosing Next.js for static-only sites
Confusing Astro's mixed framework support with Gatsby
Selecting Express.js which is backend only
4. You wrote a Next.js app but your API routes are not working as expected. Which of the following is a common mistake that could cause this issue?
medium
A. Placing API route files outside the /pages/api directory
B. Using Astro components inside API routes
C. Using Gatsby plugins in Next.js config
D. Not importing React in every component
Solution
Step 1: Understand Next.js API route structure
API routes must be inside the /pages/api directory to work correctly in Next.js.
Step 2: Identify common mistakes
Placing API files elsewhere will cause routes not to work. Using Astro components or Gatsby plugins is unrelated to API routes. React import is automatic in Next.js 17+.
Final Answer:
Placing API route files outside the /pages/api directory -> Option A
Quick Check:
API routes must be in /pages/api [OK]
Hint: API routes go in /pages/api folder [OK]
Common Mistakes:
Putting API files in wrong folders
Mixing plugins from other frameworks
Assuming React import is always needed
5. You want to build a website that loads very fast, uses React components, and also includes some Vue components. Which framework should you choose and why?
hard
A. Create React App, because it supports Vue components
B. Gatsby, because it is optimized for React and static content
C. Next.js, because it supports multiple frontend frameworks natively
D. Astro, because it allows mixing React and Vue components with fast loading