Explore topic-wise InterviewSolutions in Current Affairs.

This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.

1.

How Do You Validate The Controls In An Asp .net Page?

Answer»

Using SPECIAL validation controls that are MEANT for validation of any controle.We have RANGE Validator, EMAIL Validator in .NET to validate any control.

Using special validation controls that are meant for validation of any controle.We have Range Validator, Email Validator in .NET to validate any control.

2.

What Is View State In .net?

Answer»

The web is STATELESS. But in ASP.NET, the STATE of a page is maintained in the in the page itself automatically. The values are encrypted and SAVED in hidden controls. this is done automatically by the ASP.NET. This can be switched off / on for a single CONTROL.

The web is stateless. But in ASP.NET, the state of a page is maintained in the in the page itself automatically. The values are encrypted and saved in hidden controls. this is done automatically by the ASP.NET. This can be switched off / on for a single control.

3.

What Is Smart Navigation In .net?

Answer»

The cursor position is MAINTAINED when the page gets refreshed due to the SERVER SIDE validation and the page gets refreshed.

The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.

4.

How Asp .net Different From Asp?

Answer»

Scripting is SEPARATED from the HTML, CODE is compiled as a DLL, these DLLs can be executed on the server.

Scripting is separated from the HTML, Code is compiled as a DLL, these DLLs can be executed on the server.

5.

What Is Literal Control

Answer»

A Literal Web Server control doesn't have any VISUAL appearance on a Web Form but is used to insert literal text into a Web Form. This control makes it POSSIBLE to ADD HTML code directly in the code designer WINDOW without switching to design view and clicking the HTML button to edit the HTML.

A Literal Web Server control doesn't have any visual appearance on a Web Form but is used to insert literal text into a Web Form. This control makes it possible to add HTML code directly in the code designer window without switching to design view and clicking the HTML button to edit the HTML.

6.

Wht Executescaler Method Is Used?

Answer»

Executes the query, and returns the first column of the first ROW in the result SET RETURNED by the query. Additional columns or rows are ignored.

Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.

7.

How To Get The Number After Decimal Point In .net?if The No Is 2.36. Result Should Be 36?

Answer»

string result=number.SUBSTRING(number.inderOf('.')+1);

It will first get the INDEX of '.' and then add 1 to get the index of next CHARATER then with the HELP of substring method we will get the no after the decimal point to the last

string result=number.Substring(number.inderOf('.')+1);

It will first get the index of '.' and then add 1 to get the index of next charater then with the help of substring method we will get the no after the decimal point to the last

8.

What Is Using Keyword?

Answer»

using KEYWORD can be used in TWO format
1.include the namespace in file
2.handle the idisposable objects INSIDE using BLOCK.

iFace obj = new myclass()

Myclass obj1 = new myclass()

Obj.hey();
Obj1.hey();

using keyword can be used in two format
1.include the namespace in file
2.handle the idisposable objects inside using block.

iFace obj = new myclass()

Myclass obj1 = new myclass()

Obj.hey();
Obj1.hey();

9.

Suppose Two Interfaces Have Same Method, So How Will You Implement These Methods In Derive Class?

Answer»

by USING INTERFACE NAME

by using interface name

10.

What Is The Task Perform By Clr?

Answer»

It have the TASK like
1.running the garbage COLLECTOR
2.Code verification
3.code access security
4.executing IL

It have the task like
1.running the garbage collector
2.Code verification
3.code access security
4.executing IL

11.

If Dll And Exe Files Are Same It Means You Can Deploy Both The Files In Gac?

Answer»

No, deploying a exe file does not MEAN anything because classes and method are EXPOSED in dll only and exe file is PURE executable, any application can not call the FUNCTION of exe file.

No, deploying a exe file does not mean anything because classes and method are exposed in dll only and exe file is pure executable, any application can not call the function of exe file.

12.

How Will You Deploy The Dll File In Gac?

Answer»

FIRST CREATE the strong NAME for DLL and ADD this sn name key into the application then use gacutil command to register the dll in GAC.

first create the strong name for dll and add this sn name key into the application then use gacutil command to register the dll in GAC.

13.

What Is Difference Between Il And Dll ?

Answer»

DLL CONTAINS the IL and other DETAILS (METADATA) inside.

DLL contains the IL and other details (metadata) inside.

14.

Is Exe Is Machine Dependent?

Answer»

yes

yes

15.

Wcf And What Is Difference Between Wcf And Web Services?

Answer»

WCF is WINDOWS communication foundation same as webservices. ACTUALLY WCF =webservices + remoting

WCF is windows communication foundation same as webservices. actually WCF =webservices + remoting

16.

Can Namespace Contain The Private Class?

Answer»

no, having a single private CLASS does not MEAN ANYTHING , it is applicable only in CASE of NESTED class.

no, having a single private class does not mean anything , it is applicable only in case of nested class.

17.

By Default Security Setting In .net?

Answer»

ANONYMOUS ACCESS

anonymous access

18.

What Are Windows Services?

Answer»

WINDOWS services are LONG running executable applications that typically do not possess any user interface, are controlled by the Service Control Manager (SCM) and can even be configured to start automatically after the SYSTEM boots. They typically EXECUTE in their own windows sessions. They can execute even if the user has not logged in to the system. They can even be started, paused, re-started manually. These applications are somewhat similar to the daemon PROCESSES of UNIX in the sense that they remain dormant most of the time and execute in the background as and when needed.

Windows services are long running executable applications that typically do not possess any user interface, are controlled by the Service Control Manager (SCM) and can even be configured to start automatically after the system boots. They typically execute in their own windows sessions. They can execute even if the user has not logged in to the system. They can even be started, paused, re-started manually. These applications are somewhat similar to the daemon processes of UNIX in the sense that they remain dormant most of the time and execute in the background as and when needed.

19.

What Are The Benefits Of Using Windows Services:

Answer»

The following are the BENEFITS of USING Windows SERVICES:
• Network connection MANAGEMENT
• Disk access monitoring
• Security control of APPLICATION
• Log messages related to the application's requirements

The following are the benefits of using Windows Services:
• Network connection management
• Disk access monitoring
• Security control of application
• Log messages related to the application's requirements

20.

Name The Two Classes Are Required For Implementing A Windows Service?

Answer»

The following TWO classes are REQUIRED for IMPLEMENTING a Windows SERVICE:
• System.ServiceProcess.ServiceBase
• System.Configuration.Install.Installer

The following two classes are required for implementing a Windows Service:
• System.ServiceProcess.ServiceBase
• System.Configuration.Install.Installer

21.

Name The Method Of Servicebase Class?

Answer»

The FOLLOWING are the METHODS of SERVICEBASE CLASS.
• OnStart
• OnStop
• OnPause
• OnContinue
• OnShutdown
• OnPowerEvent
• OnCustomCommand

The following are the methods of ServiceBase class.
• OnStart
• OnStop
• OnPause
• OnContinue
• OnShutdown
• OnPowerEvent
• OnCustomCommand

22.

Why Linq Is Having Select Clause At The End?

Answer»

DUE to IntelliSense of Visual Studio.

If the select clause was in the first of LINQ, then the IDE cannot populate the properties INSIDE the object.

Eg:from F in db.Forum where f.Id > 0 select f.Name;

If the select was in FRONT - the "select f." could not populate any autocomplete properties or methods.

Due to IntelliSense of Visual Studio.

If the select clause was in the first of LINQ, then the IDE cannot populate the properties inside the object.

Eg:from f in db.Forum where f.Id > 0 select f.Name;

If the select was in front - the "select f." could not populate any autocomplete properties or methods.

23.

How Can You Access A Private Method Of A Class?

Answer»

USE .Net Reflection. Using reflection we can invoke PRIVATE methods too.

Example:

Car car = new Car();
Type type = car.GetType();
MethodInfo methodInfo = type.GetMethod("ShiftGearUp", BindingFlags.NonPublic | BindingFlags.Instance);
methodInfo.Invoke(car, NULL);

 Pre: CREATE a class Car with private method "ShiftGearUp"

Use .Net Reflection. Using reflection we can invoke private methods too.

Example:

Car car = new Car();
Type type = car.GetType();
MethodInfo methodInfo = type.GetMethod("ShiftGearUp", BindingFlags.NonPublic | BindingFlags.Instance);
methodInfo.Invoke(car, null);

 Pre: Create a class Car with private method "ShiftGearUp"

24.

What Is The Difference Between Var And Dynamic Types In C# 4.0?

Answer»

var gets processed in the compile time itself and shows any ERROR during compile time itself.

dynamic gets processed in the runtime only and in case of errors it is hidden until runtime.

dynamic was introduced as part of the DLR (Dynamic Language Runtime)in .Net.

Example:
dynamic d = new MYCLASS();
d.InexistingMethod();

Eventhough the method "InexistingMethod" is not there - it will GET compiled and thrown exception in runtime.

var gets processed in the compile time itself and shows any error during compile time itself.

dynamic gets processed in the runtime only and in case of errors it is hidden until runtime.

dynamic was introduced as part of the DLR (Dynamic Language Runtime)in .Net.

Example:
dynamic d = new MyClass();
d.InexistingMethod();

Eventhough the method "InexistingMethod" is not there - it will get compiled and thrown exception in runtime.

25.

How To Find Whether The Application Is Run From Inside Ide Or Not?

Answer»

Use System.Diagnostics.Debugger.IsAttached PROPERTY.If it is true that means a debugger is attached to the application ELSE not

Useful: While creating applications we can CHECK this property and skip the login page/form and directly launch the page/form we are DEBUGGING.

Use System.Diagnostics.Debugger.IsAttached property.If it is true that means a debugger is attached to the application else not

Useful: While creating applications we can check this property and skip the login page/form and directly launch the page/form we are debugging.

26.

You Are Designing A Single Person Shooter Game Application. The Player Can Choose Between Multiple Guns. 1) Pistol With 5 Bullets 2) Shotgun With 100 Bullets 3) Grenade Launcher With 20 Grenades Each Gun Will Have Different Sound Effects And Graphics.pressing Ctrl+space Should Rotate Between Guns.which Design Pattern Should You Employ For This?

Answer»

Use Strategy Pattern.
Explanation: Each GUN having different performance and GRAPHICS.
So this can be accomodated in the algorithm.
Strategy pattern is best suited for shifting the guns/algorithms There will be a IGun INTERFACE implemented by 3 classes
Pistol :IGun
SHOTGUN :IGun
GrenadeLauncher :IGun

Use Strategy Pattern.
Explanation: Each gun having different performance and graphics.
So this can be accomodated in the algorithm.
Strategy pattern is best suited for shifting the guns/algorithms There will be a IGun interface implemented by 3 classes
Pistol :IGun
Shotgun :IGun
GrenadeLauncher :IGun

27.

How To Prevent The Error While Updating Ui Control From Another Thread?

Answer»

Control.CheckForIllegalCrossThreadCalls = FALSE;

Control.CheckForIllegalCrossThreadCalls = false;

28.

How To Sort An Int Array In C#?

Answer»

Array class is having method to sort any arrays.

EXAMPLE:
INT[] array = NEW int[] { 10, 9, 8 };
Array.Sort(array);

Additional:
Sort is overloaded method with IComparer as argument too.

Array class is having method to sort any arrays.

Example:
int[] array = new int[] { 10, 9, 8 };
Array.Sort(array);

Additional:
Sort is overloaded method with IComparer as argument too.

29.

You Are Creating A Custom Usercontrol, Some Of The Newly Created Properties Are Shown In The Properties Window. How You Can Hide A New Property Named Theme From The Properties Window?

Answer»

USE the attribute [Browsable(false)] ALONG with the property

[Browsable(false)]
PUBLIC string THEME
{
get;
SET;
}

Use the attribute [Browsable(false)] along with the property

[Browsable(false)]
public string Theme
{
get;
set;
}

30.

You Are Designing A User Control. You Created New Property Called Backgroundimage Which Is Of Type Image. You Wanted To Disable Storing This Property In The User's Form. How To Achieve This?

Answer»

USE the ATTRIBUTE:
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

Use the attribute:
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

31.

What Is The Base Class Of All Classes In C#?

Answer»

It is OBJECT (Sytem.Object)

It is object (Sytem.Object)

32.

How To Find The Current Application File Path While Runtime?

Answer»

System.Reflection.Assembly.GetExecutingAssembly().LOCATION

System.Reflection.Assembly.GetExecutingAssembly().Location

33.

How To Block A Class From Being Inherited Further?

Answer»

USE sealed keyword.

Eg: public sealed CLASS TheClass
{
}

Use sealed keyword.

Eg: public sealed class TheClass
{
}

34.

What Is Class Library In .net

Answer»

class library is a collection of prewritten, ready-made SOFTWARE ROUTINES that act as templates for programmers to USE in WRITING object-oriented application PROGRAMS

class library is a collection of prewritten, ready-made software routines that act as templates for programmers to use in writing object-oriented application programs

35.

What Is Code Verification?

Answer»

Code verification ensure that proper code EXECUTION and TYPE safety while the code RUNS. It does not allow to perform illegal operation such as INVALID MEMORY location.

Code verification ensure that proper code execution and type safety while the code runs. It does not allow to perform illegal operation such as invalid memory location.

36.

What Is Strong Name?

Answer»

Strong name helps GAC(GLOBAL ASSEMBLY cache) to differentiate between two versions.It is only needed when we deploy the assembly with GAC. It USES public KEY cryptocrophy to ENSURE that no one spoof it.

Strong name helps GAC(Global assembly cache) to differentiate between two versions.It is only needed when we deploy the assembly with GAC. It uses public key cryptocrophy to ensure that no one spoof it.

37.

What Is Delay Signing?

Answer»

During development process we have to SIGN STRONG name with our application. But it is not GOOD practice in the SECURITY point of view. For that, we can sign it LATER. It is called delay signing.

During development process we have to sign strong name with our application. But it is not good practice in the security point of view. For that, we can sign it later. It is called delay signing.

38.

What Is Jit? What Are The Different Types Of Jit?

Answer»

JIT stands for Just-in-time compiler.It is a part of the runtime EXECUTION ENVIRONMENT. It compiles the INTERMEDIATE language and execute them. There are three types of JIT. They are,
1. Pre-JIT : compiles complete source code into native code in a single compilation cycle. This is done by at the time of deployment of the APPLICATION.
2. Econo-JIT : compiles only those methods that they are called at runtime. However, These compiled methods are removed when they are not REQUIRED.
3. Normal-JIT : compiles only those methods that they are called at runtime. These methods are compiled the first time they are called and then they are stored in cache. When the same methods are called again, the compiled code from cache is used for execution.

JIT stands for Just-in-time compiler.It is a part of the runtime execution environment. It compiles the intermediate language and execute them. There are three types of JIT. They are,
1. Pre-JIT : compiles complete source code into native code in a single compilation cycle. This is done by at the time of deployment of the application.
2. Econo-JIT : compiles only those methods that they are called at runtime. However, These compiled methods are removed when they are not required.
3. Normal-JIT : compiles only those methods that they are called at runtime. These methods are compiled the first time they are called and then they are stored in cache. When the same methods are called again, the compiled code from cache is used for execution.

39.

How To Install Or Uninstall A Windows Service?

Answer»

For Install:-

1)Go to visual STUDIO command prompt
(START => All PROGRAMS => Microsoft Visual Studio 2005 => Visual Studio Tools => Visual Studio 2005 Command Prompt)

2)installutil <Path of your SERVICE>
(e.g installutil C:\MyService.exe)

For UN Install:-

3)Go to visual Studio command prompt
(Start => All programs => Microsoft Visual Studio 2005 => Visual Studio Tools => Visual Studio 2005 Command Prompt)

4)installutil -U <Path of your Service>
(e.g installutil -U C:\MyService.exe)

For Install:-

1)Go to visual Studio command prompt
(Start => All programs => Microsoft Visual Studio 2005 => Visual Studio Tools => Visual Studio 2005 Command Prompt)

2)installutil <Path of your Service>
(e.g installutil C:\MyService.exe)

For UN Install:-

3)Go to visual Studio command prompt
(Start => All programs => Microsoft Visual Studio 2005 => Visual Studio Tools => Visual Studio 2005 Command Prompt)

4)installutil -U <Path of your Service>
(e.g installutil -U C:\MyService.exe)

40.

What Is Dcom?

Answer»

DCOM is a distributed extension of COM. It DIFFERS from COM in that it allows for creating objects distributed across a network, a PROTOCOL for INVOKING that object's methods, and secure to the object. DCOM provides a WRAPPER around COM, hence it is a backward compatible extension.

DCOM is a distributed extension of COM. It differs from COM in that it allows for creating objects distributed across a network, a protocol for invoking that object's methods, and secure to the object. DCOM provides a wrapper around COM, hence it is a backward compatible extension.

41.

What Is Multi-threading?

Answer»

Multi-threading FORMS SUBSET of multi-tasking instead of having to switch between programs this feature switches between different parts of the same PROGRAM. For example, we can write in WORD and at the same TIME word is doing a spell check in background.

Multi-threading forms subset of multi-tasking instead of having to switch between programs this feature switches between different parts of the same program. For example, we can write in word and at the same time word is doing a spell check in background.

42.

What Is Addressof Operator?

Answer»

Addressof operator creates a DELEGATE OBJECT to a METHOD.

example:
Dim pthread1 as NEW thread(AddressOf THREAD1)
Here thread1 is a method. pthread1 is a delegate object.

Addressof operator creates a delegate object to a method.

example:
Dim pthread1 as new thread(AddressOf thread1)
Here thread1 is a method. pthread1 is a delegate object.

43.

What Is Thread.sleep()?

Answer»

THREAD's execution can be paused by calling the thread.SLEEP method. This method TAKES an integer value that determines how LONG the thread should sleep.
Eg: Thread.CurrentThread.Sleep(2000)

Thread's execution can be paused by calling the thread.sleep method. This method takes an integer value that determines how long the thread should sleep.
Eg: Thread.CurrentThread.Sleep(2000)

44.

What Is Application Domain?

Answer»

In application DOMAINS multiple application can RUN in the same process with out influencing each othere. If ONE of the application domains throws ERROR it does not AFFECT the other application domains.

In application domains multiple application can run in the same process with out influencing each othere. If one of the application domains throws error it does not affect the other application domains.

45.

What Are The Different Types Of Remote Object Creation Mode In .net?

Answer»

There are two TYPES of REMOTE OBJECT CREATION mode. They are,

1.SAO(server ACTIVATED objects)
2.CAO(client activated objects)

There are two types of remote object creation mode. They are,

1.SAO(server activated objects)
2.CAO(client activated objects)

46.

In The Page Load Event I Assigned Dropdownlist's Datasource Property To A Valid List. On The Submit Button Click.. The Same Datasource Property Is Coming As Null. Why?

Answer»

As VIEWSTATE is not STORING the DataSource property.

We have to USE Items property of DROPDOWNLIST to GET the items back.

As ViewState is not storing the DataSource property.

We have to use Items property of DropDownList to get the items back.

47.

What Is The Purpose Of Enumerable Class In .net?

Answer»

It CONTAINS various extension METHODS like Where(), OrderBy() ETC. for the IList classes.

INORDER to get access for those methods, simply we have to include the System.Linq NAMESPACE.

It contains various extension methods like Where(), OrderBy() etc. for the IList classes.

Inorder to get access for those methods, simply we have to include the System.Linq namespace.

48.

Difference Between Authentication And Authorization?

Answer»

Authentication is a process of identifying a USER based on their credentials(means user ID and password).

Authorization is process of DETERMINING whether an authenticated user is allowed to access a specific resource or not.

Authentication is a process of identifying a user based on their credentials(means user id and password).

Authorization is process of determining whether an authenticated user is allowed to access a specific resource or not.

49.

Can We Maintain State In Webservice?

Answer»

Yes. WEBSERVICE don't have any mechanism.So, It can maintain state. By DEFAULT, webservice CLASS is derived for state maintenance.

Yes. Webservice don't have any mechanism.So, It can maintain state. By default, webservice class is derived for state maintenance.

50.

What Is A Clr Host?

Answer»

The Windows operating system does not provide support for running a CLR application. That support is provided by a CLR host. A CLR host is an application that is responsible for loading the CLR into a process, CREATING application domains within the process, and executing user code within the application domains. Examples of hosts that ship with the .NET Framework include:

ASP.NET. An ISAPI filter that ships with ASP.NET loads the CLR and does the initialization necessary to HANDLE WEB requests.

Internet Explorer. A MIME filter hooks into Internet Explorer versions 5.01 and HIGHER to execute managed controls referenced from HTML pages.

Shell Executables. When a managed application is LAUNCHED from a shell, a small piece of unmanaged code loads the CLR and transitions control of the application to the CLR.

The Windows operating system does not provide support for running a CLR application. That support is provided by a CLR host. A CLR host is an application that is responsible for loading the CLR into a process, creating application domains within the process, and executing user code within the application domains. Examples of hosts that ship with the .NET Framework include:

ASP.NET. An ISAPI filter that ships with ASP.NET loads the CLR and does the initialization necessary to handle web requests.

Internet Explorer. A MIME filter hooks into Internet Explorer versions 5.01 and higher to execute managed controls referenced from HTML pages.

Shell Executables. When a managed application is launched from a shell, a small piece of unmanaged code loads the CLR and transitions control of the application to the CLR.