Challenge - 5 Problems
NestJS vs Express vs Fastify Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1: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?
Attempts:
2 left
💡 Hint
Think about which framework uses TypeScript features heavily.
✗ Incorrect
NestJS uses decorators and a modular structure to organize code, making it more structured and scalable.
❓ component_behavior
intermediate1:30remaining
What is the default HTTP server used by NestJS?
By default, which HTTP server does NestJS use under the hood?
Attempts:
2 left
💡 Hint
NestJS can switch servers but has a default choice.
✗ Incorrect
NestJS uses Express as its default HTTP server but can be configured to use Fastify for better performance.
📝 Syntax
advanced2: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();
Attempts:
2 left
💡 Hint
Fastify requires a specific adapter in NestJS.
✗ Incorrect
To use Fastify in NestJS, you must pass a FastifyAdapter instance to NestFactory.create.
❓ state_output
advanced1: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);
Attempts:
2 left
💡 Hint
Look at the response sent inside the route handler.
✗ Incorrect
The Express app sends 'Hello from Express' as the response to GET requests at '/'.
❓ lifecycle
expert2: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?
Attempts:
2 left
💡 Hint
This hook runs once the whole app is ready, not just a single module.
✗ Incorrect
onApplicationBootstrap() is called after all modules are initialized and the app is bootstrapped.