0
0
NestJSframework~20 mins

NestJS vs Express vs Fastify comparison - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
NestJS vs Express vs Fastify Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Which framework uses a modular architecture with decorators?
Among NestJS, Express, and Fastify, which framework is designed around a modular architecture using decorators to organize code?
AExpress
BNestJS
CFastify
DAll three use decorators by default
Attempts:
2 left
💡 Hint
Think about which framework uses TypeScript features heavily.
component_behavior
intermediate
1:30remaining
What is the default HTTP server used by NestJS?
By default, which HTTP server does NestJS use under the hood?
AFastify
BKoa
CExpress
DHapi
Attempts:
2 left
💡 Hint
NestJS can switch servers but has a default choice.
📝 Syntax
advanced
2:00remaining
Which code snippet correctly creates a Fastify instance in NestJS?
Select the correct way to create a Fastify-based NestJS application.
NestJS
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify';

async function bootstrap() {
  const app = await NestFactory.create(AppModule, new FastifyAdapter());
  await app.listen(3000);
}
bootstrap();
ANestFactory.create(AppModule, new KoaAdapter())
BNestFactory.create(AppModule, new ExpressAdapter())
CNestFactory.create(AppModule)
DNestFactory.create(AppModule, new FastifyAdapter())
Attempts:
2 left
💡 Hint
Fastify requires a specific adapter in NestJS.
state_output
advanced
1:30remaining
What is the output when sending a GET request to a simple Express route?
Given this Express code, what will the server respond with when a GET request is made to '/'? const express = require('express'); const app = express(); app.get('/', (req, res) => { res.send('Hello from Express'); }); app.listen(3000);
AHello from Express
BCannot GET /
CHello from NestJS
D404 Not Found
Attempts:
2 left
💡 Hint
Look at the response sent inside the route handler.
lifecycle
expert
2:00remaining
Which lifecycle hook runs after all modules are initialized in NestJS?
In NestJS, which lifecycle hook method is called after all modules have been initialized?
AonApplicationBootstrap()
BonModuleInit()
CafterInit()
DbeforeApplicationShutdown()
Attempts:
2 left
💡 Hint
This hook runs once the whole app is ready, not just a single module.