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
What is method overloading and overriding?
``` ~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. ```
26
What is method overloading and overriding?
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):
27
What is singleton
A single constructor is private and parameter less. This prevents other classes from instantiating it
28
What is a sealed class in C#?
The sealed modifier prevents other classes from inheriting from it.
29
What is test driven development?
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
30
How would you write a unit test?
[ 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
31
What is JSON?
Javascript object notation is a readable language for users in a data-interchange
32
Code Coverage
It is the percentage given to you on how much lines of your code are covered by unit testing
33
Static
``` 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 ```
34
Do you have any experience with LINQ to ADO.Net
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)
35
Agile:
Give the client what they want with little to no documentation, an Asynchronous, automatic development/ deployment cycle
36
How would you use a connection string without hard coding it into your program?
Some type of secret key or a configuration manager System.Configuration
37
How to achieve multiple inheritance in c#
Multiple inheritance in C#( not allowed)
38
Model Binding
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
39
.NET & C# | What is MVC. (Model View Controller)
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
40
What is Entity Framework
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
41
ADO.NET and ASP.NET
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
42
What is a DLL?
Dynamic link library contains code and data that can be used by more than one program at the same time
43
What is Truncate and Delete commands in SQL?
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
44
What do you know about normalization?
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
45
How would you connect the API to a sql database?
Using the connection string from the server in my data logic or repository
46
What are some datatypes in SQL?
``` 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
Give us some examples of query commands.
SELECT *, FROM, WHERE,ALTER TABLE, ADD, AND, AS
48
Store procedure
SQL statements which are saved and stored in a RDBMS, to be reused over and over again
49
A function
a set of SQL statements that perform a specific task
50
How would you select a unique record?
Use the Information Schema or select*distinct
51
What are directives in angular?
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
Purpose of Routing Module
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
Component decorator:
``` 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
What are some angular directives?
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
Structural Directives
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
Attribute Directives
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
What is the difference between let and var?
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
What does ng Bind?
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
``` 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 ```
``` 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
What is the difference between a directive and a component?
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
Component decorator:
``` 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
Write out a HTTP request from angular that would connect to your API
I would use the HTTP Client | this.http.post()
63
What are Decorators and Observables?
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
JavaScript Types
``` Boolean Null Undefined Number BigInt String Symbol ```
65
How do you style a selector in CSS file?
``` 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
Difference between Composite key, Primary key and Foreign key
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
Monolithic
the frontend and backend tightly coupled so if I make changes to frontend, it will break the code in the backend
68
Sprint
Intervals of work daily stand ups; specify what you’re doing before next standup, we go over blockers
69
Docker file
Docker file contains instructions including keywords FOR, FROM, for your containerizations, its sensitive content AND COMMANDS AND USE DOCKER IGNORE
70
DevOps cycles
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
Falsey Value
FUN0NE
72
Modules
are group of related components and serve same function and can be combined with other modules
73
Components
building blocks of the application and a subset of directives
74
Npm:
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
Interface
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
TRUE OR FALSE: | NO MULTIPLE INHERITANCE WITH ABSTRACT CLASS OR SIMPLE CLASS ONLY WITH AN INTERFACE
TRUE
77
Interface segregation principle
``` 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
Microservices
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
Custom operator overloading
uses the operator keyword with static polymorphism
80
Abstract classes
``` 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
Abstract methods of an abstract class
``` 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
The difference between a simple class and an abstract class:
``` 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
Middleware
helps to execute pre-processing logic before controller is executed Authentication and Authorization (OKTA)
84
Scoped
instantiates once per request made to server
85
Polymorphism:
(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
Explain Dependency Injection
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
Appsettings.json
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
wwwroot folder
contains the static content like CSS, HTML, Images
89
What is MVC Architecture
``` 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
What is ASP.NET core
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
ASP.NET MVC Core (2017)
``` 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
ASP.NET MVC 5 (2003)
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
Webforms (2003)
Only compatible with windows Complicated Less control of HTML
94
CLI
runs from terminal allowing interaction to npm
95
Registry:
public database of JS packages
96
Modules
are group of related components and serve same function and can be combined with other modules
97
Falsey Value
FUN0NE
98
Falsey
Boolean equivalent
99
Docker file
contains instructions including keywords FOR, FROM, for your containerizations, its sensitive content AND COMMANDS AND USE DOCKER IGNORE
100
TRIGGERS:
set up process automated actions for continuous development
101
JOBS
consist of the actual work
102
STEPS
: operations of the jobs to complete
103
APPROVAL:
makes sure everything is completed
104
Monolithic
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
Object oriented Prog: vs Procedural oriented programming
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
Composite key
can be defined and combined with multiple columns
107
Primary Key
assigned to an id (primary identifier)
108
Foreign Key
serves as connector between data/tables and can me couples with a primary key
109
Scalar function
``` based on user input and return a single value UCASE() LCASE() MID() LEN() ROUND() NOW() FORMAT() ```
110
Aggregate functions
``` AVG() COUNT() FIRST() LAST() MAX() MIN() SUM() ```
111
Attribute Routing
Attribute routing gives you more control over the URIs in your web API.