WPF Interview Questions
1. What is WPF ? Why it is used?
2. What is XAML?
3. What is Dispatcher Object?
4. What is Dependency Object?
5. What is the architecture of WPF?
6.What is are Types of events and Event Routing or a Routed Event?
7. What is difference between Event Bubbling vs Event Tunneling? When to apply what?
8.What are difference between Win-Forms and WPF?
9. What are different types of Panels in WPF ?Explain them?
10.What is difference between StackPanel, DockPanel, WrapPanel and Grid?
11.What are Primitive Controls and Look Less Controls?
12.What are different important components to know in WPF? Explain them?
13. Why do you think WPF has more power?
14. What is difference between WPF and Web Applications which do you prefer? When to choose what?
15. Is Silverlight part of WPF or subset of WPF? What is difference between WPF and Silverlight
16. What is the class name from which all WPF objects are derived from?
17. How did you create Dependency Object?
18. How did you implement Dependency Property?
19. What is PRISM ? What are its advantages of using it in real time applications?
10. How did you install and implement PRISM in real-time applications?
Basic WPF interview questions
- Strong .NET 2.0 Background & willing to learn!
- Explain dependency properties?
- What's a style?
- What's a template?
- Binding
- Differences between base classes: Visual, UIElement, FrameworkElement, Control
- Visual vs Logical tree?
- Property Change Notification (INotifyPropertyChange and ObservableCollection)
- ResourceDictionary - Added by a7an
- UserControls - Added by a7an
- difference between bubble and tunnel routing strategies - added by Carlo
- Why did Microsoft introduce yet another markup language?
- XAML
C# interview questions and answers
- What debugging tools come with the .NET SDK? CorDBG – command-line debugger, and DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR. To use CorDbg, you must compile the original C# file using the /debug switch.
- What does the This window show in the debugger? It points to the object that’s pointed to by this reference. Object’s instance data is shown.
- What does assert() do? In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true.
- What’s the difference between the Debug class and Trace class? Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds.
- Why are there five tracing levels in System.Diagnostics.TraceSwitcher? The tracing dumps can be quite verbose and for some applications that are constantly running you run the risk of overloading the machine and the hard drive there. Five levels range from None to Verbose, allowing to fine-tune the tracing activities.
- Where is the output of TextWriterTraceListener redirected? To the Console or a text file depending on the parameter passed to the constructor.
- How do you debug an ASP.NET Web application? Attach the aspnet_wp.exe process to the DbgClr debugger.
- What are three test cases you should go through in unit testing? Positive test cases (correct data, correct output), negative test cases (broken or missing data, proper handling), exception test cases (exceptions are thrown and caught properly).
- Can you change the value of a variable while debugging a C# application? Yes, if you are debugging via Visual Studio.NET, just go to Immediate window.
- Explain the three services model (three-tier application). Presentation (UI), business (logic and underlying code) and data (from storage or other sources).
What are Object Initializers in C#
The Object initializers are the features for programming concepts which was introduced in C#.Net.
The aim of using Object Initializers is to intializing the accessible fields or properties
of an object without the need to write any parameterized constructor or separate
statements.
Sample:
using System;
class Student
{
int rollno;
string stdName;
static void Main()
{
Student s = new Student() { rollno=1,stdName="Ramesh" }; //Object Initializer
}
}
C# interview questions
1 Describe the difference between a Thread and a Process?
2 What is a Windows Service and how does its lifecycle differ from a "standard" EXE?
3 What is the maximum amount of memory any single process on Windows can address? Is this different than the maximum virtual memory for the system? How would this affect a system design?
4 What is the difference between an EXE and a DLL?
5 What is strong-typing versus weak-typing? Which is preferred? Why?
6 Corillian's product is a "Component Container." Name at least 3 component containers that ship now with the Windows Server Family.
7 What is a PID? How is it useful when troubleshooting a system?
8 How many processes can listen on a single TCP/IP port?
9 What is the GAC? What problem does it solve?
10 What is serialization in .NET? What are the ways to control serialization?
11 Does C# support multiple inheritance?
12 What’s the implicit name of the parameter that gets passed into the class’ set method?
13 What’s the top .NET class that everything is derived from?
14 How’s method overriding different from overloading?
15 What is CLR?
16 What is CTS?
17 What is CLS?
18 What is strong name?
19 What is Application Domain?
20 Describe the difference between Interface-oriented, Object-oriented and Aspect-oriented programming.
Events and Delegates in c#
1. What’s a delegate?
A delegate object encapsulates a reference to a method.
2. What’s a multicast delegate?
A delegate that has multiple handlers assigned to it. Each assigned handler (method) is called.
3. What’s the implicit name of the parameter that gets passed into the class’ set method?
Value, and it’s datatype depends on whatever variable we’re changing.
4. How do you inherit from a class in C#?
Place a colon and then the name of the base class.
5. Does C# support multiple inheritance?
No, use interfaces instead.
6. When you inherit a protected class-level variable, who is it available to?
Classes in the same namespace.
7. Are private class-level variables inherited?
Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited.
8. Describe the accessibility modifier protected internal.?
It’s available to derived classes and classes within the same Assembly (and naturally from the base class it’s declared in).
9. 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?
Two. Once you write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if there’s no implementation in it.
10. What’s the top .NET class that everything is derived from?
System.Object.