Spring Boot/Spring WebFlux MCQ OUESTIONS AND ANSWER Sample Test,Sample questions

Question:
 What is a Flux in the context of Spring WebFlux?

1.A data structure holding 0 to N elements.

2.A data processing operation.

3. A type of database.

4. A network protocol.


Question:
 What is the use of Angular Directives?

1. To inject services

2.To initialize component state

3. To manipulate the DOM elements

4.. To store data


Question:
 Which directive is used in Angular to add/remove an HTML element from the DOM based on a condition?

1.ngFor

2.ngSelect

3.ngSwitch

4.ngIf


Question:
Angular is primarily considered as?

1.A JavaScript Framework

2. A CSS Framework

3. A content management system

4.A database system


Question:
How can you bind to an input box value in Angular?

1.Using ngValue

2.Using ngBind

3.Using [(value)]

4. Using [(ngModel)]


Question:
How can you execute a long-running task in a separate thread using WebFlux?

1.publishOn

2.subscribeOn

3.block

4.asyncRun


Question:
How can you fetch data from a server or database in Angular?

1.Using the HTTPModule

2.Using the FetchAPI

3.Using the ServerModule

4.Using the DatabaseModule


Question:
How can you generate a new service using Angular CLI?

1.ng create service my-service

2.ng generate service my-service

3.ng new service my-service

4.ng add service my-service


Question:
How do you bind data to an attribute in Angular?

1.variable

2.variable

3.variable

4.variable


Question:
How do you define a route in Angular?

1. Using <a> tags

2.Using the Router service

3. Using the Routes array

4.Using the @Route() decorator


Question:
How do you fetch data from a server or API in Angular?

1.Using the XMLHttpRequest object

2.Using the HttpClient module

3.Using the fetchData method

4.Using the AjaxModule


Question:
In Angular, which directive is used to apply styles conditionally?

1.ngStyle

2.ngClass

3.ngIf

4.ngApply


Question:
In Spring WebFlux, which component is responsible for handling incoming HTTP requests in a non-blocking manner?

1.WebHandler

2.ReactiveHandler

3.FluxHandler

4.MonoHandler


Question:
In which lifecycle hook is it recommended to send HTTP requests in an Angular component?

1.constructor

2.ngOnInit

3.ngOnDestroy

4.ngAfterViewInit


Question:
What decorator is used to create a service in Angular?

1.Directive

2.Component

3.Injectable

4.Service


Question:
What does a pipe do in Angular?

1.Connects two components

2.Transforms data in the template

3.Merges streams of data

4.Opens a direct connection to the server


Question:
What is a Mono in the context of Spring WebFlux?

1.A data structure holding 0 or 1 element.

2.A data structure holding multiple elements.

3.A data processing operation.

4.A type of database.


Question:
What is the main difference between constructor and ngOnInit in Angular?

1.They serve the same purpose

2.constructor is used for initialization, while ngOnInit is used for destruction

3. constructor is used for dependency injection, while ngOnInit is used for initialization logic

4.ngOnInit is used for dependency injection, while the constructor is used for initialization logic


Question:
What is the primary motivation behind Spring WebFlux?

1.Object-relational mapping

2. MVC pattern

3.Reactive programming

4. Synchronous processing


Question:
What is the primary purpose of NgModules in Angular?

1.Error handling

2.Two-way data binding

3. To group together components, directives, and services that are related

4. To enhance performance


Question:
What is the purpose of the async pipe in Angular?

1.To make asynchronous HTTP requests

2.. To automatically unsubscribe from observables or promises

3.To pause the execution of the application

4. To run change detection asynchronously


Question:
What purpose does the ngModel directive serve?

1.Handling HTTP requests

2.Data binding for both input and output

3.Listening to DOM events

4.Controlling animation


Question:
What's the primary purpose of the ngOnInit lifecycle hook in Angular components?

1.Initialization and data retrieval

2.Destruction of instances

3.Manipulation of the view's DOM

4. Handling of user input


Question:
Which Angular decorator is used for making a class a root module?

1.Module

2.Component

3.Directive

4.NgModule


Question:
Which Angular decorator is used to listen to DOM events?

1.Output

2.Input

3.Event

4.HostListener


Question:
Which annotation is used to define a reactive REST controller in Spring WebFlux?

1.Controller

2.RestController

3.ReactiveController

4.RestControllerFlux


Question:
Which command is used to create a new Angular project?

1.npm create angular-app

2. ng new project-name

3.angular init project-name

4.npm start angular


Question:
Which command is used to install Angular CLI globally?

1.npm install @angular/cli

2.npm global install @angular/cli

3.npm install -g @angular/cli

4.. npm --install @angular/cli


Question:
Which decorator allows communication from a child component to its parent?

1.Input

2.Output

3.ViewChild

4.Connect


Question:
Which decorator allows you to define styles for a component?

1.Style

2.ViewStyle

3.ComponentStyle

4.Component({styles: ...})


Question:
Which decorator in Angular is used to get data from a parent component?

1.Input

2.Output

3.ViewChild

4.GetData


Question:
Which decorator is used to listen to host events in an Angular directive?

1.EventListener

2.HostBinding

3.HostListener

4.Listen


Question:
Which directive is used in Angular to loop through an array or object?

1. ngFor

2.ngIf

3. ngSwitch

4.ngWhile


Question:
Which is the correct syntax for an Angular Event binding?

1.{click}="doSomething()"

2.on-click="doSomething()"

3.(click)="doSomething()"

4.click[]="doSomething()"


Question:
Which module in Angular includes basic directives like ngIf and ngFor?

1.BrowserModule

2.FormsModule

3.AppModule

4.CommonModule


Question:
Which of the following is a core component in an Angular application?

1. ViewController

2.Directive

3.Activity

4.Observer


Question:
Which of the following is a core reactive type in Spring WebFlux?

1.List

2.Set

3.Mono

4.HashMap


Question:
Which of the following is NOT a core component of Spring WebFlux?

1.Mono

2.Flux

3.Callable

4.RouterFunction


Question:
Which of the following methods is used to handle errors in a Subscriber?

1.onSubscribe

2.onNext

3.onError

4.onComplete


Question:
Which reactive type represents a stream of multiple items in WebFlux?

1.Mono

2.Duo

3.Flux

4.ReactiveStream


More MCQS

  1. Spring Boot Common Test
  2. Spring Boot - Bootstrapping
  3. Spring Boot - Logging
  4. Spring Boot - Application Properties
  5. Spring Boot - RESTful Web Services
  6. Spring Boot - Exception Handling
  7. Spring Boot - Interceptor
  8. Spring Boot - File Handling
  9. Spring Boot - CORS
  10. Spring Boot - Internationalization
  11. Spring Boot - Scheduling
  12. Spring MCQs
  13. SPRING BOOT MCQ QUESTIONS
  14. Spring MVC MCQ QUESTIONS AND ANSWER
  15. Spring Cloud MCQ QUESTIONS AND ANSWER
  16. Spring WebFlux MCQ OUESTIONS AND ANSWER
Search
Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!