At least 10 questions — mix of concept, syntax, practical, and logic. Score ≥80% (enforced by the API) to save progress.
15 questions · concept 5 · syntax 3 · practical 4 · logic 3
1. Where should Notes P1 be built? Concept
As a new feature folder inside the product apps/api project alongside tickets In apps/notes-practice as a Nest NotesModule with controller, service, and DTOs As a Next.js Route Handler in apps/web that proxies to a service As a standalone Express server outside the Nest workspace
2. How do you prove P1? Syntax
Run pnpm test in apps/api and confirm the tickets suite passes Open the Notes UI in apps/web and confirm the form submits Run pnpm course:validate-milestone be-notes-p1 until green Run pnpm course:validate-milestone be-notes-p2 for the HTTP gate
3. Why use DI for NotesService? Practical
Inject the service via Nest providers instead of new in every handler Register the service as a global module export so no provider is needed Instantiate it once in main.ts and pass it through request context Provide it through a custom Express middleware factory
4. Why validated DTOs on Notes HTTP? Logic
TypeScript compile-time types already reject invalid runtime bodies Nest validates request bodies automatically without any pipe Runtime bodies are untrusted; ValidationPipe enforces the contract Swagger @ApiProperty decorators enforce the body shape at runtime
5. What should the Notes controller stay? Concept
Thin — map HTTP and delegate business logic to the service Fat — hold the query logic so the service can stay empty Responsible for opening the TypeORM connection per request The place to run class-validator manually before calling the repo
6. Is editing the grader allowed for learners? Practical
No — implement until the read-only grader passes Yes — relax the strict assertions while keeping the structure Yes — but only the DTO checks, never the routing checks Yes — as long as you restore the file before committing
7. Why not put Notes into apps/api tickets? Syntax
The tickets module already exports NotesService so it would clash P1 is a separate practice app milestone, not a tickets feature add-on apps/api pins a different Nest major version than notes-practice Notes and tickets cannot share the same ValidationPipe config
8. What does a green P1 grader mean? Logic
That the notes table and its migration have been applied That JwtAuthGuard protects every notes route Nest HTTP readiness: module wiring, DTOs, and CRUD-shaped handlers meet the checklist That attachment uploads and events publish correctly
9. Should P1 use synchronize true instead of thinking about HTTP? Concept
Yes — synchronize true is the fastest way to satisfy the P1 checklist Yes — auto-sync means you can skip DTOs entirely in P1 No — P1 focuses on Nest HTTP structure; persistence depth is later milestones Yes — P1 grades the schema, so synchronize matters most
10. Which P1 approach is wrong? Practical
Registering NotesModule with its controller and service in notes-practice Only writing a Next Route Handler for Notes Injecting NotesService through the constructor instead of new Validating request bodies with class-validator DTOs and the pipe
11. What does this NotesModule set up for P1? Concept intermediate
@Module({
controllers: [NotesController],
providers: [NotesService],
})
export class NotesModule {}Exposes the service to other modules by exporting it Applies a module-scoped ValidationPipe to the controller Auto-registers the entity repository for the service Registers the controller for routing and the service for DI
12. What makes the body actually validated for P1? Syntax advanced
@Post()
create(@Body() dto: CreateNoteDto) {
return this.svc.create(dto);
}A TypeScript interface named CreateNoteDto with typed fields The @Body() decorator, which coerces and validates on its own A class-validator CreateNoteDto plus the global ValidationPipe An @ApiProperty on each field so Swagger enforces the shape
13. Why is this the right controller shape for P1? Practical intermediate
@Get()
list() {
return this.svc.findAll();
}It stays thin and delegates to the service Because controllers must return the repository query result directly Because returning a Promise lets Nest skip the service layer Because @Get() handlers are required to be async in Nest
14. Why inject NotesService instead of new NotesService()? Logic advanced
@Controller('notes')
export class NotesController {
constructor(private readonly svc: NotesService) {}
}The container creates a brand-new instance per request for isolation new works but forces you to also register the class as a provider DI is required so guards can read the request before the service The container supplies a shared, testable instance via DI
15. What does this command do? Concept intermediate
pnpm course:validate-milestone be-notes-p1Scaffolds the P1 NotesModule files if they are missing Runs the P1 grader but records progress only after a manual quiz Runs the read-only grader for P1 and marks progress when green Regenerates the milestone checklist from the current code
Submit quiz Checking your session…