Interview Tips Interview Tips, Interview Questions and Answers

8Aug/110

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?

2Aug/110

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
2Jul/110

Features of ListView Control:

·          Can define our own template/Layout/Structure for the data display.

·          Edit/Update/Delete capabilities on the data displayed.

·          Built-in support for inserting new row.

·          Built-in support for sorting

·          Supports databinding via DataSource Controls including LINQ DataSource controls.

·          Paging via DataPager control, which can be part of ListView control or can be kept outside the control. Means, DataPager can be kept at any part of page as opposed to GridView where the built-in paging is packed with the control itself.

To start this tutorial you need to drag a ListView control on a Page and you need to add LayoutTemplate, ItemTemplate and SelectedItemTemplate as shown in the following code. Notice that the HTML markup in SelectedItemTemplate is almost identical to ItemTemplate with only one difference that I am changing the background and text color of the row in SelectedItemTemplate to give user visual clue that the item is selected. Also notice the LinkButton I am using in both templates. The CommandName of these buttons is set to Select which is required to enable selections in ListView.

12Jun/110

Powerpacked new controls in Microsoft ASP.NET 3.5

DataPager - Controls like Gridview, Repeater exhibit the pagination behaviour. This is useful when display results return far too many records than an ideal web page height. A search may return countless records, but the web page size should not ideally go on and on depending on the number of records returned. For this, the feature of Page Numbers, OR Previous-Next feature at the bottom of the display results seem to be more ideal. For this purpose, the DataPager control has been introduced.

While using a ListView control, a DataPager control may be used along with it, to provide a paging functionality. The DataPager has a property called PagerControlId which is set to the ID of the ListView control. Simple!

ListView - This control is like an advanced Repeater control, and is as good as a GridView control in terms of features it has. It may be set to any standard data source like SQL, Oracle, Access, XML and even LINQ.

Say you want to display a matrix of values with 3 records per row, the ListView control is the ideal solution. The ListView settings may be made manually using the aspx page, OR may also be set using the Smart Tag feature to launch the properties dialog box.

ScriptManager - Every Ajax enabled page in ASP.NET that makes use of the Ajax Library needs to have a boss or a  manager that takes care of the internal Ajaxification process. All this is controlled by the ScriptManager control. Every page should have not more than one ScriptManager control. It takes care of the javascript functionalities, partial postbacks made by the web page by taking care of the XmlHttpRequest object from behind the scenes. More on Ajax, Read Here.

If the EnablePartialPostback property of the ScriptManager is set to false, the web page exhibits a full page postback.

ScriptManagerProxy - There might be a scenario where your master page and content page need to have separate ScriptManager controls. For such situations, the ScriptManagerProxy control comes to rescue. Here, the masterpage may contain the ScriptManager control, and the content page may use the ScriptManagerProxy control. However, internally, the ScripManagerProxy control communicates with the corresponding ScriptManager  class of the web page. The ScriptManagerProxy control actually transfers its set of responsibilities to the ScriptManager control.

UpdatePanel - This is the control that wraps all the controls that need to be partially posted back. A web page may comprise of several UpdatePanels. In case there is any event happening within the controls wrapped inside an UpdatePanel control, the entire page isn't posted back, rather only the contents within the UpdatePanel are posted back to the web server. If the partial postback property is to be avoided, set the ChildrenAsTriggers property of the UpdatePanel to false.

Further, the Triggers of an UpdatePanel may be used to set the application in such a way that the partial postback of the UpdatePanel may be invoked from controls that lie outside the UpdatePanel.

UpdateProgress - There are scenarios where a request may take time, an image may take time to load, a business logic may time to calculate, data may take time to load due to diversities in the source. In UpdatePanels, as postbacks are partial in nature, the browser's default progress bar does not appear. For avoiding any confusion to the end user, that a page process is going on in the background, the UpdateProgress control may be used. This is like a progress bar that shows to the end user that a process is going on. The progress may be set to any moving gif image as well, to enhance the look & feel of the web application.

1Jun/110

C# interview questions and answers

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. Where is the output of TextWriterTraceListener redirected? To the Console or a text file depending on the parameter passed to the constructor.
  7. How do you debug an ASP.NET Web application? Attach the aspnet_wp.exe process to the DbgClr debugger.
  8. 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).
  9. 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.
  10. Explain the three services model (three-tier application). Presentation (UI), business (logic and underlying code) and data (from storage or other sources).
28May/110

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
    }
}
25May/110

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.

24May/110

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.