• +91 9971497814
  • info@interviewmaterial.com

CSharp Interview Questions Answers

Question 1 : Normal 0 f

Answer 1 : Normal 0 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} A sorted HashTable.

Question 2 : Normal 0 f

Answer 2 : Normal 0 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block

Question 3 : What is CLS (Common Language Specificaiton)?

Answer 3 : It provides the set of specificaiton which has to be adhered by any new language writer / Compiler writer for .NET Framework. This ensures Interoperability. For example: Within a ASP.NET application written in C#.NET language, we can refer to any DLL written in any other language supported by .NET Framework. As of now .NET Supports around 32 languages.

Question 4 :   Can you store multiple data types in System.Array?

Answer 4 : No.

Question 5 :   What does the term immutable mean?

Answer 5 : The data value may not be changed.  Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory.

Question 6 :   What is hiding in CSharp ?

Answer 6 :   Hiding is also called as Shadowing. This is the concept of Overriding the methods. It is a concept used in the Object Oriented Programming. E.g.  public class ClassA {  public virtual void MethodA() {   Trace.WriteLine("ClassA Method");  } } public class ClassB : ClassA {  public new void MethodA() {   Trace.WriteLine("SubClass ClassB Method");  } } public class TopLevel {  static void Main(string[] args) {   TextWriter tw = Console.Out;   Trace.Listeners.Add(new TextWriterTraceListener(tw));     ClassA obj = new ClassB();   obj.MethodA(); // Outputs “Class A Method"     ClassB obj1 = new ClassB();   obj.MethodA(); // Outputs “SubClass ClassB Method”  } }

Question 7 :   What’s the difference between System.String and System.Text.StringBuilder classes?

Answer 7 : System.String is immutable.  System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed. 

Question 8 :   When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)?

Answer 8 : Normal 0 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} When at least one of the methods in the class is abstract. When the class itself is inherited from an abstract class, but not all base abstract methods have been over-ridden

Question 9 :   Can multiple catch blocks be executed for a single try statement?

Answer 9 :   No.  Once the proper catch block processed, control is transferred to the finally block (if there are any). 

Question 10 :   Explain the three services model commonly know as a three-tier application.

Answer 10 : Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources). 

CSharp Contributors

Rajeev Katiyar

Share your email for latest updates

Name:
Email:

Our partners