Basic .NET useful questions

Junior, medior or senior it is always a good thing to evaluate your knowledge and fill in the gaps you may have. Questions always help to emphasize and pay extra attention to some particular aspects. I have tried below to gather a small collection of questions useful when working as a .Net software developer.

  1. Explain the difference between value and reference types.
  2. Which of the following are value types? (Choose all that apply)
    • A. Decimal
    • B. String
    • C. System.Drawing.Point
    • D. Integer
  3. Which of the following are reference types? (Choose all that apply)
    • A. Types declared  Nullable
    • B. String
    • C. Exception
    • D. All types derived from System.Object
  4. What is the correct order for catch clauses when handling different exception types?
    • A. Most general to most specific
    • B. Most specific to most general
    • C. Most likely to occur to least likely to occur
    • D. Least likely to occur to most likely to occur
  5. You pass a value-type variable into a procedure as an argument. The procedure changes the variable; however, when the procedure returns, the variable has not changed. What happened? (Choose one.)
    • A. The variable was not initialized before it was passed in
    • B. Passing a value type into a procedure creates a copy of the data
    • C. The variable was re-declared within the procedure level
    • D. The procedure handled the variable as a reference
  6. How can you change the value of two integer variables without using a third one?
  7. Which of the following statements generates a string containing the text “Veni, vidi, vici”?
    • A. String.Format(“{0}, {1}, {2}”, Veni, vidi, vici”)
    • B. String.Format(“{1}, {2}, {3}”, “Veni”, “vidi”, “vici”)
    • C. String.Format(“{2}, {0}, {3}”, “vidi”, “Venti”, “Veni”, “vici”)
    • D. String.Format(“{Veni, vidi, vici}”)
  8. Explain why Array is faster than ArrayList
  9. What is the difference between == and .Equals() ?
  10. What is the difference between override and overload ?
  11. Can you assign NULL to a DataTime variable ?
  12. What is the difference between an abstract class and an interface ?
  13. What is the proper way to re-throw an exception, throw or throw ex ?
  14. What is the difference between Class and Structure ?
  15. Can multiple inheritance be used in .NET?


Sign Up To Our Newsletter

Stay up-to-date with our technical tips, click on a story to learn more.

Join Now