Everyone who writes code
- Describe the difference between a Thread and a Process?
Answer:
- Both are individual execution paths, but process timeslicing (and memory space) is enforced by the OS, while thread differentiation is enforced by applications.
- We can have multiple threads in a single process. Thus we can say threads are working units of a process.
- We can execute a process (EXE) but threads can be created and executed from inside a process
- What is a Windows Service and how does its lifecycle differ from a "standard" EXE?
Answer:
- Services are loaded by the operating system and run in contained process spaces detached from user interaction; users logging on and off the system have no impact on them.
- A service opens before you even get to the login screen, whereas a standard exe cannot open until after you have logged on.
- Windows Service applications are long-running applications that are ideal for use in server environments. The applications do not have a user interface or produce any visual output. Any user messages are typically written to the Windows Event Log. Services can be automatically started when the computer is booted. They do not require a logged in user in order to execute and can run under the context of any user including the system. Windows Services are controlled through the Service Control Manager where they can be stopped, paused, and started as needed.
- Windows service is a application that runs in the background. It is equivalent to a NT service.
The executable created is not a Windows application, and hence you can't just click and run it . it needs to be installed as a service, VB.Net has a facility where we can add an installer to our program and then use a utility to install the service. Where as this is not the case with standard exe.
- 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?
Answer:
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.
Actually processes access virtual memory space, not physical memory. Applications never access RAM directly but only through the memory management interface of the processor. All processes have a 4GB virtual address space. The upper 2GB is common to all processes and is used by the system. The lower 2GB is private to each process and is inaccessable to all others. This is completely independent of the size of RAM or the pagefile. The system maps physical memory into this virtual address space according to both need and availability. At any given time the data in virtual memory space might be stored in RAM, on disk, or both. All of this is totally transparent to all applications. Frequently accessed data will be kept in RAM with the remainder left on disk.
- What is the difference between an EXE and a DLL?
Answer:
EXEs can be launched as processes by the operating system. DLL executable code must be invoked by an existing process.
DLL
- Its a Dynamic Link Library.
- DLL is inprocess.
- There are many entry points.
- The system loads a DLL into the context of an existing thread.
- In one windows Application, if any problem in DLL, just that specific form or part only will not work.but if any problem in Exe, entire application will not work.
- dll is the reusable software component.
EXE
- Executable file.
- exe is outprocess.
- There is only single main entry.
- When a system launches new exe, a new process is created.
- The entry thread is called in context of main thread of that process.
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?
Answer:
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.
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 (is this a correct way to use Ensligh?) code as possible. In big programs, strong typing can reduce errors at compile time.
Strong type is checking the types of variables at compile time. weak typing is checking the types of the system at run-time. For scripts & quick stuff we’ll use weak typing, In big programs, strong typing can reduce errors at compile time.
- What is a PID? How is it useful when troubleshooting a system?
Answer:
(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.
PID stands for Process Identifier, a uniquely assigned integer that identifies a process in the operating system. In any system, applications use PID to identify the process uniquely. Also, it is used in diagnosing the problems with the process in Multi-Tasking systems.
PID is caleld process id, its used to usually track the resources that a process is using. In a case where a process is stuck and is using valuable resouces, it is killed based on the PID.
- How many processes can listen on a single TCP/IP port?
Answer: One
- What is the GAC? What problem does it solve?
Answer:
The Global Assembly Cache. It stores strongly-named assemblies in a single location, allowing for verification of code library uniqueness when executing.