InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
How to run power shell script in cSharp? |
|
Answer» How to RUN power shell script in CSHARP? |
|
| 2. |
What are the other equivalent alternate of Exit() for quitting csharp application? |
|
Answer» What are the other EQUIVALENT alternate of Exit() for quitting csharp application? |
|
| 3. |
Create dynamic Textbox in Panel control with the help of list |
|
Answer» Create dynamic Textbox in Panel CONTROL with the help of list |
|
| 4. |
Write down some common difference between Span and Array? |
|
Answer» Write down some common difference between Span T and Array? Some of the USER SAYING Span |
|
| 5. |
What is the reason or why would we use Untrusted Verification? |
|
Answer» What is the reason or why WOULD we USE Untrusted Verification? |
|
| 6. |
Mention some of ref struct restrictions in c#? |
|
Answer» Mention some of ref struct restrictions in csharp? Below are some restrictions which prevent a ref struct value ends up on heap at runtime:- (1)We can not use ref struct as a type argument. (2)We can not use ref struct to implement interfaces. (3)A ref struct variable can not be used in iterators. (4)We can not boxed ref struct to System.ValueType or System.Object. (5)We can not CAPTURED ref struct variable by a lambda expression or local function. (6)We can not used ref struct variable in an async methods. But we can use ref struct VARIABLES in synchronous methods. (7)We can not use ref struct as element type of an array. (8)We can not use ref struct to declare type of field of a CLASS or a struct. But a ref struct can type a field of ref struct. |
|
| 7. |
What are the new feature of C# 11 that is coming? |
|
Answer» What are the new feature of C# 11 that is coming? |
|
| 8. |
what is multicast delegate |
|
Answer» The C# LANGUAGE support feature that is known as the multicast delegate. Any delegate that has a void return type is called multicast delegate. A multicast delegate can be assigned and invoke multiple methods. |
|
| 9. |
What is Anonymous method in csharp? |
|
Answer» What is Anonymous method in csharp? |
|
| 10. |
What are the four main limitations of Anonymous Method? |
|
Answer» What are the four main limitations of Anonymous METHOD? |
|
| 11. |
What are the different aspects or points of Anonymous Methods? |
|
Answer» What are the different aspects or points of ANONYMOUS Methods? |
|
| 12. |
Definition of Tuple class with some examples? |
|
Answer» Definition of Tuple CLASS with some examples? |
|
| 13. |
A three level Class Hierarchy example with systax? |
|
Answer» A three level CLASS Hierarchy example with systax? |
|
| 14. |
Write down the four main difference between Casting and Conversion? |
|
Answer» Write down the FOUR MAIN DIFFERENCE between Casting and CONVERSION? |
|
| 15. |
Different way to fetch int values from enum in csharp? |
|
Answer» DIFFERENT way to fetch int values from ENUM in csharp? First we will define enum then will discuss the different conversion technique to convert them into int. public enum Study { subject = 2, COURSE = 3, books = 4, author = 5, } Here below we will create a object of enum and fetch the first Enum e = Study.subject; And below is the different conversion or parsing techniques int i = Convert.ToInt32(e); int i = (int)(object)e; int i = (int)Enum.Parse(e.GetType(), e.ToString()); int i = (int)Enum.ToObject(e.GetType(), e); |
|
| 16. |
Accessibility Levels for class,enum,struct,interface |
|||||||||||||||
|
Answer» Below table HELPS to UNDERSTAND what are the different member DEFAULT accessibility and what accessibility they can opt and what they cannot opt.
|
||||||||||||||||
| 17. |
Can we declare Classes and Structs as static? |
|
Answer» Can we DECLARE CLASSES and STRUCTS as STATIC? |
|
| 18. |
What do you think csharp have Its Own Class Library? |
|
Answer» What do you think csharp have Its Own CLASS LIBRARY? |
|
| 19. |
How to get the name of all folder and bind that list to dropdownlist |
|
Answer» Below CODE will HELPS us to get LIST of all the folder name in SPECIFIED folder and bind that list to dropdownlist |
|
| 20. |
Is it possible to place Virtual Fields inside a Class? |
|
Answer» Is it possible to place VIRTUAL FIELDS inside a Class? |
|
| 21. |
Syntax to create datatable in c# |
|
Answer» Below CLASS is USED to create a table and how to use that table |
|
| 22. |
Swap two int with temp variable and without temp variable |
|
Answer» Below SOURCE code will help you to swap values between two INTEGER with help of temp variable and without temp variable |
|
| 23. |
StreamReader and StreamWriter with example |
|
Answer» StreamWriter and StreamReader taking twice the memory footprint in some cases over the basic FileStream. StreamReader is designed for character input in a PARTICULAR encoding, whereas the Stream class is designed for byte input and output.StreamReader is nothing but file pointer. |
|
| 24. |
What is static modifier and its example |
|
Answer» AS the name suggest static Static modifier are used to declare a static member and belongs to type itself rather than to specific object. We can use static modifier with fields, operators, properties, events, constructors and METHODS but we cannot used with indexers, destructors, or types.Once we declare static varible it will automatically initialized in memory by there default value or value defined by user once we will initialized static VARIABLE it will never reinitialized in memory on other hand local variables local variable reinitialized in memory every time they call as well as all the objects of the CLASS SHARE the same address of static variable. |
|
| 25. |
Simplest definition of partial classes and its rules? |
|
Answer» Simplest definition of partial classes and its rules? |
|
| 26. |
Implement two interface with same function define in them |
|
Answer» Below is the example how to HANDLE two INTERFACE same implementation in the class |
|
| 27. |
Define Race Condition in cSharp? |
|
Answer» Define Race Condition in cSharp? |
|
| 28. |
Features of c# over Java |
|
Answer» Below are the some common differences between c# and Java |
|
| 29. |
Use of virtual, sealed, override, and abstract |
|
Answer» (1)The USE of VIRTUAL keyword is to enable or to allow a class to be overridden in the derived class. |
|
| 30. |
Code to get total time taken by webpage |
|
Answer» Below CODE is USED to get time taken by webpage to download :- |
|
| 31. |
How to use Extension Methods in C# |
|
Answer» Extension methods is a new feature of C# 3.0 that allows you to enhance an existing FRAMEWORK CLASS by adding a new method to it without modifying the ACTUAL code of that class.Suppose you want to calculate the 4th power of an integer. For that you will have to square it two times. So instead of that you can create an Extension Method on integer |
|
| 32. |
Is it possible to pass default value in parameter in c# |
|
Answer» YES in CSHARP vesion 4.0 we have facilty to pass parametrs with default value to get this done we take an example as below:- class ProgramDefaultVal { public static void mydefmethod(STRING dfval="testvalue") { Console.WriteLine(dfval); } static void MAIN() { mydefmethod(); } } |
|
| 33. |
C#.Net Reserve Words |
|
Answer» virtual, class, abstract , as , base , byte , char , decimal ,int , sbyte , uint , ulong , UNCHECKED , unsafe , ushort , bool , BREAK , case , catch , finally , checked , const , continue , default , delegate , do , double , else , enum , event , explicit , EXTERN , false , fixed , float , for , foreach , goto , if , implicit , in , interface , internal , is , LOCK , long , namespace , new , null , object , operator , out , override , params , private , protected , public , readonly , ref , return , sealed , short , SIZEOF , stackalloc , static , string , struct , switch , while , this , throw , true , try , typeof , using , void , volatile |
|
| 34. |
can we inherit private class level variables in c# |
|
Answer» Yes we can do this but we cannot ACCESS them. Although they are not VISIBLE or ACCESSIBLE. But with help of class INTERFACE they are INHERITED. |
|
| 35. |
How to write alphabets from A to Z from for loop |
|
Answer» Below code is USED to type ALPHABETS from a to Z |
|
| 36. |
Code to get number is perfect or not |
|
Answer» Below code will help you to get wheather number is a perfect or not if it is perfect number then it will return TRUE |
|