.NET interview questions from Scott Hanselman - Answers (Part 1)
Here are my answers to the first part of the questions (without using MSDNGoogleetc. except when noted):
Everyone who writes code
- Describe the difference between a Thread and a Process?
- A process is a collection of threads (at least one) sharing the same resources (virtual memory, security context etc.).
A thread is an entity in a process that can actually be executed on the CPU.
- A process is a collection of threads (at least one) sharing the same resources (virtual memory, security context etc.).
- What is a Windows Service and how does its lifecycle differ from a “standard” EXE?
- A Windows Service is a program that conforms to the rules of the SCM (Service Control Manager). The main difference is that it does not need a logged on user to activate it.
- 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?
- Ok, I admit I had to check the MSDN documents for this.
The maximum virtual memory for a 32-bit system is 4GB of which 2GB are available to the user processes (3GB running a special configuration).
This affects system design when when designing for memory intensive applications such as databases, enterprise applications etc…
- Ok, I admit I had to check the MSDN documents for this.
- What is the difference between an EXE and a DLL?
- An EXE is an EXEcutable that contains an entry point and instructions to execute. A DLL only contains pieces of functionality to be used by an EXE (or another DLL).
- What is strong-typing versus weak-typing? Which is preferred? Why?
- strong-typing means a strict enforcement of type rules with no exceptions as opposed to weak-typing which allows well defined exceptions (such as assigning an int to a float in C++).
While strong-typing can prevent many type errors, weak-typing is much more developer “friendly”.
I assumed the preffered enforcement mechanism depends on the application at hand…
- strong-typing means a strict enforcement of type rules with no exceptions as opposed to weak-typing which allows well defined exceptions (such as assigning an int to a float in C++).
- Corillian’s product is a “Component Container.” Name at least 3 component containers that ship now with the Windows Server Family.
- I really have no idea what a “Component Container” is.
- What is a PID? How is it useful when troubleshooting a system?
- Process Identifier. I have never used it myself but I assume it can be used to kill the process or for loggingdebugging purposes.
- How many processes can listen on a single TCP/IP port?
- I am not 100% sure but I think the answer is One.
The result of two or more processes listening to the same port would be erroneous since they’ll be “stealing” each other’s revieved information.
- I am not 100% sure but I think the answer is One.
- What is the GAC? What problem does it solve?
- Global Assembly Cache. It resolves DLL hell, versioning etc…