0% found this document useful (0 votes)
42 views9 pages

HSBC

Uploaded by

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

HSBC

Uploaded by

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

public class A

{
public virtual void Print()
{
Console.WriteLine("In A");
}
}
public class B : A
{
public override void Print()
{
Console.WriteLine("In B");
}
}
public class C : B
{
public new virtual void Print()
{
Console.WriteLine("In C");
}
}
public class D : C
{
public override void Print()
{
Console.WriteLine("In D");
}
}

public class E : D
{
public new void Print()
{
Console.WriteLine("In E");
}
}

A a = new A();
A b = new B();
A c = new C();
A d = new D();
A e = new E();
C e1 = new E();

a.Print();
b.Print();
c.Print();
d.Print()
e.Print();
e1.Print()
what is the output above snipet?

 In A
 In B
 In B
 In B
 In B
 In D

2)
public class Student {
public int RollNumber{get;set;}
public string Name{get;set;}
public string FatherName {get;set;}
public DateTime DOB{get;set;}
}

Student s1 = new student();


Student s2 = new student();

s1 == s2 /// true/false
s1.Equals(s2) // true/false

3) Design the calculator by following the design principle - code on white board

4) What is a Generic Handler?

ASHX Generic Handler is a concept to return dynamic content. It is used to return ajax calls,
image from a query string, write XML, or any other data.

Generic handler is a dynamic file and is generated with c# code and disk resource. Generic
handler do not have web forms. Generic handler is also known as ASHX generic handler. It
is useful when we want to return image from a query string, write XML and other Data.

5) Generic and Collection


Generic Class
Generics in C# is its most powerful feature.

It allows you to define the type-safe data structures.

This out-turn in a remarkable performance boost and high-grade code, because it helps to
reuse data processing algorithms without replicating type-specific code. Generics are
similar to templates in C++ but are different in implementation and capabilities. Generics
introduces the concept of type parameters, because of which it is possible to create
methods and classes that defers the framing of data type until the class or method is
declared and is instantiated by client code. Generic types perform better than normal
system types because they reduce the need for boxing, unboxing, and type casting the
variables or objects.
Parameter types are specified in generic class creation.

Collections in C#
Collections standardize the way of which the objects are handled by your program. In other
words, it contains a set of classes to contain elements in a generalized manner. With the
help of collections, the user can perform several operations on objects like the store,
update, delete, retrieve, search, sort etc.

https://www.geeksforgeeks.org/collections-in-c-sharp/

6) SQL CTE and SubQuery

A Common Table Expression (aka CTE, aka WITH statement) is a temporary data set to be
used as part of a query. It only exists during the execution of that query; it cannot be used
in other queries even within the same session.

A subquery is a nested query; it’s a query within a query. This means it gives a result from a
query as a temporary data set which can be used again within that query

https://www.alisa-in.tech/post/2019-10-02-ctes/

7) Method hiding

Answer: C# also provides a concept to hide the methods of the base class from derived
class, this concept is known as Method Hiding. It is also known as Method Shadowing. In
method hiding, you can hide the implementation of the methods of a base class from the
derived class using the new keyword. Or in other words, in method hiding, you can redefine
the method of the base class in the derived class by using the new keyword.

https://www.geeksforgeeks.org/method-hiding-in-c-sharp/

8) Solid principle
9) Memory Allocation of Object

https://www.codeproject.com/Articles/1058126/Memory-allocation-in-Net-Value-type-Reference-
type

10) IDisposable

IDisposable is an interface that contains a single method, Dispose(), for releasing


unmanaged resources, like files, streams, database connections and so on. This method is
implemented explicitly in the code when we need to clean up a disposable object and to
release unmanaged resources that this disposable object holds.

https://www.c-sharpcorner.com/UploadFile/b08196/idisposable-interface-in-C-Sharp/

11) Delegate handler

A message handler is a class that receives an HTTP request and returns an HTTP response.

The first handler receives an HTTP request, does some processing, and gives the request to
the next handler. At some point, the response is created and goes back up the chain. This
pattern is called a delegating handler.

12. Which design patterns used for designing the calculator- code on white
board

https://softwareengineering.stackexchange.com/questions/257259/which-pattern-is-most-intuitive-
for-a-calculator-app/406419

14. can we do constructor overloading and if yes then how

 By using different type of arguments


 By using different number of arguments
 By using different order of arguments
https://www.geeksforgeeks.org/c-sharp-constructor-overloading/

16. Built in Delegate and in linq where it is used

Delegates are pointers to function. Delegates are used for implementing events and call
back methods.

1) Func Delegate
2) Action Delegate
3) Predicate Delegate

 Func, Action and Predicate are generic inbuilt delegates present in System
namespace.

 All three can be used with method, anonymous method, and lambda
expression.

 Func can contains 0 to 16 input parameters and must have one return type.

 Action can contain 1 to 16 input parameters and does not have any return type.

 Predicate delegate should satisfy some criteria of method and must have one
input parameter and one Boolean return type either true or false.

 Input parameters of custom delegates is fixed but Func and Actions input
parameter is variable from 0 to 16 and 1 to 16 respectively.

https://www.c-sharpcorner.com/blogs/c-sharp-generic-delegates-func-action-and-predicate

https://www.c-sharpcorner.com/UploadFile/tirthacs/func-delegates-in-linq/

17. Difference between var and dynamic

 var is a statically typed variable. It results in a strongly typed variable, in other


words the data type of these variables are inferred at compile time. This is
done based on the type of value that these variables are initialized with.

 dynamic are dynamically typed variables. This means, their type is inferred at
run-time and not the compile time in contrast to var type.
18. Difference between == and a.Equals(b)

The Equality Operator ( ==) is the comparison operator and the Equals() method compares
the contents of a string.

The == Operator compares the reference identity while the Equals() method compares only
contents.

http://net-informations.com/faq/general/equals.htm

19. Singleton design pattern

https://www.c-sharpcorner.com/UploadFile/8911c4/singleton-design-pattern-in-C-Sharp/

20. Security in web api

https://www.c-sharpcorner.com/UploadFile/1492b1/restful-day-sharp5-security-in-web-apis-basic-
authentication-a/

21. Lazy loading

https://www.codeproject.com/Articles/652556/Can-You-Explain-Lazy-Loading

*C# :*

2. Expected output with OOPS concepts on whiteboard programs

3. LINQ queries for specific scenarios to write on whiteboard

4. Delegates and event handlers

5. Func vs Action vs Predicate

6. Reference type vs Value type

7. Static class vs Singleton class

8. Difference between Thread and Task


What is Task in C#?

.NET framework provides Threading.Tasks class to let you create tasks and run them
asynchronously. A task is an object that represents some work that should be done. The
task can tell you if the work is completed and if the operation returns a result, the task
gives you the result.
What is Thread?

.NET Framework has thread-associated classes in System.Threading namespace. A Thread


is a small set of executable instructions.

Why we need Tasks

It can be used whenever you want to execute something in parallel. Asynchronous


implementation is easy in a task, using’ async’ and ‘await’ keywords.

Why we need a Thread

When the time comes when the application is required to perform few tasks at the
same time.

https://www.c-sharpcorner.com/article/task-and-thread-in-c-sharp/

9. How to wait for all threads to complete their execution and then use the
combined result to perform next operation?

https://www.geeksforgeeks.org/joining-threads-in-c-sharp/

*.NET Core :*

1. How to write custom middlewares?

https://www.c-sharpcorner.com/article/create-a-custom-middleware-in-an-asp-net-core-
application/

2. What is dependency injection and how it works in .net core?


Dependency Injection (DI) is a software design pattern. It allows us to develop loosely-
coupled code. The intent of Dependency Injection is to make code maintainable.
Dependency Injection helps to reduce the tight coupling among software components.

3. What are meta packages in asp.net core?

It is known that Microsoft.AspNetCore package is one of the packages added to many


ASP.NET Core templates.

The Microsoft.AspNetCore package is repeatedly included as one of the usual project


dependencies when opening a new ASP.NET Core project. It delivers many of the crucial
packages to position up a basic ASP.NET Core application.

Though, this package does not contain any actual dlls or code itself, it merely contains a
series of dependencies on additional packages. By adding this package to your project, you
bring in all the relevant packages along with their dlls on which it depends and it is called a
metapackage.

4. Explain content negotiation in .net core

*SQL Server :*

1. What are views and when to use them?

2. What are triggers and when to use "instead of" trigger?

*Data Structures And Design Pattern :*

1. If I have billions of records in my result set and I want to search through the
result set based on each character entered by the user in the search box so
which data structure is perfect for this scenario?

2. What is singleton pattern? How to create a thread safe singleton class?

3. Which design pattern would you use for the scenario : in case of login the
system sends 3 parameters : username, password and loginType. LoginType
can be one of the three values : SqlLogin, OAuthLogin, SocialMediaLogin.
Which design pattern will you use to provide separate implementation for
each login type?

*Angular :*
1. How angular works internally? Means sequence of operations that happen after the command 'npm
start'
2. Which is faster between JIT and AOT compilation and why?
3. How to implement cascaded drop down list in angular?
4. How to enable submit button of reactive form only when all validations have passed?
5. Sharing data and events between parent child components
6. Operators for observables and when to use which
7. BehaviourSubject vs Subject vs Observables
8. Async pipes in angular
9. How to implement custom pipe

You might also like