Tuesday, March 15, 2011

Dot Net Interview Questions

Is it possible to derive your class from a base class and implement interfaces at the same time?
Yes its possible, we can use it like this
You have a specific requiremnt due to which you have to use a reserved keywords as an identifier name. How will you do that? Is it possible?
Yes its possible, You can precede the identifier with the @ symbol. This overrides the compiler error and enables you to use a keyword as an identifier.
What do you understand by unsafe mode in C#?

The C# language supports a special mode, called unsafe mode, that enables you to work directly with memory from within your C# code.
This special C# construct is called unsafe mode because your code is no longer safe from the memory-management protection offered by the CLR. In unsafe mode, your C# code is allowed to access memory directly, and it can suffer from the same class of memory-related bugs found in C and C++ code if you're not extremely careful with the way you manage memory

When to Use Asp Net Web Services

(i) Communicating through a Firewall:- When building a distributed application with 100s/1000s of users spread over multiple locations, there is always the problem of communicating between client and server because of firewalls and proxy servers. Exposing your middle tier components as Web Services and invoking the directly from a Windows UI is a very valid option.
(ii) Application Integration:- When integrating applications written in various languages and running on disparate systems. Or even applications running on the same platform that have been written by separate vendors.
(iii) Business-to-Business Integration:- This is an enabler for B2B intergtation which allows one to expose vital business processes to authorized supplier and customers. An example would be exposing electronic ordering and invoicing, allowing customers to send you purchase orders and suppliers to send you invoices electronically.
(iv) Software Reuse :- This takes place at multiple levels. Code Reuse at the Source code level or binary componet-based resuse. The limiting factor here is that you can reuse the code but not the data behind it. Webservice overcome this limitation. A scenario could be when you are building an app that aggregates the functionality of serveral other Applicatons. Each of these functions could be performed by individual apps, but there is value in perhaps combining the the multiple apps to present a unifiend view in a Portal or Intranet.