C# interview questions with answers

C# interview Questions with answers-- Asked at different competitive exams

Q11. An ________________ acts as a base class and is designed to be inherited by subclasses that either implement or either override its method.

A Super class
B Inherited class
C Derived class
D Abstract class
E None of these

Answer: D
Hint or Explanation An Abstact Class acts as a base class and is designed to be inherited by subclasses that either implement or either override its method.

Q12.What is Delegates in C#?

A Delegates are variables that hold references to methods
B Delegates are pointers that hold references to methods
C Delegates are used to client/server request and response purpose
D Delegates are used to RDBMS
E Delegates are linked list purpose to move one to one

Answer A

Hint or Explanation A delegate is a reference type variable that holds the reference to a method. The reference can be changed at runtime.
Delegates are especially used for implementing events and the call-back methods.

Q13.The ability of code to access the metadata of the assembly during runtime is called _____________.

A polymorphisum
B Reflection
C inheritance
D Redo
E Undo

Answer B

Hint or Explanation Reflection is the process of describing the metadata of types, methods and fields in a code. The namespace System.Reflection enables you to obtain data about the loaded assemblies, the elements within them like classes, methods and value types.

Q14.The process of converting some code into its binary format is known as ____________ in C#.

A Binary Format
B Delegates
C Serialization
D Thread Pooling
E Inheritance

Answer C

Hint or Explanation Serialization is a concept in which C# class objects are written or serialized to files. Let' say you had a C# class called Tutorial. And the class has 2 properties of ID and Tutorials name.
The process of converting some code into its binary format is known as Serialization.

Q15.What is Thread Pooling in C# ?

A A collection of threads, termed as a Thread Pool in C#
B A collection of method and variables, termed as a Thread Pool in C#
C A collection of client requests, termed as a Thread Pool in C#
D A collection of classes and its methods, termed as a Thread Pool in C#
E None of above

Answer A

Hint or Explanation Thread pooling is the process of creating a collection of threads during the initialization of a multithreaded application, and then reusing those threads for new tasks as and when required, instead of creating new threads.
Then every process has some fixed number of threads depending on the amount of memory available, those threads are the need of the application but we have freedom to increase the number of threads. Every thread in the pool has a specific given task.

Q16.What is XSD file in C#?

A eXtended Structured Data
B XML Structured Data
C XML Schema Definition
D eXtended Schema Defination
E None of above

Answer C

Hint or Explanation The XML Schema language is also referred to as XML Schema Definition (XSD). An XML Schema describes the structure of an XML document.
XSD is a schema language; you use it to define the possible structure and contents of an XML format. A validating parser can then check whether an XML instance document conforms to an XSD schema or a set of schemas.

Q17.__________________ in C# is a way of connecting two or more classes in a relationship as an inheritance.

A polymorphisum
B Constructor chaining
C multiple inheritance
D multilevel inheritance
E None of above

Answer B

Hint or Explanation A Constructor chaining in C# is a way of connecting two or more classes in a relationship as an inheritance.
Basically, it is a method in the class which executed when its object is created. We put the initialization code in the constructor.

Q18.The Array which has elements of type array is called __________ Array.

A jagged
B prototype
C object
D serialization
E None of above

Answer A

Hint or Explanation The Array which has elements of type array is called jagged Array.
In C#, jagged array is also known as "array of arrays" because its elements are arrays. The element size of jagged array can be different.

Q19. The _______ block is used to obtain a resource and process it and then automatically dispose of when the execution of the block completed.

A try
B catch
C using
D thread
E None of above

Answer C

Hint or Explanation The using block is used to obtain a resource and process it and then automatically dispose of when the execution of the block completed.

Q20. Constant variables are declared and initialized at ___________ time.

A compile
B run
C both compile and run
D variable memory allot at compile time, but value declared at run time
E None of above

Answer A

Hint or Explanation Constant variables are declared and initialized at compile time.

More pages : Interview Questions

0 Comments:

Post a Comment