Sponsored Ad

Sunday, January 3, 2010

Interview Questions of C#

  1. What’s the implicit name of the parameter that gets passed into the class’ set method?
  2. How do you inherit from a class in C#?
  3. Does C# support multiple inheritance?
  4. When you inherit a protected class-level variable, who is it available to?
  5. Are private class-level variables inherited?
  6. Describe the accessibility modifier protected internal.
  7. C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?
  8. What’s the top .NET class that everything is derived from?
  9. How’s method overriding different from overloading? What does the keyword virtual mean in the method definition?
  10. Can you declare the override method static while the original method is non-static?
  11. Can you override private virtual methods?
  12. Can you prevent your class from being inherited and becoming a base class for some other classes?
  13. Can you allow class to be inherited, but prevent the method from being over-ridden?
  14. What’s an abstract class?
  15. When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)?
  16. What’s an interface class?
  17. Why can’t you specify the accessibility modifier for methods inside the interface?
  18. Can you inherit multiple interfaces?
  19. And if they have conflicting method names?
  20. What’s the difference between an interface and abstract class? How can you overload a method?
  21. If a base class has a bunch of overloaded constructors, and an inherited class has another bunch of overloaded constructors, can you enforce a call from an inherited constructor to an arbitrary base constructor?
  22. What’s the difference between System.String and System.StringBuilder classes?
  23. What’s the advantage of using System.Text.StringBuilder over System.String?
  24. Can you store multiple data types in System.Array?
  25. What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
  26. How can you sort the elements of the array in descending order?
  27. What’s the .NET datatype that allows the retrieval of data by a unique key?
  28. What’s class SortedList underneath?
  29. Will finally block get executed if the exception had not occurred?
  30. What’s the C# equivalent of C++ catch (…), which was a catch-all statement for any possible exception?

0 comments:

Post a Comment

Sponsored Ad

More Related Articles

Website Update

Followers