.NET interview questions for 5+ years of experience - OOPS, C#, WPF, .NET Fundamentals
Recently, I attended interview with NeST, Trivandrum and mode of the interview is telephonic. I used WPF, WCF in my last project. So they mainly concentrated in C#, .NET Fundamentals, WPF and OOPs concents. Most of the questions look common but some of the questions are new. I will try to post answers also.
1. What is the difference between abstract and interface?
2. Is it possible to use properties and events in an interface?
3. What is an explicit interface implementation?
4. When will we go for an explicit interface implementation?
5. What is the difference between value type and reference type?
6. Is string reference type or value type?
7. String is immutable. Why and how will you over come this issue?
8. How will you create a thread?
9. How will you start a thread?
10. What are the difference between delegates and events?
11. What is GAC?
12. How will you place an assembly in GAC?
13. How will you trigger GC to clean up memory?
14. C# - Managed Code; Who manages what?
15. Is it possible to create unmanaged code by C#?
16. What is the difference between C++ and C#?
17. How will you handle exceptions in C#?
18. Is it possible to have finally block without catch?
19. If catch throws an expection, will finally block gets execute?
20. What is the use of finally block?
21. What is cross thread exception?
22. What is attached property?
23. What are the advantages of WPF over windows forms?
24. What is dependency property?
25. What are the different types of bindings?
26. How will you change the shape of a button?
27. What is the difference between control template and styles?
28. Could you call a method by binding?
29. What is a value converter?
30. What is a multi value converter?
31. How will you update the UI if the data is refreshed by some other thread?
32. What is template binding?
33. What is the difference between logical tree and visual tree?
34. What are routed events?
35. What are the different types of layouts in WPF?
36. What is canvas?
37. What are the design patterns you know?
38. How will you find the dependencies in observer pattern?
1. Difference between abstract and interface:
abstract is a keyword used to declare an abstract class, method, or property; and interface is a keyword used to declare interface.
Abstract class is a semi implemented class and has to be only used as a base class. It may or may not have abstract members (methods). All abstract methods must be implemented in derived classes. You cannot instantiate an abstract class (cannot create objects).
Interface is a contract for other classes as all its members (methods) needs to be implemented in the derived classes. It is not a class. You cannot create an instance of the interface. A class can implement multiple interfaces. By defaul all members of an interface are abstract.
2.