NestJS - InterceptorsWhich NestJS interface must a Logging Interceptor implement to work correctly?ACanActivateBPipeTransformCNestInterceptorDExceptionFilterCheck Answer
Step-by-Step SolutionSolution:Step 1: Recall NestJS interceptor interfacesInterceptors implement the NestInterceptor interface.Step 2: Match Logging Interceptor to correct interfaceLogging Interceptor must implement NestInterceptor to intercept requests.Final Answer:NestInterceptor -> Option CQuick Check:Logging Interceptor interface = NestInterceptor [OK]Quick Trick: Logging interceptors implement NestInterceptor interface [OK]Common Mistakes:Choosing CanActivate which is for guardsConfusing with ExceptionFilter for error handlingSelecting PipeTransform which is for data transformation
Master "Interceptors" in NestJS9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallPerf
More NestJS Quizzes Authentication - JWT strategy - Quiz 2easy Database with Prisma - Why Prisma offers type-safe database access - Quiz 14medium Database with TypeORM - Relations (OneToMany, ManyToOne, ManyToMany) - Quiz 5medium Database with TypeORM - Relations (OneToMany, ManyToOne, ManyToMany) - Quiz 6medium Database with TypeORM - Migrations - Quiz 4medium Guards - Role-based guards - Quiz 7medium Guards - Combining multiple guards - Quiz 8hard Interceptors - Cache interceptor - Quiz 5medium Middleware - Functional middleware - Quiz 10hard Pipes - Pipe binding (parameter, method, controller, global) - Quiz 6medium