Infosys Flashcards

1
Q

Difference between REST and SOAP

A

REST is Synchronous uses XML, Json, Plain Text, etc., transfer over HTTP, Javascript support is easy, calls services using HTTP request, uses XML AND JSON to send and receive data. Business logic is URIs Also, no error handling. Example of REST documentation is Swagger. Emphasizes stateless communication
SOAP is Asynchronous, uses only XML well documented but has many options with respect to documentation that can be difficult to understand, error handling is built in, transfers over HTTP, SMTP, FTP etc., its business logic is services interfaces. Supports stateless and stateful operations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Default class & default member

A

class= internal

member=private

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is REST?

A

Rest stands for Representational State Transfer. It tells you how you should transfer information and communicate with the client. An architectural style that uses Service Oriented Architecture; Restful service pertains to creating a web service. It is compatible with http(s) protocols & can use any messaging format such as .json, xml or a custom format. Its lightweight and consumes less bandwidth

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is AJAX and have you used it in a project before?

A

Asynchronous JS and XML
Used to grab information only with XML type backend server hence the name
But now updated for the object to also include JSON to be relevant
**This is how we send request and fetch API

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is routing?

A

[Route(“[controller]”)]
the middleman between the asp.net and the client and handles the http responses and routes the information back to the client

Helps ASP.Net to route the user’s http request for example which controller and which action inside of the controller routing where the http request should go to.
The routing middleware is used to find the appropriate controller and action in the controller to handle the request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Http Life Cycle

A

Your browser (the client) will send a request (the url you sent)
The server will receive that request & do some processes
Server will send a response (html, css, json, js etc)
Client will receive response for browser to process the response

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the HTTP response codes?

A
1xx Informational 
2xx Successful status
3xx Redirection
4xx Client errors
5xx Server errors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Http methods (what they do)

A

GET: request data,
POST: sends data to server (HTML)
PUT: creates a new resource or replaces
DELETE: delete request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are abstract methods?

A

~implicitly a virtual method.
~declarations are only permitted in abstract classes
~abstract method declaration provides no actual implementation,
~there is no method body, the method declaration
~ simply ends with a semicolon and there are NO curly braces { } following the signature.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Interface?

A
Complier enforces contracts, & all methods are public abstract, variables are public, static, or final (declaring behaviors for objects)
An interface describes what behaviors (verb) A class should have; it provides none of its own
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a constructor?

A

is used to initialize the state of an object.
not required to have a return type.
is invoked implicitly.
The compiler provides a default constructor if you don’t have any constructor in a class.
The constructor’s name must be same as the class name.
5 types: Default, Copy, Parameterized, Copy, Static, Private

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Give the syntax for attribute routing

A

The general syntax is {parameter:constraint}
Ex:
[Route(“customers/{customerId}/orders/{orderId}”)]
public Order GetOrderByCustomer(int customerId, int orderId) { … }

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Connection differences between ADO.NET and Entity Framework

A

ADO.Net is directly connected to the data source and gives better performance, entity framework translates the LINQ queries to SQL first and then process the query

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you connect API to the database?

A

Through a connection string in our azure server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is authentication and authorization

A

Authentication is checking the identity and authorization is the permission levels of access

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are SOLID principles?

A
Enables us to manage most of the software design problems, intended to make software designs more understandable
Single Responsibility:
Open Closed Principle
Liskov Substitution Principle
Interface Segregation Principle
Dependency Inversion Principle
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

SOLID concepts

A
A class should have only one reason to change, and the responsibility should be encapsulated by the class
	Open for extension closed for modification means to allow new functionality with minimal changes to existing code 
	Objects are replaceable with instances of subtypes without altering the correctness of the program
	Separate multiple interfaces are better than one shouldn’t enforce clients to implement interfaces they don’t use 
	Higher level modules shouldn’t depend on low level modules
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

OOP Pillars

A

Encapsulation - Wrapping up of the data & data hiding, with use of access modifiers to provide levels of access
Abstraction - Showing only essential features of the program instead on un-necessary details.
Inheritance - Is a way to extend a type so that its properties and behaviors can be extended/branched further.
Polymorphism- Ability to implement inherited properties or methods in different ways across multiple abstractions.
Static/Compile time polymorphism or Dynamic/Runtime polymorphism.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

OOP Advantages

A

~OOPs makes development and maintenance easier whereas in a procedure-oriented programming language it is not easy to manage if code grows as project size increases.
~OOPs provides data hiding whereas in a procedure-oriented programming language a global data can be accessed from anywhere.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is a constructor?

A

5 types: Default, Copy, Parameterized, Copy, Static, Private
is used to initialize the state of an object.
not required to have a return type.
is invoked implicitly.
The Java compiler provides a default constructor if you don’t have any constructor in a class.
The constructor’s name must be same as the class name.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is Interface?

A
Complier enforces contracts, & all methods are public abstract, variables are public, static, or final (declaring behaviors for objects)
An interface describes what behaviors (verb) A class should have; it provides none of its own
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What are abstract methods?

A

~implicitly a virtual method.
~declarations are only permitted in abstract classes
~abstract method declaration provides no actual implementation,
~there is no method body, the method declaration
~ simply ends with a semicolon and there are NO curly braces { } following the signature.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Http methods (what they do)

A

GET: request data,
POST: sends data to server (HTML)
PUT: creates a new resource or replaces
DELETE: delete request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Give the syntax for attribute routing

A

The general syntax is {parameter:constraint}
Ex:
[Route(“customers/{customerId}/orders/{orderId}”)]
public Order GetOrderByCustomer(int customerId, int orderId) { … }

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is method overloading and overriding?

A
~Method overriding is an example of runtime polymorphism, 
~Redefining the method of the parent class into the child class. 
~To override the method in the parent class, in child class you need to specify a method of the same signature
~necessary to make a method overridable by using abstract or virtual keyword in base class
~In child class use the keyword override to override these methods.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What is method overloading and overriding?

A

Overloading
~Method overloading is an example of static/compile time polymorphism
~Creation of methods with the same name as another in the same class, nut differs in parameters (order number, type)
~Methods with the same name behaves differently based on signatures(parameters):

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What is singleton

A

A single constructor is private and parameter less. This prevents other classes from instantiating it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What is a sealed class in C#?

A

The sealed modifier prevents other classes from inheriting from it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What is test driven development?

A

software development process used to test cases before software is fully developed and track software development by repeatedly testing the software against all test cases.

- Mantra: Red, Green, Refactor - Structure: Arrange, Act, Assert
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

How would you write a unit test?

A

[ Test ]
Triple A’
Arrange: initializes object and set values of data passed to the method
Act: invokes the method, testing the arranged parameters
Assert: verifies the action does what it’s supposed to do

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What is JSON?

A

Javascript object notation is a readable language for users in a data-interchange

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

Code Coverage

A

It is the percentage given to you on how much lines of your code are covered by unit testing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

Static

A
A non-access modifier determines if the method or variable belongs to a class as a whole or as an instance. Methods and variables labeled static without the need to create an object of the class, but the main method is always labeled
A static method can not be overridden because it pertains to the class not the object, and the static method can be called without the class instance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

Do you have any experience with LINQ to ADO.Net

A

It is a query language that is very similar to our SQL
useful for filtering/acquiring/aggregating data
Method syntax- use methods to perform the queries (simple queries)
Query syntax- more like SQL in that you create a statement-like operation using keywords (joins)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

Agile:

A

Give the client what they want with little to no documentation, an Asynchronous, automatic development/ deployment cycle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

How would you use a connection string without hard coding it into your program?

A

Some type of secret key or a configuration manager System.Configuration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

How to achieve multiple inheritance in c#

A

Multiple inheritance in C#( not allowed)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

Model Binding

A

It is a way to bind data (JSON objects) coming from HTTP request to be automatically mapped into a C# model
Model Binder looks for those values in different ways:
o QueryString -> Primitive types
o Request Body -> Complex Types
Just like HTTP transfers information by JSON files. ASP.NET automatically maps the JSON object into a C# object and vise-versa

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

.NET & C#

What is MVC. (Model View Controller)

A

used to implement user interfaces, data, and controlling logic.
Used to decouple where to or more systems work/connect without direct connectivity, uses a buffer to separate the fetch and decode stages from the execution stage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

What is Entity Framework

A

An open source ORM, object relational mapping for .NET

defines context classes and entity classes that make up a model and uses migrations to create a database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

ADO.NET and ASP.NET

A

ASP.NET is the compiled language. ASP uses ADO (ActiveX Data Objects) technology to connect and work with databases. ASP.NET uses ADO.NET to connect and work with databases. ASP is partially object-oriented.
ADO.NET uses Microsofft.Data.Sqlclient

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

What is a DLL?

A

Dynamic link library contains code and data that can be used by more than one program at the same time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

What is Truncate and Delete commands in SQL?

A

Are Data Definition Languages Truncate command (Keeps table removes records from table) removes all rows/records from a table, without logging individual row deletions,
Delete: deletes the whole table unless specified

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

What do you know about normalization?

A

Organizing data in database reducing redundancy, improve referential integrity to read/write with consistency remove insertion, update, and deletion anomalies.
1NF~ columns should be atomic, no multiple values, separated by a comma.
Table doesn’t contain repeating column groups
Identify each record uniquely using primary key
2NF~all conditions of 1NF, move redundant data to separate table
Create relationship between these tables using foreign keys
3NF-meets all conditions of 1NF & 2NF
Does not contain columns(attributes) that are not fully dependent upon the primary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

How would you connect the API to a sql database?

A

Using the connection string from the server in my data logic or repository

46
Q

What are some datatypes in SQL?

A
Numeric, whole numbers, floating, currency,
Boolean
String/Text (string): 
Char- fixed length non-Unicode
Varchar-variable length up to (n) non-Unicode
NCHAR-fixed Unicode
NVARCHAR- variable length Unicode
		Date/time
47
Q

Give us some examples of query commands.

A

SELECT *, FROM, WHERE,ALTER TABLE, ADD, AND, AS

48
Q

Store procedure

A

SQL statements which are saved and stored in a RDBMS, to be reused over and over again

49
Q

A function

A

a set of SQL statements that perform a specific task

50
Q

How would you select a unique record?

A

Use the Information Schema or select*distinct

51
Q

What are directives in angular?

A

the middleman between the asp.net and the client and handles the http responses and routes the information back to the client

Helps ASP.Net to route the user’s http request for example which controller and which action inside of the controller should the http request go to.
The routing middleware is used to find the appropriate controller and action in the controller to handle the request

52
Q

Purpose of Routing Module

A

Route the traffic, ngModule configure the routes, its destination usually in src and in the app to set up the root of the application
Its meta data is:
Declarations list of components
Imports list of modules used by component templates
Providers list of service providers
Bootstrap contains the root component

53
Q

Component decorator:

A
selector: a css selector that tells angular to create and insert an instance of this component into a specified element
templateUrl: the module relative address to the components' HTML template, or an inline HTML template
styleUrls: an array of css files or inline css styles
54
Q

What are some angular directives?

A

are markers on a DOM element that tells Angular to change the appearance, behavior, and/or layout of the Dom element and its children

55
Q

Structural Directives

A

Change the DOM layout by adding and removing DOM elements
ngIf: allows us to add or remove DOM elements based upon a Boolean expression
• you can also add an #elseBlock
ngFor: allows us to repeat a part of the HTML template once per each item from an iterable list
ngSwitch: allows us to switch between different elements depending on the expression. It is used with the following directives
• ngSwitchCase
• ngSwitchDefault

56
Q

Attribute Directives

A

Attribute Directives are used to change the look and behavior of the DOM element
• ngClass: used for adding or removing CSS classes on an HTML element. It can allow us to apply CSS classes dynamically based on expression evaluation
• ngStyle: allows you to dynamically change the style of an HTML element based on an expression
• ngModel-invokes 2-way data binding

57
Q

What is the difference between let and var?

A

Let limits the scope of the variable depending on where it was declared mostly use ‘let’ to avoid conflicting name variables
Var keyword that will give variable a global scope

58
Q

What does ng Bind?

A

Data Binding provides communication between a component and the document object model (DOM)
1-way allows us to manipulate views through models through:
~String interpolation binds data from a typescript class to a template using the {{}}
~Property binding allows to bind values to attributes of HTML elements
~Event binding binds DOM events (keystrokes, buttons, click, etc. to a function in the component
2-way a way to reflect changes in the template and component
~Achieved by combining property binding and event binding
~Gather user input

59
Q
In angular to inject services into a component of the application
Allows a class to receive dependencies from an outside source 
Helps to loosely couple our code
A
In angular to inject services into a component of the application
Allows a class to receive dependencies from an outside source 
Helps to loosely couple our code
60
Q

What is the difference between a directive and a component?

A

Components are the building blocks we use to break up the UI and logic. The directives are the middleman that handles the http routes and responses

61
Q

Component decorator:

A
selector: a css selector that tells angular to create and insert an instance of this component into a specified element
templateUrl: the module relative address to the components' HTML template, or an inline HTML template
styleUrls: an array of css files or inline css styles
62
Q

Write out a HTTP request from angular that would connect to your API

A

I would use the HTTP Client

this.http.post()

63
Q

What are Decorators and Observables?

A

Decorators: Class, Method, Property, Parameter, Accessor
Observables are used for asynchronous operations: AJAX request and responses, and/or Router & Forms modules make use of observables to listen for and respond to user input events

64
Q

JavaScript Types

A
Boolean
Null 
Undefined 
Number 
BigInt
String
Symbol
65
Q

How do you style a selector in CSS file?

A
selects specific or group HTML elements the basic ones include:
☆Element selector - When you want to select multiple elements of the same tag
☆Class selector - When you want to select multiple elements of different tags by using the class attribute
☆Id selector - When you want to select one (mostly) or a couple elements using the id attribute
66
Q

Difference between Composite key, Primary key and Foreign key

A

Composite key can be defined and combined with multiple columns
Primary Key assigned to an id (primary identifier
Foreign serves as connector between data/tables and can me couples with a primary key

67
Q

Monolithic

A

the frontend and backend tightly coupled so if I make changes to frontend, it will break the code in the backend

68
Q

Sprint

A

Intervals of work daily stand ups; specify what you’re doing before next standup, we go over blockers

69
Q

Docker file

A

Docker file contains instructions including keywords FOR, FROM, for your containerizations, its sensitive content AND COMMANDS AND USE DOCKER IGNORE

70
Q

DevOps cycles

A

TRIGGERS: set up process automated actions for continuous development
JOBS: consist of the actual work
STEPS: operations of the jobs to complete
APPROVAL: makes sure everything is completed

71
Q

Falsey Value

A

FUN0NE

72
Q

Modules

A

are group of related components and serve same function and can be combined with other modules

73
Q

Components

A

building blocks of the application and a subset of directives

74
Q

Npm:

A

node package manager default package management for JS; consists of 3 components
Website: discovers packages and manages access to public/private packages
CLI: runs from terminal allowing interaction to npm
Registry: public database of JS packages

75
Q

Interface

A

is a contract legally binding between the developer who is creating the class and the consumer using the class; better control on impact analysis, changing management and breaking changes

Cannot write any logic in interfaces only signatures
All methods, properties/fields, methods/functions are public
can change by multiple inheritances (helps to add new methods without affecting the old interfaces

76
Q

TRUE OR FALSE:

NO MULTIPLE INHERITANCE WITH ABSTRACT CLASS OR SIMPLE CLASS ONLY WITH AN INTERFACE

A

TRUE

77
Q

Interface segregation principle

A
Do not force the client to use unnecessary methods they are not interested to use
Difference between interface and an abstract class
	An interface can only inherit from another interface it cannot inherit from abstract class whereas an abstract class can inherit from another abstract class and an interface.
78
Q

Microservices

A

a variant of the service-oriented architecture structural style – arranges an application as a collection of loosely-coupled services. In a microservices architecture, services are fine-grained and the protocols are lightweight.

79
Q

Custom operator overloading

A

uses the operator keyword with static polymorphism

80
Q

Abstract classes

A
are partially defined parent class:
	They are half defined classes where some implementations are defined, and some implementations are left to the child class to be defined
81
Q

Abstract methods of an abstract class

A
are by default virtual: 
Define in a parent class method as virtual in the child class you can override it  
	You cannot create an instance of an abstract class or interface the compiler will throw an exception
82
Q

The difference between a simple class and an abstract class:

A
An abstract class is a pure half defined class
A simple class is a class and to make it half defined you have to write hack logic
83
Q

Middleware

A

helps to execute pre-processing logic before controller is executed
Authentication and Authorization (OKTA)

84
Q

Scoped

A

instantiates once per request made to server

85
Q

Polymorphism:

A

(dynamic) the ability for the object to act differently in under different conditions. Classes must inherit from the parent class
Static/Compile time polymorphism METHOD OVERLOADING
Method without a signature, or a method with 1 input/2 inputs
Will be checked at compile time; $build
Dynamic/Runtime polymorphism METHOD OVERRIDING
Virtual keyword/parent child relationship

86
Q

Explain Dependency Injection

A

Practice of providing dependent objects for a class from the outside rather than the class creating the dependent objects

Ex: the CustomerAPIController wants the CustDbContext object. Rather than creating it from the “new” keyword its injected into the constructor

Benefits: decoupled system the caller doesn’t worry about where the object comes from

87
Q

Appsettings.json

A

json stores configuration data or configuration of the project
Stored In json format (name/value)
Ex: connection strings, version numbers, logging
TO READ (name/values) appsettings.json file must use IConfiguration interface, belongs to the Microsoft.Extensions.Configurations namespace injected by the MVC Core Dependency injection Framework
IConfiguration is provided as a parameter into the constructor of the controller (dependency injected)

88
Q

wwwroot folder

A

contains the static content like CSS, HTML, Images

89
Q

What is MVC Architecture

A
Model – the business logic (domain, customer class supplier class, accounts, inventory, payroll etc.)
Controller – connects the controller and the view, binding layer binds the model and the view; takes user input (GET, POST, PUUT, DELETE) passes data to the view
View - responsible for the look and feel of colors and positioning (HTML, CSS) passes dynamic values from the controller, uses template engines, communicates with the controller
90
Q

What is ASP.NET core

A

ASP.NET MVC Core is an open source . cross platform (runs on linux, mac, Microsoft) web development framework used to develop web applications created by Microsoft

91
Q

ASP.NET MVC Core (2017)

A
Lightweight
*Cross platform/ open source
	*Best performance and is simplified
	Ready-made dependency injection
	Very more cloud ready
	Appsettings.json
Built in dependency injection mechanism
Good HTML control and flexibility due to razor view
92
Q

ASP.NET MVC 5 (2003)

A

Only compatible with windows
Does not support dependency injection have to write more code
Can host on cloud but not like MVC core
Web.config
Must use 3rd party for dependency injection
Good HTML control and flexibility due to razor view

93
Q

Webforms (2003)

A

Only compatible with windows
Complicated
Less control of HTML

94
Q

CLI

A

runs from terminal allowing interaction to npm

95
Q

Registry:

A

public database of JS packages

96
Q

Modules

A

are group of related components and serve same function and can be combined with other modules

97
Q

Falsey Value

A

FUN0NE

98
Q

Falsey

A

Boolean equivalent

99
Q

Docker file

A

contains instructions including keywords FOR, FROM, for your containerizations, its sensitive content AND COMMANDS AND USE DOCKER IGNORE

100
Q

TRIGGERS:

A

set up process automated actions for continuous development

101
Q

JOBS

A

consist of the actual work

102
Q

STEPS

A

: operations of the jobs to complete

103
Q

APPROVAL:

A

makes sure everything is completed

104
Q

Monolithic

A

Monolithic the frontend and backend tightly coupled so if I make changes to frontend, it will break the code in the backend
Monolithic centralizes the code base so its in one place and engineers can step through any part of the code when debugging
User request served by a monolith do not make many calls across a network; reduces chances of network failures

105
Q

Object oriented Prog: vs Procedural oriented programming

A

OOP: Focus more on structed being separated classes, Organized into classes and accessed via objects

Procedural:Focuses on what to do over how to do it

106
Q

Composite key

A

can be defined and combined with multiple columns

107
Q

Primary Key

A

assigned to an id (primary identifier)

108
Q

Foreign Key

A

serves as connector between data/tables and can me couples with a primary key

109
Q

Scalar function

A
based on user input and return a single value
UCASE()
LCASE()
MID()
LEN()
ROUND()
NOW()
FORMAT()
110
Q

Aggregate functions

A
AVG()
COUNT()
FIRST()
LAST()
MAX()
MIN()
SUM()
111
Q

Attribute Routing

A

Attribute routing gives you more control over the URIs in your web API.