Monday 28 December 2020

Angular MCQ : Angular Fundamentals : Part 4

(1) What is the @ViewChild decorator used for?

• To add metadata for the children of a view

• The InjectionToken class To get a handle on a DOM node decorated with a ref tag(#ref_id)

• To make custom * directives


(2) An Observable represents what?

• Multiple values now

• Multiple values in the future

• Multiple values now or in the future


(3) Where should you sort and filter data?

• In your component

• In a directive

• In a filter


(3) Where should you sort and filter data?

• In your component

• In a directive

• In a filter


(4) Which decorator lets you inject a service registered with an Injection Token?

• Import

• Inject

• Input


(5) What directive helps you hide functionality you don’t want to be visible before users log in?

• ngHide

• ngShow

• ngIf

• ngAuthenticated


(6) Which decorator lets you inject a service registered with an Injection Token?

• Value comparison

• Deep value comparison

• Immutable comparison

• Mutable comparison

• Identity comparison


(7) Which of these would you use to toggle applying multiple classes to an element?

• Use a class binding

• Use a style binding

• Use ngClass


(8) What is the default token in Angular’s Dependency Injector?

• A string

• A class

• The Token class


(9) Which decorator lets you inject a service registered with an Injection Token?

• Import

• Inject

• Input


(10) Which decorator lets you inject a service registered with an Injection Token?

• Import

• Inject

• Input

 

<< Angular Fundamentals part-3      Angular Fundamentals part-5 >>

Sunday 6 December 2020

Angular MCQ : Angular Fundamentals : Part 3

(1) Which of the following is a limitation of using template based forms?

• You can't validate the values entered into the form fields.

• You can't unit-test your validation logic.

• You can't have multiple validators on a field.


2) Which library contains the Observable class?

• Http

• RxJS

• Core


3) Which of the following is an attribute css selector?

• [selector]

• #selector

• .selector


4) What is the purpose of a mock?

• To allow you to test Http calls

• To place a boundary around tested code

• To allow you to arrange your tests easier


5) What object allows you to create your own tokens?

• The InjectionToken class

• The TransparentToken class

• The Token class


6) Which of the following would you use to display a list of elements in a component template?

• *ngRepeat

• *ngEach

• *ngFor 


7) When is the @Injectable() decorator required on a service?

• Only when it is going to be injected into components

• Only when the service also injects other services

• Only when it is going to be injected into another service


8) What's the best way to add component-specific styles to a component?

• Add the styles to a css file imported by your index.html.

• Reference an external stylesheet from inside your component template html.

• Specify the styles or styleUrls inside the component meta-data config.


9) Which of the following is true about property binding expressions?

• They cannot chain expressions together using semi-colons.

• All of these

• They cannot use the new keyword.

• Assignments using =, +=, etc are not allowed.


10) What is a limitation of multiple slot content projection?

• There is a maximum of three slots.

• The slots must be on the same horizontal.

• The slots cannot exist outside of the parent's DOM tree.



<< Angular Fundamentals part-2    Angular Fundamentals part-4 >>

Angular MCQ : Angular Fundamentals : Part 2

 1) What are decorators used for?

• To give a DOM node additional functionality

• To create sub-components

• To create smaller components


2) What is one advantage of RxJS over Promises?

• They can handle a stream of data instead of just one value.

• They are more performant.

• They are simpler.


3) When bootstrapping an Angular app, how do you specify the main, top-level app component to be used?

• You load the component directly in your index.html file.

• You add the component as a package in your SystemJs config.

• You add the component to the bootstrap array in your main app module.


4) When adding styles to a component's styles property, how do you avoid those styles affecting Html outside of your component?

• You must declare your styles inside the component's template.

• You don't need to do anything, Angular takes care of this for you by default.

• You must namespace your classes so they don't affect things outside your component.


5) What functionality do Angular 1 filters have that is missing from Pipes?

• Sorting & Filtering Data

• Working with Promises

• None of these


6) When would you use the useFactory provider method?

• When you need to parameterize the construction of a service

• When you want multiple instances of a service

• When you are using a custom service.

7) If an object could potentially be shown/hidden frequently, what's the best way to handle its visibility?

• Bind to the [hidden] property of the element.

• Use *ngSwitch to hide the element.

• Use *ngIf to hide the element.


8) Custom validators are implemented with which object?

• A Detective

• A Pipe

• A Component


9) What are the two types of Integrated tests?

• Mocked & Functional

• Deep & Shallow

• Deep & End to End


10) When validating an Angular form, how can you only show a validation message if the user has edited a form control?

• Check the control's touched property.

• Check the control's dirty property.

• Bind to the "change" event of the corresponding field and track whether the field has been changed.

Angular MCQ - Angular Fundamentals : Part 1

(1) What object allows you to create your own tokens?

• The Token class

• The InjectionToken class

• The TransparentToken class


(2) What does AOT stand for?

• Assertion of Test

• Android Operating Types

• Ahead of Time


(3) What is the best way to prevent a component from being loaded based on specific conditions?

• Check the condition in the component's constructor.

• Create a route guard and use the "canActivate" property of the component's route.

• Create a route resolver and use the "resolve" property of the component's route.


(4) A promise represents what?

• A single value in the future

• Multiple values in the future

• A single value in the present


(5) What is one way you can pass data from a child component to a parent component?

• You import the parent component into the child component.

• You add an @Input() property on the parent component and bind to it from the child component.

• You add an @Output() property on the child component and bind to it from the parent component.


(6) What does AAA stand for?

• Arrange Act Assert

• Act Arrange Assess

• Act Arrange Assert


(7) What is the main purpose of content projection? 

• Create reusable components with replaceable content

• Allow content to be shown in an overlay

• Improve performance


(8) Which of the following is a valid *ngFor expression?

• event of events

• let event in events

• let event of events


(9) Why does angular not ship with a filterBy or orderBy pipe?

• Those features are implemented in other pieces of the framework.

• To keep the download size small

• They can become performance issues.


(10) How do you inject a service into a component, directive, pipe, or another service?

• Import it and specify it as a parameter in the constructor decorated with the Inject() decorator.

• Import it and decorate the import with an Inject() decorator.

• Import it and specify it as a parameter in the constructor decorated with the Inject() decorator.

Tuesday 12 May 2020

C# Equal vs "==" output related : What will be output of following code ?

Question related to  Equal vs "=="

Normally (when not dealing with strings), 
Equals compares values, while == compares object references

What will be output of following C# code ?
Que
    Object obj1 = 10;
    Object obj2 = obj1;
    Console.WriteLine($"obj1 == obj2        : {obj1 == obj2}");
    Console.WriteLine($"obj1.Equals(obj2)   : {obj1.Equals(obj2)}");
         

Output
    obj1 == obj2        : True
    obj1.Equals(obj2)   : True

Note If two objects we are comparing are referring to the same exact instance of an object, then both Equal  & "==" will return true,

If both has the same content but came from a different source (is a separate instance with the same data), only Equals will return true.

Que
    Object obj1 = 10;
    Object obj2 = obj1;
    Console.WriteLine($"obj1.Equals(obj2)   : {obj1.Equals(obj2)}");
    Console.WriteLine($"obj1 == obj2        : {obj1 == obj2}");
Output
    
    obj1 == obj2 : False
    obj1.Equals(obj2) : True

Que : 

    Object obj1 = 10;
    Object count1 = 10;
    Console.WriteLine($"obj1.Equals(count1) : {obj1.Equals(count1)}");

Output
    obj1.Equals(count1) : True

Saturday 7 March 2020

UML diagram for online campus selection system

Use Case diagram for Online campus selection system




Class diagram of Online campus selection system



Data Flow Diagram (DFD) for Online campus selection system







Video : Online campus selection system Final year Project 

Online campus selection system Final year Project




Online Campus Selection System aims at developing a system,
which will automate the functioning of the HR Department / Admin.

Selection process activities that the HR Department has to perform prior
to and after the actual act of selecting the Students.

The objective of this System
  • Maintain an individual student records.
  • Maintain Section-wise Student details. 
  • Evaluating Student performance. 
  • Eligible Students to take the test. -Initial Screening phase
  • Allow online registrations for the On-Line Selection Test. 
  • Allow online requests and support for the examination.
  • Providing proper Technical Assistance to the User.
  • Providing On-Line Help

Module of System

  • Registration Module: The student can register his Details and upload his resume. Similarly, a company can register for a Required skilled student for a specific job. 
  • Post Job Module: In this module, the company can post for a job and send a mail to the admin For the required vacancy of an employee. 
  • Apply for Job Module : After login into the system, student apply for a job according to his/her skill and a result of the exam. 
  • On-Line Exam Module : In this module, the company takes various types of exams to select eligible students. There are various types of tests available such as aptitude tests, technical tests, general tests, English tests. 





    Que: Who will interact with the system?
    Ans: Mainly three categories are there.
  1.  Administrator 
  2.  Student 
  3.  Company 
  •  An administrator is kept mainly to maintain students and company Accounts, Students Accounts, deal with various companies for specific jobs, can interact with students and company. Receive mail from the company and send it to eligible students. Perform Selection of students by taking a Test.
  • Student is the user who can only view, register himself/herself, update, delete account, etc. A student can apply a job in a company and eligible students give an online Exam which is held by the company. 
  • The company can act like mid-admin and which can register himself/herself and then the company can send a mail to the admin for specific required skilled students. Also, they show the result of the online exam and selected the students.
  • Registered student or company can act like mid-admin also means they can manage their accounts, Students can see details belong to a special job and The company can see required students.