“You’re so wise. You’re like a miniature Buddha, covered with hair.”
………………………..
Scott Hanselman had a very interesting blog post, found here, about what great .NET developers should know. He broke it down into sections and I will attempt to answer Part 1 of the questions in this post. For those who are technically minded, go ahead and grade my answers and supply your answer.
Part 1 – Everyone who writes code
Describe the difference between a Thread and a Process?
A Thread is basically a path of execution through and application.A Process can have one or more threads. A Process will at least have one thread of execution when it starts but has the option to spawn more as needed.
What is a Windows Service and how does its lifecycle differ from a “standard” EXE?
A Windows Service is an executable that is conforms to a specific contract and is registered with Windows as a service. This gives the application the ability to run when the machine is started up within a certain security context. It is idle to use a Windows Service when writing server type applications because the app is able to run when the machine boots to Windows and does not need a user logged in. Its lifecycle is different in that it can launch when the machine boots instead of directly invoked from user logged into the system. It also has the ability to allow the app to Pause and Restart through the control application.
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?
The maximum amount of memory that 32bit Windows can address is 4GB. User processes can allocate a maximum of 2GB of memory. With a special switch it can be expanded to 3GB. You also have the option of paging memory to disk that can be a set size. I am not sure if this accounted for in the 2GB limit. The maximum virtual memory could me higher based on the maximum size of the paging file (which I am not sure of the maximum). If your application uses a lot of memory, server type applications, then you would make sure you had a good clean up mechanism for keeping you memory allocation within the physical memory constraints. If you use more memory than physical memory then it will start paging those items to disk which in the case of a database server would kill performance relative to RAM access.
What is the difference between an EXE and DLL?
An EXE is a executable program that can be run on a Windows platform. It has memory and a security context. A DLL, dynamically linked library, is a library of code that can be used in multiple applications that are linked in a runtime to provide extra paths of execution. A DLL is not executable by itself.
What is strong-typing versus weak-typing? Which is preferred? Why?
Strongly typed languages are those languages that demand their variables to be allocated a type at compile time. Weakly typed languages are those in which a variable’s type can be determined at runtime. I don’t believe one should be preferred over the other. I believe it should come down to the job you are trying to accomplish. Strong-typing gives you compile time checking possibly greatly reducing the amount of runtime errors and making the runtime code more stable. Weak-typing can possibly make the development of an application easier, quicker and more flexible but you trade a performance hit and possible brittle code to achieve this. It really comes down to the application requirements and what you are trying to accomplish.
(Note: I will skip the question about Corillian’s product as I know nothing about it and the term “Component Container” can be used differently depending on context. Since I know nothing about that particular product I am not sure of the context in which it is used. The COM+ container could be a good example of a type of “Component Container”)
What is PID? How is it useful when troubleshooting a system?
A PID, process identifier, is an unique identifier number given to a process when it is running. This identifier is useful when debugging applications and trying to kill applications as it is tied to this identifier. It is also useful when setting up logging using the Performance MMC.
How many processes can listen on a single TCP/IP port?
I believe the answer is only one at a time. If you could have more than that then one process could steal another processes data that it was waiting for.
What is the GAC? What problem does it solve?
The GAC, Global Assembly Cache, is a repository for .NET assemblies that can be used through all .NET code on a machine. This allows for common code that could be used in many .NET applications without having a copy of the assembly within its directory. This also helps with DLL Hell as the assembly is signed and versioned so you can have the same component but different versions accessible system wide running side-by-side.
So how did I do? Let me know.