.NET And Asp.Net Interview Questions Answers _ 4

Started by kaja mydeen, Mar 26, 2008, 08:16 PM

Previous topic - Next topic

kaja mydeen

.NET And Asp.Net Interview Questions Answers

What is the difference between an EXE and a DLL?

An EXE can run independently, whereas DLL will run within an EXE. DLL is an in-process file and EXE is an out-process file

What is strong-typing versus weak-typing? Which is preferred? Why?

Strong type is checking the types of variables as soon as possible, usually at compile time. While weak typing is delaying checking the types of the system as late as possible, usually to run-time. Which is preferred depends on what you want. For scripts & quick stuff you'll usually want weak typing, because you want to write as much less code as possible. In big programs, strong typing can reduce errors at compile time.

What are PDBs? Where must they be located for debugging to work?

Answer1:
To debug precompiled components such as business objects and code-behind modules, you need to generate debug symbols. To do this, compile the components with the debug flags by using either Visual Studio .NET or a command line compiler such as Csc.exe (for Microsoft Visual C# .NET) or Vbc.exe (for Microsoft Visual Basic .NET).

Using Visual Studio .NET
1. Open the ASP.NET Web Application project in Visual Studio .NET.
2. Right-click the project in the Solution Explorer and click Properties.
3. In the Properties dialog box, click the Configuration Properties folder.
4. In the left pane, select Build.
5. Set Generate Debugging Information to true.
6. Close the Properties dialog box.
7. Right-click the project and click Build to compile the project and generate symbols (.pdb files).

Answer2:
A program database (PDB) file holds debugging and project state information that allows incremental linking of a Debug configuration of your program.
The linker creates project.PDB, which contains debug information for the project's EXE file. The project.PDB contains full debug information, including function prototypes, not just the type information found in VCx0.PDB. Both PDB files allow incremental updates.
They should be located at bin\Debug directory

What is cyclomatic complexity and why is it important?

Cyclomatic complexity is a computer science metric (measurement) developed by Thomas McCabe used to generally measure the complexity of a program. It directly measures the number of linearly independent paths through a program's source code.

The concept, although not the method, is somewhat similar to that of general text complexity measured by the Flesch-Kincaid Readability Test.

Cyclomatic complexity is computed using a graph that describes the control flow of the program. The nodes of the graph correspond to the commands of a program. A directed edge connects two nodes, if the second command might be executed immediately after the first command. By definition,

CC = E - N + P

where
CC = cyclomatic complexity
E = the number of edges of the graph
N = the number of nodes of the graph
P = the number of connected components.

What is FullTrust? Do GAC'ed assemblies have FullTrust?

Your code is allowed to do anything in the framework, meaning that all (.Net) permissions are granted. The GAC has FullTrust because it's on the local HD, and that has FullTrust by default, you can change that using caspol

What does this do? gacutil /l | find /i "about"

Answer1:
This command is used to install strong typed assembly in GAC

Answer2:
gacutil.exe is used to install strong typed assembly in GAC. gacutil.exe /l is used to lists the contents of the global assembly cache. |(pipe) symbol is used to filter the output with another command. find /i "about" is to find the text "about" on gacutil output. If any lines contains the text "about" then that line will get displayed on console window.

Contrast OOP and SOA. What are tenets of each

Service Oriented Architecture. In SOA you create an abstract layer that your applications use to access various "services" and can aggregate the services. These services could be databases, web services, message queues or other sources. The Service Layer provides a way to access these services that the applications do not need to know how the access is done. For example, to get a full customer record, I might need to get data from a SGL Server database, a web service and a message queue. The Service layer hides this from the calling application. All the application knows is that it asked for a full customer record. It doesn't know what system or systems it came from or how it was retrieved.

How does the XmlSerializer work? What ACL permissions does a process using it require?

XmlSerializer requires write permission to the system's TEMP directory.

Why is catch(Exception) almost always a bad idea?

Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project.

What is the difference between Debug. Write and Trace. Write? When should each be used?

Answer1:
The Debug. Write call won't be compiled when the DEBUG symbol is not defined (when doing a release build). Trace. Write calls will be compiled. Debug. Write is for information you want only in debug builds, Trace. Write is for when you want it in release build as well. And in any case, you should use something like log4net because that is both faster and better

Answer2:
Debug. Write & Trace. write - both works in Debug mode, while in Release Mode,Trace.write only will work .Try changing the Active Config property of Solution in Property page nd find the difference. Debug.write is used while debugging a project and Trace.write is used in Released version of Applications.

What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not?

Debug build contain debug symbols and can be debugged while release build doesn't contain debug symbols, doesn't have [Conational("DEBUG")] methods calls compiled, can't be debugged (easily, that is), less checking, etc. There should be a speed difference, because of disabling debug methods, reducing code size etc but that is not a guarantee (at least not a significant one)

Contrast the use of an abstract base class against an interface?

Answer1:
In the interface all methods must be abstract, in the abstract class some methods can be concrete. In the interface no accessibility modifiers are allowed, which is ok in abstract classes

Answer2:
Whether to Choose VB.NET/C#.
Both the languages are using same classes and namespaces. Once it compile and generates MSIL, there is no meaning of which language it was written. If you are Java/C++ programmer better to choose C# for same coding style otherwise you can choose VB.net.
love to write always
Kajamydeen