1) Describe the difference between a Thread and a Process?
Thread is minimum unit for processor to execute. Collections of threads make process. By dividing process into threads, processor achieves multi tasking (by running threads concurrently not parallel). Threads can share memory but processes can’t share memory. Threads can communicate with each other of same process without any middle layer but process can’t they required inter process communication kind of thingy.1.Threads(Light weight Processes) share the address space of the process that created it; processes have their own address.
2.Threads have direct access to the data segment of its process; processes have their own copy of the data segment of the parent process.
3.Threads can directly communicate with other threads of its process; processes must use interprocess communication to communicate with sibling processes.
4.Threads have almost no overhead; processes have considerable overhead.
5.New threads are easily created; new processes require duplication of the parent process.
6.Threads can exercise considerable control over threads of the same process; processes can only exercise control over child processes.
7.Changes to the main thread (cancellation, priority change, etc.) may affect the behavior of the other threads of the process; changes to the parent process does not affect child processes.If we consider running a word processing program to be a process, then the auto-save and spell check features that occur in the background are different threads of that process which are all operating on the same data set (your document).
2) What is a Windows Service and how does its lifecycle differ from a "standard" EXE?
Windows service is windows based background process which has no user interface like any other service (aka daemon in UNIX based environment). Windows service needs to be installed before executing unlike EXE. Windows service used to perform such tasks which doesn’t required user interaction but system status based events like performing tasks at specific intervals or at different state of system like alarm user when disk is about to get full to clean up. Windows service is controlled by Service control manager (SCM) and it started automatically even user didn’t login to his/her windows account (as SCM already has account credentials so SCM knows if system start which service needs to start and by which account), where as EXE is controlled by OS and runs only when user get login using windows account.
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?
Single process on windows can address different amount of memory as it depends upon systems (32bit/64bit processor) and OS as well. Yes, process memory consumption size can be different from maximum virtual memory size. If software/process code is written by keeping 64 bit processor (as 64 bit processor support more than double memory) then it won’t be able to run that process on 32 bit system.
Windows processes are allowed 4GB of virtual address space, regardless of the actual amount of memory on the machine. Windows x64 allows 16TB of address space.
4) What is the difference between an EXE and a DLL?
Exe is executable and independent program/process to run which has its own reserved memory space whereas DLL (Dynamic Link Library) is neither executable and not even independent, it used by other DLL/program.
5) What is strong-typing versus weak-typing? Which is preferred? Why?
Strong typing means when code compiles, type rules enforced strictly according to their data assigned to them. whereas weak typing is quite opposite of this definition. JavaScript/C/C++ is weak typing. but .net based languages are strongly typed. Strong typing is preferred by means of less run time errors risk and efficient during execution of program but not during compile time.
Strong-typing refers to defining the specific type of a reference at compile time rather than at run time. This results in more efficient execution and memory optimizations at compile time, as well as reduces the chance of a programmer accidentally providing a value of a type another component wasn't expecting.
6) Corillian's product is a "Component Container." Name at least 3 component containers that ship now with the Windows Server Family.
Component containers implement the IContainer interface to wrap components, providing a meta-architecture for organizing, interacting and communicating with the components.
7) What is a PID? How is it useful when troubleshooting a system?
(Ambiguous) This could refer to either a Microsoft Product ID -- the unique key that brands each activatable component installed on a system -- or to a Process ID, which is a means of referring to a specific process in calls to the Windows API.
8) How many processes can listen on a single TCP/IP port?
I think single process can only hold handler of any port at a time means can listen on single port. Once I got error when I ran my web application as another application (skype) was using that port. It make sense as well, ports are like doors if two people talk on specific door and third one comes up then no privacy :-D (divorce ratio would be dramatically raised)
9) What is the GAC? What problem does it solve?
GAC stands for Global Access Cache where shareable/public assemblies (DLL) stored to be used by multiple programs. It gives a shared platform for programs to use single assembly and can store same assembly (of same name) with different versions and can help to solve DLL HELL.
10) Describe the difference between Interface-oriented, Object-oriented and Aspect-oriented programming.
Object-oriented programming consists of defining programming structures around logical units of data and the functionality required to operate on them. Interface-oriented programming extends upon the concept by mandating that cross-dependencies between objects be expressed in the form of abstracted, defined guidelines (without specific implementation) so that objects have set expectations for touchpoints. Aspect-oriented programming proceeds one step further, defining certain "first tier" processes which apply to almost all objects (such as logging), and providing high level means of attaching functionality to a wide swath of objects without specific implementation required in each one.
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.
Object-oriented programming consists of defining programming structures around logical units of data and the functionality required to operate on them. Interface-oriented programming extends upon the concept by mandating that cross-dependencies between objects be expressed in the form of abstracted, defined guidelines (without specific implementation) so that objects have set expectations for touchpoints. Aspect-oriented programming proceeds one step further, defining certain "first tier" processes which apply to almost all objects (such as logging), and providing high level means of attaching functionality to a wide swath of objects without specific implementation required in each one
21) Describe what an Interface is and how it’s different from a Class.
Interfaces are "guidelines without implementation" for functionality in an object. They define methods and properties which must be exposed, but leave it to the individual object to determine implementation.
An interface is strictly a Contract without implementation means interface can only declare properties or methods. Class can have implementation of its methods, can have different level of access identifiers whereas interface’s properties or methods can have only public access identifier and can implement class and multiple interfaces.
22) What is Reflection?
Reflection is the ability to dynamically execute code without pre-linking at compile time. This may take the form of dynamic module loading and late binding, or it may take the form of real-time code construction and compilation.
Reflection is mechanism to load dynamically assembly at runtime and using assembly Meta data can access its namespace, class and their properties, methods and even events.
23) What is the difference between XML Web Services using ASMX and .NET Remoting using SOAP?
Web services are generally stateless, using a standard HTTP interface, while remoting is highly customizable and extensible, varying by the specific application that uses it.
Remoting assumes the other end is .NET. This is because .NET remoting using SOAP uses the SoapFormatter to serialize data. SoapFormatter embeds the type information required to deserialize the object into the message itself. This requires that the client and the server must have access to this assembly. Remoting believes in the .NET Type System. Remoting believes in sharing types and assemblies. Remoting can support DCOM style Client Activated Objects which are stateful. The use of CAOs though have to be carefully thought about because CAOs cannot be load balanced. ASMX model does not assume that the other end is .NET. ASMX uses XmlSerializer to serialize data. Xmlserailizer believes that the XML Type System, that is the XSD is superior and works on serializing data conforming to a schema. In other words XML Web Services believe in sharing schema and contracts over types and assemblies. This makes the Web Services interoperable. ASMX services are usually stateless.
24) Are the type system represented by XmlSchema and the CLS isomorphic?
No, there is some impedence mismtach. That's the reason you ned IXmlSerializable to help the XmlSerializer. XSD is not a type system in the traditional sense.
25) Conceptually, what is the difference between early-binding and late-binding?
Early binding means compiler get information of type calling/path execution during compilation of code and in late binding compiler doesn’t get that information but this information determined at runtime/execution time.
Early binding determines execution path at compilation, late binding allows for dynamic execution at runtime.
26) Is using Assembly.Load a static reference or dynamic reference?
Its dynamic load (Reflection)
27) When would using Assembly.LoadFrom or Assembly.LoadFile be appropriate?
When your assembly is not in the GAC.
Difference is only about binding. LoadFrom is flexible and if it doesn’t get assembly where it was pointing then it can be redirect to another path on the other hand LoadFile points/depends upon strictly to reference/path of the assembly defined, don’t redirect in case of failure.
28) What is an Asssembly Qualified Name? Is it a filename? How is it different?
A type reference qualified by the name of the assembly it is referenced from.
Assembly qualified name contains assembly name, version, token key whereas filename is simple file name physically on file system. Assembly names store as Meta data as is very important by means of defining scope.
29) Is this valid? Assembly.Load("foo.dll") ?
No. Assembly.Load(string) takes the full name of the assembly (as contained in the GAC), not the name of the file.
30) How is a strongly-named assembly different from one that isn’t strongly-named?
Strongly-named assemblies can be loaded into the GAC and use key pairs to insure non-collision and authorship verification.
Strongly named assembly have strong names due to public token key so can be stored in GAC (shared environment) and can be referred by multiple programs whereas non-strongly name can’t be stored in GAC.
31) Can DateTimes be null?
No. They are structs, not objects.
Before .net 2.0 it was not possible as datetime/integer… are struct/value types which can’t be null but due to nullable types now its possible.
32) What is the JIT? What is NGEN? What are limitations and benefits of each?
JIT stands for Just in time compiler it compiles code into native code to execute by processor in three different techniques. It compiles code just before code required to be run which makes execution little slow (depends) so to avoid that we use NGEN which converts IL into native code like JIT but during deployment. It comes with large image which also includes that codes compiled version which is not being calling frequently.
JIT is Just-in-Time compiling, which natively compiles .NET code as it needs to be executed, allowing more flexibility in platform optimization. NGEN is the Native Image Generator, a tool which precompiles native code for assemblies and caches it for execution, pre-empting JIT. NGEN saves time at execution in exchange for potentially slowing execution on platforms other than the one it was originally executed for.
33) How does the generational garbage collector in the .NET CLR manage object lifetime? What is non-deterministic finalization?
The garbage collector defines objects into multiple generations based upon their expected lifecycle, and collects each generation with different frequency. Non-deterministic finalization means that the Finalize() method of objects is not guaranteed to be called as soon as the object falls out of scope; it is executed when the garbage collector has time to prioritize it.
34) What is the difference between Finalize() and Dispose()?
Finalize() is called by the garbage collector before destroying an object, allowing it to clean up resources it may have allocated. Dispose() is a method the programmer can call on an object to force resource deallocation (and pre-empt costly finalization).
35) How is the using() pattern useful? What is IDisposable? How does it support deterministic finalization?
The using() construct allows you to mark a resource which is guaranteed to be disposed when the block exits. IDisposable provides an interface for the Dispose() method, which allows a programmer to forcibly finalize an object while still placing a Finalize() method in it as a means of security in case another programmer neglects to use Dispose().
Using statement is quite handy and makes code quite efficient as right after end of using statement object created/declared in that statement disposed automatically means dispose method get called in deterministic way to free up memory. IDisposible is interface which classes implements to dispose unmanaged resources in deterministic manner.
36) What does this useful command line do? tasklist /m "mscor*"
Allows you to see which processes currently running have loaded a specific library -- in this case, anything beginning with "MSCOR".
37) What is the difference between in-proc and out-of-proc?
In-process communication is that between threads in a particular application space, as defined by the operating system. Out-of-process communication is that between non-shared memory and process spaces.
As name implies in proc means loading in the same process memory domain of invoker/host, it is fast technique but less reliable than out proc in case of any fault/exception occurs. Out proc is opposite to in proc definition and as loading out of the host process so is not depending and could be safe in host process failure for some reason.
38) What technology enables out-of-proc communication in .NET?
Serialization , .net remoting through marshalling
39) When you’re running a component within ASP.NET, what process is it running within on Windows XP? Windows 2000? Windows 2003?
40) What is FullTrust? Do GAC’ed assemblies have FullTrust?
41) What are Satellite Assemblies?
42) What is Global Assembly Cache (GAC) and what is the purpose of it?
43) What is Reflection in .NET?
44) What is the managed and unmanaged code in .net?
45) What are Namespaces?
46) What are the access-specifiers available in c#?
47) Advantage of ADO.Net?
48) Difference between OLEDB Provider and SqlClient ?
49) Differences between dataset.clone and dataset.copy?
50) In a Webservice, need to display 10 rows from a table. So DataReader or DataSet is best choice?
51) What is Remoting?
52) What’s the difference between System.String and System.StringBuilder classes?
53) What’s a delegate?
54) What’s an interface class?
55) What is the transport protocol you use to call a Web service ?
56) What’s wrong with a line like this? DateTime.Parse(myString);
57) What are PDBs? Where must they be located for debugging to work?
58) What is cyclomatic complexity and why is it important?
59) Write a standard lock() plus “double check” to create a critical section around a variable access.
60) What benefit does your code receive if you decorate it with attributes demanding specific Security permissions?
61) What does this do? gacutil /l | find /i "Corillian"
62) What does this do? sn -t foo.dll
63) What ports must be open for DCOM over a firewall? What is the purpose of Port 135?
64) Contrast OOP and SOA. What are tenets of each?
65) How does the XmlSerializer work? What ACL permissions does a process using it require?
66) Why is catch(Exception) almost always a bad idea?
67) What is the difference between Debug.Write and Trace.Write? When should each be used?
68) What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not?
69) Does JITting occur per-assembly or per-method? How does this affect the working set?
70) Contrast the use of an abstract base class against an interface?
71) What is the difference between a.Equals(b) and a == b?
72) In the context of a comparison, what is object identity versus object equivalence?
73) How would one do a deep copy in .NET?
74) Explain current thinking around IClonable.
75) What is boxing?
76) Is string a value type or a reference type?
77) What is the significance of the "PropertySpecified" pattern used by the XmlSerializer? What problem does it attempt to solve?
78) Why are out parameters a bad idea in .NET? Are they?
79) Can attributes be placed on specific parameters to a method? Why is this useful?
80) Juxtapose the use of override with new. What is shadowing?
81) Explain the use of virtual, sealed, override, and abstract.
82) Explain the importance and use of each component of this string: Foo.Bar, Version=2.0.205.0, Culture=neutral, PublicKeyToken=593777ae2d274679d
83) Explain the differences between public, protected, private and internal.
84) What benefit do you get from using a Primary Interop Assembly (PIA)?
85) By what mechanism does NUnit know what methods to test?
86) What is the difference between: catch(Exception e){throw e;} and catch(Exception e){throw;}
87) What is the difference between typeof(foo) and myFoo.GetType()?
88) Explain what’s happening in the first constructor: public class c{ public c(string a) : this() {;}; public c() {;} } How is this construct useful?
89) What is this? Can this be used within a static method?