0% found this document useful (0 votes)
4 views

Angular Node Merged

The document details a quiz completed on the E-Box App, focusing on technology and engineering learning, specifically Node.js and Angular concepts. The participant scored 90% and answered various questions correctly, demonstrating knowledge of asynchronous I/O, Angular components, and routing. It includes a series of questions with correct answers marked, showcasing the user's understanding of relevant programming topics.

Uploaded by

Steve Smith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Angular Node Merged

The document details a quiz completed on the E-Box App, focusing on technology and engineering learning, specifically Node.js and Angular concepts. The participant scored 90% and answered various questions correctly, demonstrating knowledge of asynchronous I/O, Angular components, and routing. It includes a series of questions with correct answers marked, showcasing the user's understanding of relevant programming topics.

Uploaded by

Steve Smith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 110

E-Box App | We Revolutionize Technology and Engineering Learning

Af Persistent

Angular_Node Combined/Angular_Node Combined

°) CONGRATS!!! TOTAL SCORE : 90 %


Congrats !!! You have successfully completed the session :) ...

Quiz Weightage:0 YourScore:90% V7

S.No Questions Score Status

1 Which of the below is/... 1 Correct Answer Check


Answer V

Which of the below is/are true about Node,js.


1) Nodejs internally uses a thread pool to handle Asynchronous I/O
2) Node.js has a single event queue.
3) Node.js has a single call-stack for execution.
~S 4A)Allofthe Above.

2 What is the use of the... 1 Correct Answer Check


Answer V

What is the use of the method stat() in the File System API of Node?
¥ 1)\Itprovides file properties such as size in bytes, creation time, modified time etc.
2) It is used to open a file
3) It is used to read data from the file
4) None of the Above

3 Suppose we have a meth... 1 Correct Answer Check


Answer V

1/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

Suppose we have a method getUsers() which makes an Http request to fetch


a list of users as Observables.
Which of the below is the correct way to subscribe to getUsers()?
1) this.userservice.getUsers().then(response=>{
this.users = response;
»
¥Y 2)this.userservice.getUsers().subscribe(response=>{
this.users = response;
»;
3) this.userservice.getUsers().success(function(response}{
this.users = response;
»;
4) None of the Above

4 Check
Which folder contains... 1 Correct Answer
Answer V

Which folder contains all locally installed NPM modules?


1) node
~Y 2)node_modules
3) NPM
4) Downloads

Check
Suppose we have a clas... 1 Correct Answer
Answer V

2/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

Suppose we have a class defined as below:


export class Userf
name:string;
age:number;

Which of the below when added will make this class an Angular Component?
1) @Component({
selector:'user-app'
}
Y 2)@Component({
selector:'user-app'
template:"<h1>User Component</h1>"
})
3) @Component({
template:'<h1>User Component</h2>'
}'
4) All of the Above

6 Which module enables t... 1 Correct Answer Check


Answer V

Which module enables to start a Node server script in watch mode and
automatically restarts the server incase of changes?
¥ 1)Nodemon
2) Morgan
3) Express
4) Util

Which module is intern... 1 Correct Answer Check


Answer V

3/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

Which module is internally used by mongoose?


1) socket.io
~Y 2)mongodb
3) http
4) express
5) None of the Above

Check
8 Which is the correct w... 1 Correct Answer
Answer V

Which is the correct way to define a function getUsers() that returns an


Observable?
SY 1)getUsers():Observable<any>{

}
2) getUsers():AsObservables<any>{

}
3) getUsers():void{

}
4) None of the Above

Check
9 Which command creates... 1 Correct Answer
Answer Vv

Which command creates a new package.json?


Y 1)npminit
2) npm new
3) npm create
4) npm init ‘package.json’

Check
10 Which directive/tag is... 1 Correct Answer
Answer V

4/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

Which directive/tag is required to load a routed component ?


1) <outlet></outlet>
¥Y 2)<router-outlet></router-outlet>
3) <route-outlet></route-outlet>
4) None of the Above

Check
11 State True or False. W... 1 Correct Answer
Answer V

State True or False. When a service is provided in a module, all its


components get a singleton instance of that service.
~Y 1)TRUE
2) FALSE

12 Which module needs to... 1 Correct Answer Check


Answer V

Which module needs to be imported to work with ngModel?


SY 1)FormsModule
2) BrowserModule
3) HttpModule
4) None of the Above

13 What does the first pa... 1 Correct Answer Check


Answer ¥

5/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

What does the first parameter(param1) in below callback function denote?


fs.readdir(",function(param1,param2)){

}
¥Y = 1)Error object
2) Array of files
3) File Object
4) None of the Above

Check
14 Which of the below dir... 1 Correct Answer
Answer V

Which of the below directive can be used for conditionally displaying an


element?
1) *ngFor
2) *ng-switch
Y 3)*nglif
4) All of the Above

Check
15 Can we send JSON data... 1 Correct Answer
Answer ¥

Can we send JSON data in a websocket connection?


v 1)Yes
2) No

Check
16 Which of the below is/... 1 Correct Answer
Answer V

6/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

Which of the below is/are true about Mocha and Chai?


1) Mochais a unit testing assertion library.
~ 2)Mochacan be used on both client and server side JavaScript testing.
3) Chai library is used only for testing Asynchronous functions.
4) All of the Above

Check
17 Suppose we have a comp... 1 Correct Answer
Answer V

Suppose we have a component class defined as below that injects MyService.


export class MyComponent{
items:string|];
constructor(myservice:MyService){
this.items = myservice.getltems();

}
Which is the correct way to specify the providers for MyService?
1) @Component({
---//other properties
providers:['MyService’]
}'
Y 2)@Component({
---//other properties
providers:[MyService]
y'
3) @Component({
---//other properties
services:[MyService]
y'
4) None of the Above

Check
18 Select the correct mon... 1 Correct Answer
Answer V

7/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

Select the correct mongodb API to retrieve all records from the MongoDb
database from Node script?
1) fetch()
vY 2)find()
3) findByld()
4) findAIK)

Check
19 Which of the below pro... 1 Correct Answer
Answer V

Which of the below property of NgModel would help us to check the form
controls validity only on blur event?
1) dirty
2) .errors
~¥ 3).touched
4) None of the Above

Check
20 Assume an HTTP request... 1 Correct Answer
Answer V

Assume an HTTP request is made in the below method getUsers() by using


Observables with RxJs.
getUsers(): <return type>

return this.http.get(‘https://jsonplaceholder.typicode.com/users');

Select the correct return type of this method to be replaced in the blank
space?
1) Array<Object>
2) Object
~ 3) Observable<any>
4) None of the Above

Check
21 Which of the below is/.. 1 Correct Answer
Answer V

8/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

Which of the below is/are not good use cases for Node.js?
¥ 1)CPU intensive applications.
2) I/O bound Applications
3) Data Streaming Applications
4) Data Intensive Real time Applications (DIRT)
5) JSON APIs based Applications

Check
22 Which is the correct w... 0 Wrong Answer
Answer V

Which is the correct way to define routerlink having static value of 'users'?
1) <a routerLink="Users|lowercase">Users</a>
¥Y 2)<arouterLink="users">Users</a>
% 3) <a [routerLink]="Users">Users</a>
4) All of the Above

Check
23 Which of the below is... 1 Correct Answer
Answer V

Which of the below is true about Typescript code?


¥Y 1)Atranspiled JS file does not contain data types of variables defined in the original
typescript file
2) Defining a type for a variable is mandatory in typescript
3) It is not possible to export only a single function from a typescript class
4) All of the Above

Check
24 Which of the below met... 1 Correct Answer
Answer V

9/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

Which of the below methods will have a callback?

1) fs.readFileSync() where fs is a reference to file system.


~Y 2)/fs.readdir() where fs is a reference to file system.
Y 3) modelObj.save() where modelObj is a mongoose model object
4) All of the Above

Check
25 Which of the below is ... 1 Correct Answer
Answer V

Which of the below is the correct code snippet to specify Routing


configuration to Router.forRoot().
SY 1)const appRoutes: Routes =[
{ path: 'crisis-center’, component: CrisisListComponent },
{ path: 'heroes', component: HeroListComponent}
1]
2) const appRoutes: Routes ={
{ path: 'crisis-center’, component: CrisisListComponent },
{ path: 'heroes', component: HeroListComponent}
}
3) const appRoutes: Routes =[
[ path: 'crisis-center’, component: CrisisListComponent ],
[ path: 'heroes', component: HeroListComponent]
1]
4) const appRoutes: Routes ={
[ path: 'crisis-center’, component: CrisisListComponent ],
[ path: 'heroes’, component: HeroListComponent]
}

Check
26 Which of the below are... 1 Correct Answer
Answer V

10/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

Which of the below are valid NPM commands?


1) A.) npm init
2) B.) npm install <module> -g
3) C.) npm install <module> --save
4) OnlyA&B
¥ 5)Allof the Above

Check
27 Which is the correct b... 1 Correct Answer
Answer V

Which is the correct block of code to handle routes which are invalid for an
application (404 status)?
Y 1)app.use(function(request,response){
response.status(404).send("Page cannot be found");
»s
2) app.get(" function(request,response,next){
response.status(404).send("Page cannot be found");
);
3) app.get(/function(error,request,response,next){
response.status(404).send("Page cannot be found");
};
4) app.use(function(error,request,response,next){
response.status(404).send("Page cannot be found");
y:

Check
28 Which of the below is... 1 Correct Answer
Answer V

Which of the below is the right way to define a template reference variable
named "testval" for an input box?
¥ 1)<input type="text" #testval (keyup)="0" />
2) <input type="text" testval (keyup)="0" />
3) <input type="text" (testval) (keyup)="0" />

Check
29 Which of the below is... 0 Wrong Answer
Answer V

11/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

Which of the below is a valid form control directive that provides validity
properties for an input box?
% = 1)ngform
2) ngmodel
3) ngModel
4) None of the Above

30 Select the correct adv... 1 Correct Answer Check


Answer V

Select the correct advantage(s) of Node.js over other server side


technologies.
¥Y 1)Asynchronous I/O
2) Ability to handle HTTP requests
3) Ability to connect to MongoDb
4) All of the Above

31 Which service has to b... 0 Wrong Answer Check


Answer V

Which service has to be injected to programmatically change the route of an


application?
1) RouterModule
2) Router
% = 3)router
4) None of the Above

32 Which property of the... 1 Correct Answer Check


Answer V

12/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

Which property of the request object in Express framework helps to retrieve


the query parameters?
1) params
¥Y 2)query
3) routeParams
4) None of the Above

33 Which of the below ann... 1 Correct Answer Check


Answer V

Which of the below annotation can be applied to class variables?


SY 1) @Output()
2) @Component
3) @Event()
4) All of the Above

34 Which of the below ann... 1 Correct Answer Check


Answer V

Which of the below annotation enables a child component to get data froma
parent component?

1) @Output
¥ 2)@Input
3) @Event
4) @Data

35 Which of the below is... 1 Correct Answer Check


Answer V

13/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

Which of the below is a correct way to handle get requests for the url users’
?Assume ‘app’ is a valid express server instance.
¥ 1) app.get('/users'function(request,response){

}
2) app.get(‘users'function(request,response){

}
3) app.route(/users'function(request,response){

}
4) None of the Above

Check
36 Which of the below is... 1 Correct Answer
Answer V

Which of the below is a valid property of the @Component()?


1) imports
2) declarations
# 3)selector
4) None of the Above

Check
37 Which of the below ope... 1 Correct Answer
Answer V

Which of the below operations in Node is/are executed in an asynchronous


manner?
1) A.) setInterval()
2) B.) fs.mkdir()
3) C.) fs.stat()
4) B&C
~ 5)All ofthe Above A,B &C

Check
38 What is/are advantages... 1 Correct Answer
Answer V

14/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

What is/are advantages of WebSockets over HTTP?


<Y 1)WebSockets provide a bidirectional channel between client and server for
exchanging data
2) WebSockets enable to cache data.
3) WebSockets are secure over HTTP.
4) All of the Above

39 Which of the below is... 0 Wrong Answer Check


Answer V

Which of the below is true about RxJS?


% = 1) Itis part of Angular bundles
2) It is loaded in the Angular project by default
¥ 3) Itisa library that implements Observables
4) All of the Above

40 Which NPM command inst... 1 Correct Answer Check


Answer V

Which NPM command installs all the Node dependencies listed in


package.json?
1) npm init
¥Y 2)npm install
3) npm install package.json
4) npm install -g

Check
41 Which module needs to... 1 Correct Answer
Answer V

15/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

Which module needs to be imported in order to work with two way data
binding?
¥Y 1)FormsModule
2) HttpModule
3) BrowserModule
4) Nothing to be imported

42 Select the correct Mon... 1 Correct Answer Check


Answer V

Select the correct Mongodb/Mongoose module to retrieve all records from


the database?
1) fetch(callback)
2) query((},callback)
<S = 3) find({},callback)
4) All of the Above

43 Interpolation is an ex... 1 Correct Answer Check


Answer V

Interpolation is an example of
SY 1)One way binding
2) Two way binding

44 What is the use of the... 1 Correct Answer Check


Answer V

What is the use of the module 'bodyParser'?


¥Y 1)Itis useful to parse the request body.
2) It is used for validating the input from client side.
3) It is useful for logging HTTP requests.
4) All of the Above

16/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

Check
45 Which is the right way... 1 Correct Answer
Answer V

Which is the right way to access query parameter 'empName' in a route


handler in an Express script?
¥ 1)request.query.empName
2) request.empName
3) request.params.empName
4) request.query.params.empName

Check
46 Which of the below doe... 1 Correct Answer
Answer V

Which of the below does the file 'package.json' contain?


1) It contains the name of the file that is loaded first when the Angular application is
loaded.
2) It has a list of Angular dependencies required by the application
3) It has typescript specific settings needed by the application
4) All of the Above

Check
47 What is the significan... 1 Correct Answer
Answer Vv

What is the significance of the property 'imports' for the annotation


@NgModule?
1) It contains list of all angular core components
v 2) It contains list of other modules required by a module
3) It contains list of all angular inbuilt directives
4) None of the Above

Check
48 Which of the below fla... 0 Wrong Answer
Answer V

17/18
E-Box App | We Revolutionize Technology and Engineering Learning

S.No Questions Score Status

Which of the below flavours of assertions are supported by Chai?


1) A.) should
2) B.) expect
3) C.) assert
% 4)A&B
5) All of the Above A,B &C

49 Which of the below is/... 1 Correct Answer Check


Answer V

Which of the below is/are a form validation(s) property in Angular?


1) dirty
2) valid
3) .touched
¥ 4)Allof the Above

50 Which of the below ste... 1 Correct Answer Check


Answer V

Which of the below step(s) are required to render views/templates from an


Express Server?
1) Install Express
2) Set the view engine for the Express instance
3) Keep all view files in the folder "views"
¥ 4)Allof the Above

18/18
  CS Chirag Sahuji 

Angular_Node Combined/Angular_Node Combined

 CONGRATS!!! TOTAL SCORE : 88 %


Congrats !!! You have successfully completed the session :) ...

Quiz Weightage : 0 Your Score : 88 %


S.No Questions Score Status

Check
1 Can we send JSON data ... 1 Correct Answer Answer

Can we send JSON data in a websocket connection?


 1) Yes
2) No

Check
2 Select the correct adv... 1 Correct Answer Answer

Select the correct advantage(s) of Node.js over other server side


technologies.
 1) Asynchronous I/O
2) Ability to handle HTTP requests
3) Ability to connect to MongoDb
4) All of the Above

Check
3 Which of the below met... 1 Correct Answer Answer

S.No Questions Score Status

Which of the below methods will have a callback?


1) fs.readFileSync() where fs is a reference to file system.
 2) fs.readdir() where fs is a reference to file system.
 3) modelObj.save() where modelObj is a mongoose model object
4) All of the Above

Check
4 Which of the below ann... 1 Correct Answer Answer

Which of the below annotation can be applied to class variables?


 1) @Output()
2) @Component
3) @Event()
4) All of the Above

Check
5 Suppose we have a meth... 1 Correct Answer Answer

Suppose we have a method getUsers() which makes an Http request to fetch a


list of users as Observables.
Which of the below is the correct way to subscribe to getUsers()?
1) this.userservice.getUsers().then(response=>{
this.users = response;
});
 2) this.userservice.getUsers().subscribe(response=>{
this.users = response;
});
3) this.userservice.getUsers().success(function(response){
this.users = response;
});
4) None of the Above

Check
6 Which of the below is/... 1 Correct Answer Answer

S.No Questions Score Status

Which of the below is/are a valid CSS classes provided by Angular that
reflects validity of form controls?
 1) .ng-valid
2) .valid
3) .ng-error
4) All of the Above

Check
7 Suppose a MovieCard co... 1 Correct Answer Answer

Suppose a MovieCard component is defined with selector as 'movie-card' and


used as below.
<movie-card [movie]="movie" type="movie"></movie-card>
Which of the below is the valid way to define the 'movie' object in the
MovieCard Component class?
1) @Input
movie:Object;'
 2) @Input()
movie:Object;'
3) @Output()
movie:Object';
4) movie:Object;

Check
8 Which is the correct b... 0 Wrong Answer Answer

S.No Questions Score Status

Which is the correct block of code to handle routes which are invalid for an
application (404 status)?
1) app.use(function(request,response){
response.status(404).send("Page cannot be found");
});
 2) app.get('**',function(request,response,next){
response.status(404).send("Page cannot be found");
});
3) app.get('/',function(error,request,response,next){
response.status(404).send("Page cannot be found");
});
4) app.use(function(error,request,response,next){
response.status(404).send("Page cannot be found");
});

Check
9 Lets say a custom comp... 1 Correct Answer Answer

Lets say a custom component is created with name, "Products" defined in file
"Products.component.ts".
Which of the below correctly registers this component to the root module
"AppModule" defined as below?
@NgModule({
imports:[ BrowserModule],
declarations: [ ],
bootstrap:[AppComponent]
})
export class AppModule { }
 1) declarations:[Products]
2) declarations:["Products"]
3) imports:[BrowserModule,Products]
4) None of the Above

Check
10 Suppose we have the be... 1 Correct Answer Answer

S.No Questions Score Status

Suppose we have the below code in a file 'math.js'.


function square(num){
//logic to calculate square of num
}
Which statement needs to be added so that the function 'square()' be made
available to other module files?
1) It cannot be exported since its scope is restricted only to this file.
2) No changes to be made. It is available by default.
 3) module.exports.square = square;
4) module.square = square;

Check
11 Which of the following... 1 Correct Answer Answer

Which of the following is true about Node.js?


1) Node.js is a scripting language
2) Node.js is a client side Javascript framework
 3) Node.js is platform / runtime to run javascript code outside of the browser
4) Node.js is server side high level programming language

Check
12 What is/are advantages... 1 Correct Answer Answer

What is/are advantages of WebSockets over HTTP?


 1) WebSockets provide a bidirectional channel between client and server for
exchanging data
2) WebSockets enable to cache data.
3) WebSockets are secure over HTTP.
4) All of the Above

Check
13 Which is the correct w... 1 Correct Answer Answer

S.No Questions Score Status

Which is the correct way to define routerlink having static value of 'users'?
 1) <a routerLink="Users|lowercase">Users</a>
 2) <a routerLink="users">Users</a>
3) <a [routerLink]="Users">Users</a>
4) All of the Above

Check
14 Which of the below is ... 1 Correct Answer Answer

Which of the below is true about Typescript code?


1) Typescript comes with Node installation
2) Javascript is a superset of Typescript
 3) The process of converting typescript files into javascript is called as transpiling
4) All of the Above

Check
15 Which of the following... 1 Correct Answer Answer

Which of the following is the valid import to inject the HttpClient service that
enables to make HTTP requests?
1) import {HttpModule} from '@angular/core'
 2) import {HttpClient} from '@angular/common/http'
3) import {HttpClient} from 'rxjs'
4) None of the Above

Check
16 For the below method c... 1 Correct Answer Answer

S.No Questions Score Status

For the below method call which statement is true? Assume 'fs' refers to file
system module.
fs.readFileSync()
1) The method takes a callback as parameter.
 2) The method takes a file path as parameter.
3) The method emits inbuilt stream events.
4) All of the Above.

Check
17 Which is the correct w... 1 Correct Answer Answer

Which is the correct way to define a function getUsers() that returns an


Observable?
 1) getUsers():Observable<any>{

}
2) getUsers():AsObservables<any>{

}
3) getUsers():void{

}
4) None of the Above

Check
18 What is the use of the... 1 Correct Answer Answer

What is the use of the module 'bodyParser'?


 1) It is useful to parse the request body.
2) It is used for validating the input from client side.
3) It is useful for logging HTTP requests.
4) All of the Above

Check
19 Which module enables t... 1 Correct Answer Answer

S.No Questions Score Status

Which module enables to start a Node server script in watch mode and
automatically restarts the server incase of changes?
 1) Nodemon
2) Morgan
3) Express
4) Util

Check
20 Which of the below is ... 0 Wrong Answer Answer

Which of the below is a valid route mapping definition that loads


MenuComponent when user navigates to '/menu'?
 1) {
path:'/menu',
component:'MenuComponent'
}
2) {
path:'menu',
componentName:'MenuComponent'
}
3) {
path:'menu',
component:MenuComponent
}
4) All of the Above

Check
21 Which of the below pro... 1 Correct Answer Answer

Which of the below property of NgModel would help us to check the form
controls validity only on blur event?
1) .dirty
2) .errors
 3) .touched
4) None of the Above
S.No Questions Score Status

Check
22 Which of the below is ... 1 Correct Answer Answer

Which of the below is true about template reference variables?


 1) Template reference variable can be accessed anywhere in the template
2) Template reference variables need to be initialized in the class constructor
3) Template reference variables are useful only for <input> elements.
4) All of the Above

Check
23 Which of the below fla... 1 Correct Answer Answer

Which of the below flavours of assertions are supported by Chai?


1) A.) should
2) B.) expect
3) C.) assert
4) A&B
 5) All of the Above A,B &C

Check
24 Which of the below is ... 1 Correct Answer Answer

Which of the below is the correct way to bind an input box to a variable
'phone' using two-way data binding?Assume the corresponding component
class already has a variable 'phone' defined.
 1) <input type="text" [(ngModel)]="phone" >
2) <input type="text" [(ngModel)]=phone >
3) <input type="text" ngModel="phone" >
4) None of the Above

Check
25 Which of the below ope... 1 Correct Answer Answer

S.No Questions Score Status

Which of the below operations in Node is/are executed in an asynchronous


manner?
1) A.) setInterval()
2) B.) fs.mkdir()
3) C.) fs.stat()
4) B&C
 5) All of the Above A,B &C

Check
26 Which of the below dir... 1 Correct Answer Answer

Which of the below directive can be used for conditionally displaying an


element?
1) *ngFor
2) *ng-switch
 3) *ngIf
4) All of the Above

Check
27 Which module is intern... 1 Correct Answer Answer

Which module is internally used by mongoose?


1) socket.io
 2) mongodb
3) http
4) express
5) None of the Above

Check
28 Which of the below is ... 0 Wrong Answer Answer

S.No Questions Score Status

Which of the below is true about Typescript code?


1) A transpiled JS file does not contain data types of variables defined in the original
typescript file
 2) Defining a type for a variable is mandatory in typescript
3) It is not possible to export only a single function from a typescript class
4) All of the Above

Check
29 What is the use of the... 1 Correct Answer Answer

What is the use of the method stat() in the File System API of Node?
 1) It provides file properties such as size in bytes, creation time, modified time etc.
2) It is used to open a file
3) It is used to read data from the file
4) None of the Above

Check
30 State True or False. S... 1 Correct Answer Answer

State True or False. Service cannot be injected in another service.


1) TRUE
 2) FALSE

Check
31 Select the correct Mon... 1 Correct Answer Answer

Select the correct Mongodb/Mongoose module to retrieve all records from


the database?
1) fetch(callback)
2) query({},callback)
 3) find({},callback)
4) All of the Above
S.No Questions Score Status

Check
32 Which below statement ... 0 Wrong Answer Answer

Which below statement will be used to send the response of 'userdata'


containing array of users from a RESTful Node server?
1) response.render(userdata)
 2) response.send(userdata)
3) response.json(userdata)
4) Any of the Above

Check
33 Which module needs to ... 1 Correct Answer Answer

Which module needs to be imported in order to work with two way data
binding?
 1) FormsModule
2) HttpModule
3) BrowserModule
4) Nothing to be imported

Check
34 Which of the below is/... 1 Correct Answer Answer

Which of the below is/are not good use cases for Node.js?
 1) CPU intensive applications.
2) I/O bound Applications
3) Data Streaming Applications
4) Data Intensive Real time Applications (DIRT)
5) JSON APIs based Applications

Check
35 Which is the correct w... 1 Correct Answer Answer

S.No Questions Score Status

Which is the correct way to define routerlink having static value of 'users'?
1) A.) <a routerLink="Users|lowercase">Users</a>
2) B.) <a routerLink="users">Users</a>
3) C.) <a [routerLink]="Users">Users</a>
 4) A & B
5) All of the A ,B & C

Check
36 Which of the below is ... 1 Correct Answer Answer

Which of the below is a valid form control directive that provides validity
properties for an input box?
1) ngform
2) ngmodel
 3) ngModel
4) None of the Above

Check
37 What does the first pa... 1 Correct Answer Answer

What does the first parameter(param1) in below callback function denote?


fs.readdir('.',function(param1,param2)){
}
 1) Error object
2) Array of files
3) File Object
4) None of the Above

Check
38 Which is the correct w... 1 Correct Answer Answer

S.No Questions Score Status

Which is the correct way to set "MyComponent" as the Root component in


'@NgModule'.
1) @NgModule({
bootstrap:'MyComponent'
})
 2) @NgModule({
bootstrap:[MyComponent]
})
3) @NgModule({
import:[MyComponent]
})
4) None of the Above

Check
39 Which property of the ... 1 Correct Answer Answer

Which property of the request object in Express framework helps to retrieve


the query parameters?
1) params
 2) query
3) routeParams
4) None of the Above

Check
40 What is the significan... 1 Correct Answer Answer

What is the significance of the property 'imports' for the annotation


@NgModule?
1) It contains list of all angular core components
 2) It contains list of other modules required by a module
3) It contains list of all angular inbuilt directives
4) None of the Above

Check
41 State True or False. W... 1 Correct Answer Answer

S.No Questions Score Status

State True or False. When a service is provided in a module, all its


components get a singleton instance of that service.
 1) TRUE
2) FALSE

Check
42 Which service has to b... 0 Wrong Answer Answer

Which service has to be injected to programmatically change the route of an


application?
1) RouterModule
2) Router
 3) router
4) None of the Above

Check
43 For the below route ha... 1 Correct Answer Answer

For the below route handler written using Express, how can we fetch the
query parameter 'pid'?
app.get('/product',function(req,res){
//Access query parameter 'pid' here.
});
 1) req.query.pid
2) req.params.pid
3) req.params['pid']
4) req.get('pid')

Check
44 Which of the below are... 1 Correct Answer Answer

S.No Questions Score Status

Which of the below are valid NPM commands?


1) A.) npm init
2) B.) npm install <module> -g
3) C.) npm install <module> --save
4) Only A & B
 5) All of the Above

Check
45 Which of the below is/... 1 Correct Answer Answer

Which of the below is/are true about Node.js.


1) Node.js internally uses a thread pool to handle Asynchronous I/O
2) Node.js has a single event queue.
3) Node.js has a single call-stack for execution.
 4) All of the Above.

Check
46 Which of the below is ... 0 Wrong Answer Answer

Which of the below is a valid example of property binding used on the


'disabled' property?
 1) <input type="submit" [disabled]="true" />
2) <input type="submit" [disabled]=true />
3) <input type="submit" [disabled]="submitflag" />
where 'submitflag' is a variable declared in the component's class.
4) All of the Above

Check
47 Which of the below is ... 1 Correct Answer Answer

S.No Questions Score Status

Which of the below is a correct way to handle get requests for the url '/users'
?Assume 'app' is a valid express server instance.
 1) app.get('/users',function(request,response){

}
2) app.get('users',function(request,response){

}
3) app.route('/users',function(request,response){

}
4) None of the Above

Check
48 Which of the below is/... 1 Correct Answer Answer

Which of the below is/are true about Mocha and Chai?


1) Mocha is a unit testing assertion library.
 2) Mocha can be used on both client and server side JavaScript testing.
3) Chai library is used only for testing Asynchronous functions.
4) All of the Above

Check
49 Select the correct mon... 1 Correct Answer Answer

Select the correct mongodb API to retrieve all records from the MongoDb
database from Node script?
1) fetch()
 2) find()
3) findById()
4) findAll()

Check
50 Suppose we have the be... 1 Correct Answer Answer

S.No Questions Score Status

Suppose we have the below code snippet where LoginComponent(login) is a


child of MyAppComponent(myapp) and it passes a value 'uname' to it.
<myapp>
<login [name]="uname"></login>
</myapp>

How will 'name' property be defined in the Login Component class?


1) name:string;
 2) @Input()
name:string;
3) @Output
name:string;
4) @Subject()
name:string;

Go To Home
5/24/22, 6:43 PM Course

  SG Sahil Gupta 

Angular_Node Combined/Angular_Node Combined

 CONGRATS!!! TOTAL SCORE : 72 %


Congrats !!! You have successfully completed the session :) ...

Quiz Weightage : 0 Your Score : 72 %


S.No Questions Score Status

Check
1 Which of the below fla... 1 Correct Answer Answer

Which of the below flavours of assertions are supported by Chai?


1) A.) should
2) B.) expect
3) C.) assert
4) A&B
 5) All of the Above A,B &C

Check
2 What is the use of the... 1 Correct Answer Answer

What is the use of the module 'bodyParser'?


 1) It is useful to parse the request body.
2) It is used for validating the input from client side.
3) It is useful for logging HTTP requests.
4) All of the Above

Check
3 Which of the below are... 1 Correct Answer Answer

https://persistentpro.e-box.co.in/finish/177913 1/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

Which of the below are features of Routing?


1) Enables to make the application Single Page
2) Application is not reloaded for every user action
3) Components are loaded based on URL change
 4) All of the Above

Check
4 Can we send JSON data ... 1 Correct Answer Answer

Can we send JSON data in a websocket connection?


 1) Yes
2) No

Check
5 Which of the below is ... 1 Correct Answer Answer

Which of the below is a valid form control directive that provides validity
properties for an input box?
1) ngform
2) ngmodel
 3) ngModel
4) None of the Above

Check
6 Which of the below is/... 1 Correct Answer Answer

Which of the below is/are true about Mocha and Chai?


1) Mocha is a unit testing assertion library.
 2) Mocha can be used on both client and server side JavaScript testing.
3) Chai library is used only for testing Asynchronous functions.
4) All of the Above

https://persistentpro.e-box.co.in/finish/177913 2/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

Check
7 Which module is intern... 1 Correct Answer Answer

Which module is internally used by mongoose?


1) socket.io
 2) mongodb
3) http
4) express
5) None of the Above

Check
8 Which of the below dir... 1 Correct Answer Answer

Which of the below directive can be used for conditionally displaying an


element?
1) *ngFor
2) *ng-switch
 3) *ngIf
4) All of the Above

Check
9 State True or False. W... 1 Correct Answer Answer

State True or False. When a service is provided in a module, all its


components get a singleton instance of that service.
 1) TRUE
2) FALSE

Check
10 Which of the below is ... 1 Correct Answer Answer

https://persistentpro.e-box.co.in/finish/177913 3/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

Which of the below is the right way to install the module "nodemon" so
that it can be executed as a command line tool?
 1) npm install nodemon -g
2) npm install nodemon
3) npm install nodemon --save
4) npm install nodemon -dev

Check
11 Which command creates ... 1 Correct Answer Answer

Which command creates a new package.json?


 1) npm init
2) npm new
3) npm create
4) npm init 'package.json'

Check
12 Which of the below is ... 0 Wrong Answer Answer

Which of the below is true about RxJS?


1) It is part of Angular bundles
2) It is loaded in the Angular project by default
 3) It is a library that implements Observables
4) All of the Above

Check
13 Which of the below is ... 0 Wrong Answer Answer

https://persistentpro.e-box.co.in/finish/177913 4/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

Which of the below is true about Typescript code?


1) A transpiled JS file does not contain data types of variables defined in the
original typescript file
2) Defining a type for a variable is mandatory in typescript
3) It is not possible to export only a single function from a typescript class
 4) All of the Above

Check
14 Which module needs to ... 0 Wrong Answer Answer

Which module needs to be imported in order to work with two way data
binding?
1) FormsModule
2) HttpModule
3) BrowserModule
 4) Nothing to be imported

Check
15 Which property of the ... 1 Correct Answer Answer

Which property of the request object in Express framework helps to


retrieve the query parameters?
1) params
 2) query
3) routeParams
4) None of the Above

Check
16 Select the correct mon... 1 Correct Answer Answer

https://persistentpro.e-box.co.in/finish/177913 5/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

Select the correct mongodb API to retrieve all records from the MongoDb
database from Node script?
1) fetch()
 2) find()
3) findById()
4) findAll()

Check
17 Select the correct adv... 1 Correct Answer Answer

Select the correct advantage(s) of Node.js over other server side


technologies.
 1) Asynchronous I/O
2) Ability to handle HTTP requests
3) Ability to connect to MongoDb
4) All of the Above

Check
18 Which of the below ste... 0 Wrong Answer Answer

Which of the below step(s) are required to render views/templates from


an Express Server?
1) Install Express
2) Set the view engine for the Express instance
 3) Keep all view files in the folder "views"
4) All of the Above

Check
19 For the below route ha... 1 Correct Answer Answer

https://persistentpro.e-box.co.in/finish/177913 6/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

For the below route handler written using Express, how can we fetch the
query parameter 'pid'?
app.get('/product',function(req,res){
//Access query parameter 'pid' here.
});
 1) req.query.pid
2) req.params.pid
3) req.params['pid']
4) req.get('pid')

Check
20 Suppose we have a clas... 1 Correct Answer Answer

Suppose we have a class defined as below:


export class User{
name:string;
age:number;
}
Which of the below when added will make this class an Angular
Component?
1) @Component({
selector:'user-app'
})'
 2) @Component({
selector:'user-app'
template:''<h1>User Component</h1>"
})
3) @Component({
template:'<h1>User Component</h2>'
})'
4) All of the Above

Check
21 Which of the below is/... 0 Wrong Answer Answer

https://persistentpro.e-box.co.in/finish/177913 7/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

Which of the below is/are a valid CSS classes provided by Angular that
reflects validity of form controls?
1) .ng-valid
2) .valid
3) .ng-error
 4) All of the Above

Check
22 Which event needs to b... 1 Correct Answer Answer

Which event needs to be handled in Node Websocket server, when a new


websocket request is initiated by a browser?
1) connect
 2) connection
3) init
4) socket
5) None of the Above

Check
23 Which of the below is ... 1 Correct Answer Answer

Which of the below is a valid property of the @Component()?


1) imports
2) declarations
 3) selector
4) None of the Above

Check
24 Which module enables t... 1 Correct Answer Answer

https://persistentpro.e-box.co.in/finish/177913 8/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

Which module enables to start a Node server script in watch mode and
automatically restarts the server incase of changes?
 1) Nodemon
2) Morgan
3) Express
4) Util

Check
25 Which of the below is ... 1 Correct Answer Answer

Which of the below is the right way to define a template reference


variable named "testval" for an input box?
 1) <input type="text" #testval (keyup)="0" />
2) <input type="text" testval (keyup)="0" />
3) <input type="text" (testval) (keyup)="0" />

Check
26 Which of the below is/... 1 Correct Answer Answer

Which of the below is/are a form validation(s) property in Angular?


1) .dirty
2) .valid
3) .touched
 4) All of the Above

Check
27 Which below statement ... 0 Wrong Answer Answer

https://persistentpro.e-box.co.in/finish/177913 9/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

Which below statement will be used to send the response of 'userdata'


containing array of users from a RESTful Node server?
1) response.render(userdata)
 2) response.send(userdata)
3) response.json(userdata)
4) Any of the Above

Check
28 Select the correct adv... 1 Correct Answer Answer

Select the correct advantage(s) of Node.js over other server side


technologies.
 1) Asynchronous I/O
2) Ability to handle HTTP requests
3) Ability to connect to MongoDb
4) All of the Above

Check
29 Which of the following... 1 Correct Answer Answer

Which of the following is true about Node.js?


1) Node.js is a scripting language
2) Node.js is a client side Javascript framework
 3) Node.js is platform / runtime to run javascript code outside of the browser
4) Node.js is server side high level programming language

Check
30 Which of the below is ... 1 Correct Answer Answer

https://persistentpro.e-box.co.in/finish/177913 10/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

Which of the below is a valid Typescript code snippet?


1) class Person{
string:username;
string:password;
changeUsername(name){
this.username=name;
}
}
 2) class Person{
username:string;
password:string;
changeUsername(name){
this.username=name;
}
}
3) class Person{
username:string;
password:string;
changeUsername(name){
username=name;
}
}
4) All of the Above

Check
31 Which of the below met... 1 Correct Answer Answer

Which of the below methods will have a callback?


1) fs.readFileSync() where fs is a reference to file system.
 2) fs.readdir() where fs is a reference to file system.
 3) modelObj.save() where modelObj is a mongoose model object
4) All of the Above

Check
32 What is the return typ... 1 Correct Answer Answer

https://persistentpro.e-box.co.in/finish/177913 11/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

What is the return type of a get() call made using the HttpClient service for
an Http GET request?
 1) Observable
2) Array
3) JSON
4) Object

Check
33 Which NPM command inst... 1 Correct Answer Answer

Which NPM command installs all the Node dependencies listed in


package.json?
1) npm init
 2) npm install
3) npm install package.json
4) npm install -g

Check
34 Which of the below is/... 1 Correct Answer Answer

Which of the below is/are valid structural directive(s)?


1) ngModel
 2) *ngIf
 3) *ngFor
4) *ngRepeat

Check
35 What is the use of the... 0 Wrong Answer Answer

https://persistentpro.e-box.co.in/finish/177913 12/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

What is the use of the method stat() in the File System API of Node?
1) It provides file properties such as size in bytes, creation time, modified time
etc.
2) It is used to open a file
 3) It is used to read data from the file
4) None of the Above

Check
36 Which of the below is ... 1 Correct Answer Answer

Which of the below is the correct code snippet to specify Routing


configuration to Router.forRoot().
 1) const appRoutes: Routes = [
{ path: 'crisis-center', component: CrisisListComponent },
{ path: 'heroes', component: HeroListComponent }
];
2) const appRoutes: Routes ={
{ path: 'crisis-center', component: CrisisListComponent },
{ path: 'heroes', component: HeroListComponent }
};
3) const appRoutes: Routes =[
[ path: 'crisis-center', component: CrisisListComponent ],
[ path: 'heroes', component: HeroListComponent ]
];
4) const appRoutes: Routes ={
[ path: 'crisis-center', component: CrisisListComponent ],
[ path: 'heroes', component: HeroListComponent ]
};

Check
37 Which of the following... 1 Correct Answer Answer

https://persistentpro.e-box.co.in/finish/177913 13/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

Which of the following is the valid import to inject the HttpClient service
that enables to make HTTP requests?
1) import {HttpModule} from '@angular/core'
 2) import {HttpClient} from '@angular/common/http'
3) import {HttpClient} from 'rxjs'
4) None of the Above

Check
38 Which of the below ann... 0 Wrong Answer Answer

Which of the below annotation can be applied to class variables?


1) @Output()
 2) @Component
3) @Event()
4) All of the Above

Check
39 Select the correct Mon... 1 Correct Answer Answer

Select the correct Mongodb/Mongoose module to retrieve all records


from the database?
1) fetch(callback)
2) query({},callback)
 3) find({},callback)
4) All of the Above

Check
40 Which of the below is ... 1 Correct Answer Answer

https://persistentpro.e-box.co.in/finish/177913 14/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

Which of the below is true about template reference variables?


 1) Template reference variable can be accessed anywhere in the template
2) Template reference variables need to be initialized in the class constructor
3) Template reference variables are useful only for <input> elements.
4) All of the Above

Check
41 What is the significan... 1 Correct Answer Answer

What is the significance of the property 'imports' for the annotation


@NgModule?
1) It contains list of all angular core components
 2) It contains list of other modules required by a module
3) It contains list of all angular inbuilt directives
4) None of the Above

Check
42 Which service has to b... 0 Wrong Answer Answer

Which service has to be injected to programmatically change the route of


an application?
 1) RouterModule
2) Router
3) router
4) None of the Above

Check
43 State True or False. S... 1 Correct Answer Answer

State True or False. Service cannot be injected in another service.


1) TRUE
 2) FALSE

https://persistentpro.e-box.co.in/finish/177913 15/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

Check
44 Which NPM command inst... 1 Correct Answer Answer

Which NPM command installs all the Node dependencies listed in


package.json?
1) npm init
 2) npm install
3) npm install package.json
4) npm install -g

Check
45 Suppose a MovieCard co... 0 Wrong Answer Answer

Suppose a MovieCard component is defined with selector as 'movie-card'


and used as below.
<movie-card [movie]="movie" type="movie"></movie-card>
Which of the below is the valid way to define the 'movie' object in the
MovieCard Component class?
1) @Input
movie:Object;'
2) @Input()
movie:Object;'
3) @Output()
movie:Object';
 4) movie:Object;

Check
46 Suppose we have the be... 0 Wrong Answer Answer

https://persistentpro.e-box.co.in/finish/177913 16/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

Suppose we have the below code snippet where LoginComponent(login) is


a child of MyAppComponent(myapp).
<myapp>
<login [name]="uname"></login>
</myapp>
How will 'name' property be defined in the Login Component class?
 1) name:string;
2) @Input()
name:string;
3) @Output
name:string;
4) @Subject()
name:string;
5) None of the Above

Check
47 Which is the right way... 0 Wrong Answer Answer

Which is the right way to access query parameter 'empName' in a route


handler in an Express script?
1) request.query.empName
2) request.empName
 3) request.params.empName
4) request.query.params.empName

Check
48 Which is the correct w... 0 Wrong Answer Answer

Which is the correct way to define routerlink having static value of 'users'?
1) A.) <a routerLink="Users|lowercase">Users</a>
 2) B.) <a routerLink="users">Users</a>
3) C.) <a [routerLink]="Users">Users</a>
4) A & B
5) All of the A ,B & C

https://persistentpro.e-box.co.in/finish/177913 17/18
5/24/22, 6:43 PM Course

S.No Questions Score Status

Check
49 What does the first pa... 1 Correct Answer Answer

What does the first parameter(param1) in below callback function


denote?
fs.readdir('.',function(param1,param2)){
}
 1) Error object
2) Array of files
3) File Object
4) None of the Above

Check
50 Which of the below ope... 0 Wrong Answer Answer

Which of the below operations in Node is/are executed in an


asynchronous manner?
1) A.) setInterval()
2) B.) fs.mkdir()
3) C.) fs.stat()
 4) B&C
5) All of the Above A,B &C

Go To Home

https://persistentpro.e-box.co.in/finish/177913 18/18

You might also like