MCQ

1. 36 MCQ

 1) Which of the following statement is correct for AngularJS?
    AngularJS is an HTML framework
    AngularJS is a Java framework
    AngularJS is a JavaScript framework
    AngularJS is a SQL framework
ANS:     AngularJS is a JavaScript framework

2) On which of the Architectural pattern AngularJS is based?
    Observer Pattern
    Decorator pattern
    MVC Architecture pattern
    MVVM Architectural pattern
ANS: AngularJS is based on MVVM Architectural

3) AngularJS is perfect for?

    SPAs
    MPAs
    DPAs
    CPAs
ANS: AngularJS is perfect for Single Page Applications (SPAs).

4) Which of the following is the correct syntax for writing AngularJS expressions?

    (expression)
    {{expression}}
    {{{expression}}}
    [expression]
ANS: The correct syntax for writing AngularJS expressions is: {{expression}}

5) Do AngularJS provide reusable components?

    Yes
    No
ANS: AngularJS provides reusable components.

6) Which of the following directive is used to bind the application data to the HTML view in AngularJS?

    ng-app directive
    ng-model directive
    ng-bind directive
    ng-init directive
ANS: The ng-bind directive is used to bind the application data to the HTML view in the AngularJS application.

7) Which of the following syntax is correct for applying multiple filters in AngularJS?

    {{ expression | filter1 | filter2 | ... }}
    {{ expression | {filter1} | {filter2} | ... }}
    {{ expression - {filter1} - {filter2} - ... }}
    {{ {filter1} | {filter2} | ...-expression}}
ANS:  The syntax of applying multiple filters in AngularJS can be written as: {{ expression | filter1 | filter2 | ... }}

8) Which of the following statement is true about the lowercase filter?

    The lowercase filter converts a text to lower case text.
    The lowercase filter is a function that takes text as input.
    Both of the above.
    None of the above.

ANS: A is the correct option. The lowercase filter converts a text to lower case text. That's why it is added to the AngularJS expression to filter out the result.

9) Which of the following is an advantage of AngularJS?

    AngularJS code is unit testable.
    AngularJS provides reusable components.
    AngularJS uses dependency injection and makes use of separation of concerns.
    All of the above
ANS:     All of the above are the advantages of AngularJS.

10) Which of the following statement is true about $dirty flag?

    $dirty flag is used to state that value has been changed.
    $dirty flag is used to state that the form has invalid data.
    Both of the above.
    None of the above
Answer: A is the correct option. The $dirty flag is used to state that value in the form has been changed.

11) What will be the output for the following code?

    <div ng-app="""" ng-init=""points=[1,15,19,2,40]"">  
    <p>The output is {{ points[2] }}</p>  
    </div>  

    The output is 1
    The output is 15
    The output is 19
    The output is 2  
ANS: "The output is 19" would be the correct output of the above code.

12) What is the use of Angular Controllers in the application?

    Angular controllers are used for controlling the data.
    Angular controllers are used for displaying the data.
    Both of the above are correct.
    None of the above is correct.
ANS: Angular controllers are used to control the data.

13) Which of the following syntax is used to create a module in AngularJS?

    var myModule= angular.module();
    var myModule= new Module();
    module("app", []);
    None of the above
Answer: C is the correct option. To create a module in AngularJS, we use angular.module("app", []); syntax.

14) Which of the following is used to share data between controller and view in AngularJS?

    using Model
    using services
    using factory
    using $scope
Answer: B: "using services" is the correct answer.

15) Which of the following statement specifies the data-binding in AngularJS?

    Synchronization of data between the model and view components.
    Synchronization of data between the model and controller components.
    Synchronization of data between the controller and view components.
    None of the above
Answer: A is the correct option. Data-binding in AngularJS apps is the automatic synchronization of data between the model and view components.


16) Which of the following is not a valid AngularJS filter?

    lowercase
    orderby
    email
    currency
Answer: C is the correct option. The "email" is not a valid AngularJS filter

17) Who is known as the father of AngularJS?

    Brad Green
    Misko Hevery
    Adam Abrons
    Mike Adams
Answer: B is the correct answer. Misko Hevery was the inventor of AngularJS, so he is known as the father of AngularJS.

18) Which of the following directive is used to bind the value of HTML controls to application data?

    ng-app
    ng-init
    ng-model
    ng-hide
Answer: C is the correct option. The ng-app directive is used to initialize the AngularJS application. The ng-init directive is used to initialize the application data. The ng-model directive binds the value of HTML controls (input, select, textarea) to application data, and the ng-hide directive is used to hide or show the HTML elements.

19) Which of the following community Angular JS belong to?

    Twitter
    Facebook
    Google
    Microsoft
Answer: C is the correct option. AngularJS is a JavaScript-based open-source front-end web framework that belongs to Google and is mainly maintained by Google and a community of individuals and corporations.

20) Is AngularJS completely based on HTML and JavaScript?

    Yes
    No
Answer: A is the correct option. It is true that AngularJS completely based on HTML and JavaScript.

21) A module created by using the AngularJS function is called?

    module()
    module()
    mod()
    angular module()
Answer: B is the correct option. A module created by using the AngularJS function is called "angular.module".


22) Which of the following types of the component can be used to create a custom directive?
    Element directives
    Attribute
    CSS
    All of the above.
Answer: D is the correct option. By using AngularJS, we can create custom directives for the following type of elements.
    Element directives: This is activated when a matching element is encountered.
    Attribute: This is activated when a matching attribute is encountered.
    CSS: This is activated when a matching CSS style is encountered.
    Comment: This is activated when a matching comment is encountered.

23) How many $RootScope an AngularJS application can have?
    Zero
    One
    Two
    Infinity
Answer: B is the correct option. An AngularJS application can have only one $RootScope

24) Which of the following is true about the currency filter?
    A currency filter is used to format the text in a currency format.
    A currency filter is a function that takes text as input.
    Both A and B
    None of the above
Answer: B is the correct option. A currency filter is used to format the text in a currency format. It is added to the AngularJS expression to filter out the result.

25) Which of the following statement is true in the case of a controller in MVC?
    A controller is a software code that controls the interactions between the Model and View.
    A controller is a software code that stores the data.
    A controller is a software code that renders the user interface.
    All of the above.
Answer: B is the correct option. A controller is a software code that stores the data.

26) Which of the following components can be injected as a dependency in AngularJS?
    Value
    Factory
    Constant
    Application Module
Answer: D is the correct answer. The "Application Module" can be injected as a dependency in AngularJS.


27) What is deep linking in AngularJS?
    Deep linking is an SEO-based technique.
    Deep linking refers to linking various views to the main page.
    Deep linking allows you to encode the state of an application in the URL so that it can be bookmarked.
    All of the Above
Answer: C is the correct answer. Deep linking allows you to encode the state of an application in the URL so that it can be bookmarked.

28) AngularJS applications are a mix of which of the following technologies?
    HTML and PHP
    HTML and JavaScript
    HTML and TypeScript
    PHP and JavaScript
Answer: B is the correct answer. AngularJS applications are a mix of HTML and JavaScript.

29) Which of the following template can be used to write AngularJS directives?
    Tag
    Attribute
    Class name
    All of the above
Answer: D is the correct answer.

30) Which of the following statement is true in the case of $routeProvider?
    It is a service.
    It is a module.
    It is a component.
    None of the above
Answer: A is the correct answer. The $routeProvider is a service.

31) Which of the following statement justify the working of AngularJS?
    module is primarily used to create application modules.
    module is used to create AngularJS modules along with its dependent modules.
    Both A and B
    None of the above
Answer: C is the correct answer as both the above statements are true.


32) The [] parameter in the module definition is used to define dependent modules.
    TRUE
    FALSE
    Can be true or false
    Cannot say
Answer: A: True. The [] parameter in the module definition is used to define dependent modules. Without the [] parameter, you cannot create a new module but retrieve an existing one.

33) In AngularJS, the $http service is used to make an Ajax call to the server.
    True
    False
Answer: A: True. AngularJS provides $http control which works as a service to make the Ajax call read data from the server.

34) AngularJS facilitates developers to write less code and get more functionality.
    True
    False
 Answer: A: This is a true statement as AngularJS facilitates developers to write less code and get more functionality.   

35) While using the factory method, we must first define a factory and then assign a method to it.
    True
    False
Answer: A: This is a true statement. As using the factory method, we first define a factory and then assign a method to it.

36) OrderBy filter is applied to an expression using pipe character.
    True
    False
Answer: A: This is a true statement. The OrderBy filter is applied to an expression using pipe characters. 


************************************************************************

************************************************************************


1. What is a controller in MVC?

  • A. It is a software Code that stores the data
  • B. It is a software Code that renders the user interface
  • C. It is a software Code that controls the interactions between the Model and View
  • D. None of the above 

 ans: Option C 

 

2. Which of the followings are validation directives?

  • A. ng-required
  • B. ng-minlength
  • C. ng-pattern
  • D. All of the above 

 Answer: Option D 

 

 3. Which components can be injected as a dependency in AngularJS?

  • A. Application Module
  • B. constant
  • C. value
  • D. factory

 Answer: Option A 

 

 4. Who is sometimes called as Father of AngularJS?

  • A. Brad Green
  • B. Igor Minor
  • C. Misko Hevery
  • D. Brian Ford 

 Answer: Option C 

 

5. Which of the following is true about AngularJS expressions

  • A. Expressions behave in same way as ng-bind directives
  • B. All of these
  • C. Expressions are written inside double braces like {{ expression}}
  • D. Expressions are used to bind application data to html

 Answer: Option B 

 

6. AngularJS module can be created using ________

  • A. angular.module();
  • B. var myModule = new module();
  • C. module.create();
  • D. angular.create();

Answer: Option A

 

 7. What is link function is used for in angular js?

  • A. It is used for registering DOM listeners as well as instance DOM manipulation
  • B. It is used to retrieve object instances as defined by provider
  • C. It is used for template DOM Manipulation and collect all of the directives
  • D. The method traverses the DOM and matches the directives

 Answer: Option A 

 

8. Angular initializes based upon which of the following scenario?

  • A. DOMContentLoaded event happens
  • B. document.readyState is set to complete
  • C. Both of the above
  • D. None of the above

 Answer: Option C

 

 9. AngularJS expressions are written using.

  • A. double braces like {{ expression}}
  • B. single braces like {expression}
  • C. small bracket like (expression)
  • D. capital bracket like [expression]

 Answer: Option A 

 

10. What angular function is used to manually start up an angular application?

  • A. angular.bootstrap
  • B. angular.element
  • C. angular.copy
  • D. None of the above

 Answer: Option A

 

11. AngularJS directives are used in ________

  • A. Model
  • B. View
  • C. Controller
  • D. Module

 Answer: Option B 

 

12. How does an object or function can get hold of its dependencies in angular js?

  • A. Typically using the new operator, dependency can be created
  • B. By referring to a global variable, dependency can be looked up
  • C. Dependency can be passed into where it is required
  • D. All of the above 

 Answer: Option D

 

 13. There is a controller which takes a single parameter. We call it . . . . . parameter.

  • A. $param
  • B. $control
  • C. $scope
  • D. $scont 

 Answer: Option C 

 

14. Which of the following directive allows us to use form?

  • A. ng-include
  • B. ng-form
  • C. ng-bind
  • D. ng-attach 

 Answer: Option B 

 

 15. In AngulsrJS HTML document is loaded and evaluated first in the browser. Mean while in AngularJS _________ ?

  • A. JavaScript file is loaded
  • B. The angular global object is created
  • C. Your JavaScript which registers controller functions is executed
  • D. All of above

answer: Option D

 

 16. What are various possible prefixes such as 'ng-' using which Angular directives (for example, ng-app) can be defined?

  • A. 'ng-', 'data-ng-', 'ng:'
  • B. 'ng-'
  • C. 'ng-', 'data-ng-', 'ng:', 'x-ng-'
  • D. 'ng-', 'data-ng-','x-ng-' 

 Answer: Option C 

 

 17. Is AngularJS extensible?

  • A. false
  • B. true
  • C. All of the above
  • D. None

 Answer: Option B

 

18. Can an HTML page have multiple “ng-app” directive for bootstrapping multiple AngularJS application?

 Answer: Option B 

 

 ************************************** **************************************

 **************************************  **************************************

 

Q 2 - Is AngularJS code unit testable? A - false B - true 

Answer : B

 

Q 3 - AngularJS expressions behave in same way as ng-bind directives.

A - false

B - true

Answer : B

 

 

Q 4 - Which of the following is true about ng-show directive?

A - ng-show directive can show a given control.

B - ng-show directive can hide a given control.

C - Both of the above.

D - None of the above.

Answer : C

 

Q 5 - Which of the following is true about $error?

A - $error states that form has invalid data.

B - $error states the exact error.

C - Both of the above.

D - None of the above.

Answer : B

 

Q 6 - Using factory method, we first define a factory and then assign method to it.

A - false

B - true

Answer : B

 

Q 7 - Is AngularJS extensible?

A - false

B - true

Answer : B

 

Q 8 - AngularJS uses dependency injection and make use of separation of concerns.

A - false

B - true

Answer : B

 

Q 9 - ng-init directive can be used to put values to the variables to be used in the application.

A - true

B - false

Answer : A

 

Q 10 - We can use $dirty and $invalid flags to do the form validations.

A - true

B - false

Answer : A

 

****** ****************** ***************** ****************** ****************** *********************** *****************************


Q1. What is controller in MVC?
A. A software Code that stores the data.
B. A software Code that renders the user interface.
C. A software Code that controls the interactions between the Model and View.
D. None of the Above
ans: c
 
Q2. Which of the following is true about ng-show directive?
A. Ng-show directive can hide a given control.
B. Ng-show directive can show a given control.
C. Both A & B
D. None of the Above 
ans:  c
 
Q3. Which of the following is true about $error?
A. $error states the exact error.
B. $error states that form has invalid data.
C. $error states the invalid error.
D. None of the Above 
ans:  a
 
Q4. Is service method used to create a service whose purpose is to do some defined
task.?
A. Yes
B. No 
ans:  a
 
Q5. Services are singleton objects which are instantiated only once in app.
A. True
B. False 
ans:  a
 
Q6. Does ng-model bind the values of AngularJS application data to HTML input
controls? 
A. Yes
B. No 
ans:  a
 
Q7. Angular JS belongs to the ..........
A. Google
B. Facebook
C. Microsoft
D. IBM 
ans:  a
 
Q8. Is AngularJS entirely based on HTML and JavaScript?
A. No
B. Yes 
ans:  b
 
Q9. Which of the following directive is used to start an angularJS application?
A. ng-start
B. ng-begin
C. ng-app
D. None of the Above 
ans:  c
 
Q10. Which of the following directive binds the values of application data to HTML input controls in angular JS?
A. ng-app
B. ng-model
C. ng-bind
D. None of the above 
ans:  b
 
Q11. Does ng-bind bind the Application data to HTML tags in angular JS?
A. Yes
B. No 
ans:  a
 
Q12. Which of the following option used as a filter in Angular Js? 
A. Date
B. Currency
C. Uppercase
D. None of the Above 
ans:  a
 
Q13. How to combine filters with expression?
A. Using Dot {{expression. pipe}}
B. Using Comma {{expression, pipe}}
C. Using Slash {{expression / pipe}}
D. Using PIpe {{expression | pipe}} 
ans:  d
 
Q14. Which of the following is data binding in angular JS?
A. Synchronization between controller part and view part
B. Synchronization between model part and controller part
C. Synchronization between model part and view part
D. None of the Above 
ans:  c
 
Q15. An angular JS application can have ....... $RootScope.
A. 1
B. 2
C. 3
D. 4 
ans:  a
 
Q16. Which of the following sign is used as a prefix for the built-in objects in AngularJS?
A. #
B. @
C. $
D. % 
 ans: c
 
Q17. Which of the following is a priority level of directives?
A. Level 1
B. Level 2
C. Level 3
D. All are Correct 
ans:  a
 
Q18. Which of the following service is used to communicate with a remote server?
A. $animate
B. $timeout
C. $http
D. None of the Above 
ans:  c
 
Q19. Which of the following service converts object to the string?
A. $htpp
B. $interval
C. $httpParamSerializer
D. None of the Above 
ans:  c
 
Q20. Service and factory are singletons.
A. True
B. False 
ans:  a
 
Q21. Which of the following directive is used to hide a given control?
A. ng- cover
B. ng- hide
C. ng- disbaled
D. None of the Above 
ans:  b
 
Q22. We can store the controller in an external file.
A. Yes
B. No 
ans:  a
 
Q23. Which of the following function is used to create a module?
A. add.module()
B. create.module()
C. angular.module()
D. None of the Above 
ans:  c
 
Q24. AngularJS module can be created using angular.module();. 
A. Yes
B. No 
ans:  a
 
Q25. Which of the following angular function is used to manually start up an angular application?
A. angular.copy
B. angular.element
C. angular.bootstrap
D. None of the Above 
ans: C
 
Q26. Which of the following angular function is used to manually start up an angular application?
A. angular.copy
B. angular.element
C. angular.bootstrap
D. None of the Above 
ans: C
 
Q27. A controller that takes a single parameter called ........
A. $control
B. $param
C. $scont
D. $scope 
ans: d
 
Q28. AngularJS applications are a mixture of ...........
A. HTML and PHP
B. HTML and JavaScript
C. HTML and CrossScript
D. HTML and AngularScript 
ans: b
 
Q29. Which of the following directive is used to initialize an angular app?
A. ng-app
B. ng-model
C. ng-controller
D. None of the Above 
ans: a
 
 Q30. Does AngularJS bootstrap itself during config phase?
A. Yes
B. No 
ans: a
 
Q31. An application written in AngularJS is cross-browser compliant.
A. True
B. False
ans: a
  
 ********************** ******************* ***********************
 ********************** ******************* ***********************
 
 

Comments

Post a Comment

Popular posts from this blog

ANGULAR INTERVIEW QUS

ANGULAR JS