Select chapter



Basics (2.papers)
Data Types (2.papers)
enums (2.papers)
OOPS (4.papers)
Arrays (1.papers)
Structs (2.papers)
Properties (2.papers)
Strings (2.papers)
Interfaces (1.papers)
Constructors (2.papers)
Ref-Out-Keywords (1.papers)
Collections (2.papers)
Generics (1.papers)
Hide

Sponsored Links


  

c# interview questions and answers

1
What is a Collection in C# ?
  1. A Collection in C# is used for storing group of related or unrelated data.
  2. A Collection in C# is usually used for storing group of related similar data.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
3
In which namespace most of the non generic collection classes are present ?
  1. System
  2. System.Collections.NonGeneric
  3. System.Collections
  4. System.Collections.Specialized
Show Answer
Share Facebook gmail Twitter
4
In which namespace, ListDictionary class is present ?
  1. System
  2. System.Collections.NonGeneric
  3. System.Collections
  4. System.Collections.Specialized
Show Answer
Share Facebook gmail Twitter
5
Which of the following interfaces is implemented by Hashtable class ?
  1. IEnumerable
  2. ICollection
  3. IDictionary
  4. All of the above.
Show Answer
Share Facebook gmail Twitter
6
Which of the following statements is not correct about Hashtable collection class ?
  1. Hashtable stores data in buckets as key and value pairs.
  2. Hashtable will not allow null values as keys.
  3. Hashtable will not allow duplicate keys.
  4. Hashtable will not allow duplicate values.
Show Answer
Share Facebook gmail Twitter
7
What is the difference between ListDictionary and Hashtable collection classes ?
  1. No difference .
  2. Both are dictionary based collection classes, ListDictionary stores data based on the sorted order of keys but Hashtable stores data based on hashcode.
  3. ListDictionary is used for storing less number of key and value pairs but Hashtable is used for storing and retrieving large number of key value pairs.
  4. ListDictionary is not a Dictionary based collection where as Hashtable is a dictionary based collection.
Show Answer
Share Facebook gmail Twitter
8
What is the difference between an Array and an ArrayList in C# ?
  1. ArrayList can able to store any data but Array can able to store only homogenious data.
  2. ArrayList is dynamic but Array is fixed size.
  3. ArrayList can able to store data in a SortedOrder where as Array cannot.
  4. None of the above.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
13
Which methods are used for inserting and retrieving  data from a queue collection class ?
  1. Enqueue and Dequeue
  2. Insert and Remove
  3. Add and Remove
  4. None of the above .
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
15
What is the use of ObservableCollection generic class in C# ?
  1. ObservableCollection is a normal generic class which is used inplace of Hashtable for eliminating Boxing, unBoxing and Type casting issues.
  2. Observable generic collection is useful for returning notification when changes are happening to the collection.
Show Answer
Share Facebook gmail Twitter
16
In which namespace all the generic collection classes are present ?
  1. System
  2. System.Generic.Collections
  3. System.Collections.Specialized
  4. System.Collections.Generic
Show Answer
Share Facebook gmail Twitter
17
What is DictionaryEntry ?
  1. DictionaryEntry is a collection class which can able to store more than one key value pair.
  2. DictionaryEntry is a collection class which can able to store only one key and value pair.
  3. DictionaryEntry is a struct which can able to store only a single key and value pair.
  4. None of the above.
Show Answer
Share Facebook gmail Twitter
18
In which order Stack collection class returns data ?
  1. First In First Out
  2. Last In First Out
  3. It depends on the order in which we are removing data programmatically.
  4. None of the above.
Show Answer
Share Facebook gmail Twitter
19
In which order Queue collection class returns data ?
  1. First In First Out
  2. Last In First Out
  3. It depends on the order in which we are removing data programatically.
  4. None of the above.
Show Answer
Share Facebook gmail Twitter
20
What is the problem with non generic based collections in C# ?
  1. All the non generic collection classes will perform Boxing, UnBoxing operations and Casting operations, Which may leads to exceptions.
  2. Type safety is the main issue with non generic collection classes or type safety is very less for non generic collection classes.
  3. Both the statements are correct.
  4. Both the statements are not correct.
Show Answer
Share Facebook gmail Twitter
Read more papers :