Friday, April 28, 2023

WIPRO Question

 C# Questions:

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

what is the version of C# are you using?

difference between abstraction and encapsulation.

method overloading & method overriding.

Abstract class vs Interface.

Can inerface pass as parameter to method

singleton class vs static class

what is sealed class

Code:

Class A:

{

public virtual void show()

    {

    console.writeline("A")

    }

}

 

Class B:A 

{

    public overwrite void show()

    {

    console.writeline("B")

    }

}

 

Class C:A 

{

    public void show()

    {

    console.writeline("C")

    }

}

 

a obj=new a();

a obj1=new b();

a obj2=new c();

 

obj.Show();

obj1.Show();

obj2.Show();

 

diff between readonly & constant

what is using block

 

how can we restrict object to be created only 3 instance?

 

What is the difference between eager loading and lazy loading?

 

what is deligate.

diff between IEnumerable vs Iqueryable

 

what is difference between protected and protected internal access specifiers 

diff between ref,out & dynamic keyword, which will give compile time & which will give run time exception.

 

(boxing\unboxing):int x = 101; object o = x;value type to ref type

string & string.builder

String is a reference type or value type?

 

Private,copy constructor

diff between private & static constructor

can we overwrite a constructor

can we create constructor in abstract class.

 

what are extension methods

Can we extend a class provided by third party library whose code is inaccessible, how?

 

how try,catch,finally blocks works

 

what are solid degin principal

what is design pattern

 

And what is the difference between synchronous code and  asynchronous code?

 

what is task & how its different from thread.

what is monitor class, diff between monitor class & lock.

what is object class

    The Object class is the base class for all the classes in the .Net Framework. It is present in the System namespace. In C#, the .NET Base Class Library(BCL) has     a language-specific alias which is Object class with the fully qualified name as System.Object. Every class in C# is directly or indirectly derived from the     Object class. If a class does not extend any other class then it is the direct child class of the Object class and if extends another class then it is indirectly     derived. Therefore the Object class methods are available to all C# classes. Hence Object class acts as a root of the inheritance hierarchy in any C# Program.     The main purpose of the Object class is to provide low-level services to derived classes. 

    

How we manage unmanaged code(garbage collection) 

how GB works for unmannaged 

GC.supress,GC.Collect,GC.finalize

 

dispose vs finalize

dynamic vs object

What's the difference between stack and heap in memory

 

Finalizers in C# are declared like destructors. Let’s say the class name is Demo, therefore, the following would be our finalizer −

~Demo() {

   //

}

The finalizer declaration is prefixed with a tilde before the class name.

 

diff between thread.sleep() & await task.Delay():

Thread.Sleep() block the current thread but task.delay() will delay thread without blocking current thread.

 

MVC:

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

what are filters

differnce between viewbag and viewdata and tempdata

what is peek and keep 

Html helpers

how to handle exception through out the application 

Action filters and order of how it gets executed 

In action filter; On action executed method  and in result fitter there is on result executing. So what's the difference between that ?

How do we inject dependency .net MVC?

what is bundling and minification 

can we seprate js bundle  and css bundle  files seprately

 

ScriptBundle: ScriptBundle is responsible for JavaScript minification of single or multiple script files.

StyleBundle: StyleBundle is responsible for CSS minification of single or multiple style sheet files.

DynamicFolderBundle: Represents a Bundle object that ASP.NET creates from a folder that contains files of the same type.

 

Web API:

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

what is the content negotiation?

how to define autheentication & Autherization?

 

.Net Core:

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

 

What are the middlewares in .net core?

what is map extensions method.

 

How do we do API versioning in .net core?

What is the advantage of using API over WCF?

 

how to define middleware in core(using dependencyinjection).

What is the purpose of Program.cs file in .NET Core project? can we rename Program.cs file?

 

If I want to do some IP checking, IP addresses and whitelist or blacklist, so how can I do that using a middleware?

 

Difference between ConfigureServices and Configure Method in Startup class ?

 

localhost:1234/map1,

localhost:1234/map2

How to implement above mapping in dot net core.

 

Let's say I have 100 controllers and in 100 controller 100 methods & in any of the method will be called from the front end. I want to log a statement that this method has been called these parameters.

 

diff between parallel programming and sync await?

 

Execution Order of Middleware in ASP.NET Core

 

Services lifetime

1-Transient:new instace will be created. 

2-Scoped: same instance can be used

3-Singleton: only one instance gets created

 

app.Use & app.run & app.next

 

The Run method in ASP.NET Core Application is used to complete the Middleware Execution. That means the Run extension method allows us to add the terminating middleware component. Terminating middleware means the middleware which will not call the next middleware components in the request processing pipeline.

The Use Extension Method in ASP.NET Core Application allows us to add a new middleware component which may call the next middleware component in the request processing pipeline.

 

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

{

    app.Use(async (context, next) =>

    {

        await context.Response.WriteAsync("Use Middleware1 Incoming Request \n");

        await next();

        await context.Response.WriteAsync("Use Middleware1 Outgoing Response \n");

    });

    app.Use(async (context, next) =>

    {

        await context.Response.WriteAsync("Use Middleware2 Incoming Request \n");

        await next();

        await context.Response.WriteAsync("Use Middleware2 Outgoing Response \n");

    });

    app.Run(async context => {

        await context.Response.WriteAsync("Run Middleware3 Request Handled and Response Generated\n");

    });

}

 

Output:

Use Middleware1 Incoming Request

Use Middleware2 Incoming Request

Run Middleware3 Request Handled and Response Generated

Use Middleware2 Outgoing Response

Use Middleware1 Outgoing Response

 

CORS:(Cross Origin Resource Sharing-its a browser security feature) MS.aspnetcore.Cors

in ConfigureServices() add services.AddCors() and in configure() add app.UseCors()--AllowAnyOrigin().AllowAnyMethod().AllAnyHeader()

 

can we change StartUp.cs name

MetaPackage

how to enable session in core

IservicecollectioIneterface method

 

SQL:

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

what are cursors

differnce between temp and global temp and table value functions 

What's the difference between temporary table and table variable?

what is the scope of them above 

what are sql  jobs 

how to increase performance of stored procedures

triggers types?

 

write a syntax to get 2nd highest salary?

 

sql profiller?

how to optimize our query?

Diff b/w SP and function?

SQL Server

diff table & view & index

diff table,temp table & global table

syntex to create above three

How to use the output of one sp inside of another one.

Different between out parameter and output value of SP

how can use the views and temp table inside of sp and functions

how to get table data out put from function

How many clustered index in a table 

Can you create a clustered index without a primary key?

downside of creating index

table emp, column salry emp

function to get higer salary & 2nd higher salry

Writing stored procedure, what are the steps you must follow for performance oriented?

Types of indexes

how to improve the performance of stored procedure

improve performance of join with 2 tables with 100 columns each

how to implement ROLLBACK,COMMIT

Cursors 

how we handle exceptions in SQL

 

What is the difference between DELETE and TRUNCATE statements? 

Delete command is used to delete a row in a table. 

Truncate is used to delete all the rows from a table. 

You can rollback data after using delete statement. 

You cannot rollback data.

 

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

 

Azure:

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

 

What is horizontal & vertical scaling in Azure?

what is Azure durable functions?

 

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

 

No comments:

Post a Comment