nextRound
TechnologiesCoding ProblemsBookmarksLearning Paths
nextRound
TechnologiesCoding ProblemsBookmarksLearning Paths
nextRound

AI-powered interview preparation platform. Practice with curated questions, mock interviews, and personalized learning paths to crack your dream tech interview.

Quick Links

  • Technologies
  • Saved Questions
  • Pricing

Company

  • About Us
  • Contact Us

Legal

  • Privacy Policy
  • Terms of Use

© 2026 nextRound. All rights reserved.

TOPIC OVERVIEW

NestJS/Pipes

Validate and transform incoming data before it reaches your controller method.

15 QuestionsIntermediateHigh Priority ~10 min read

Pipes process data before it reaches a controller handler. They can transform values into the type your application expects or validate that incoming data follows specific rules.

NestJS provides built-in pipes such as ParseIntPipe and ValidationPipe, while custom pipes can handle application-specific requirements. Pipes are particularly useful for keeping validation and transformation logic out of your controllers.

What you'll walk away knowing

What pipes do in the NestJS request lifecycle
How built-in parsing pipes work
How ValidationPipe validates DTOs
How to create custom pipes
1How do you make a custom pipe configurable by accepting constructor options in NestJS?Intermediate2How do you validate arrays and conditional fields with class-validator in NestJS?Intermediate3What is the @ValidateNested() decorator and when must you pair it with @Type()?Intermediate4What is the difference between a transformation pipe and a validation pipe in NestJS?Intermediate5How do you write a custom pipe for parsing and validating a MongoDB ObjectId param in NestJS?Intermediate6How do you write a pipe that uses metatype to skip validation for primitive types the same way ValidationPipe does?Intermediate7What are the two ways to register a global pipe in NestJS and what is the difference?Intermediate8How does ValidationPipe work with class-validator and class-transformer in NestJS?Intermediate9How do you write a custom class-validator decorator in NestJS?Intermediate10How do you customise the error response format produced by ValidationPipe in NestJS?Intermediate11How do you write an async custom validator that checks uniqueness against a database in NestJS?Intermediate12What interface must a custom pipe implement and what does the transform() method receive?Beginner13What are all the significant ValidationPipe options and what does each do in NestJS?Intermediate14How do you write a pipe that validates and parses a date string from a route parameter in NestJS?Intermediate15What is a pipe in NestJS and what are its two primary uses?Intermediate16What is class-transformer and how does it complement class-validator in NestJS?Intermediate17What does the @Transform() decorator do in class-transformer and when should you use it?Intermediate18How does @Type() interact with discriminated unions and polymorphic DTOs in class-transformer?Advanced19What is class-validator and how does it integrate with NestJS ValidationPipe?Intermediate20How do you unit test a custom pipe in NestJS?Intermediate21What does @Exclude() and @Expose() do and how do you use them to strip sensitive fields from responses?Intermediate22What are all the built-in pipes NestJS ships with?Intermediate23What is the excludeExtraneousValues option in class-transformer and how does it differ from whitelist in ValidationPipe?Intermediate24How do you handle file upload validation with ParseFilePipe and custom file validators in NestJS?Intermediate25How do you write a custom pipe that sanitizes a string input (trim and lowercase) in NestJS?Intermediate26How do you pass options to a built-in pipe like ParseIntPipe or ParseUUIDPipe in NestJS?Intermediate27What is the difference between applying a pipe at the param level vs handler level vs globally in NestJS?Intermediate28Can a pipe be asynchronous in NestJS and how do you implement one?Intermediate29How do you use validation groups with class-validator to apply different rules for create vs update operations in NestJS?Intermediate
All Topics
1
Basics
Modules
Controllers
Dependency Injection
Providers
2
Request Lifecycle
Middleware
Guards
Interceptors
Pipes
Filters
Exception Handling
3
Decorators
Architecture
API Design
4
GraphQL
Database and ORM
Microservices
5
Authentication and Authorization
Sharethis topic

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.