*
Previous C# Question Answers-51 - 60 C# Question Answers-71 - 80 Next

C# (C-Sharp) Question Answers - 61-70

61. What are the Garbage collection phases?

  • Marking phase: Finds and creates a list of all live objects.
  • Relocating phase: Updates references to the objects that will be compacted.
  • Compacting phase: Reclaims space occupied by dead objects and compacts the surviving objects.

62. What are the types of JIT Compilers?

There are two types of JIT compilers in the latest .NET Framework:

  • Normal-JIT Compiler: Compiles methods at runtime as needed.
  • Pre-JIT Compiler: Compiles the entire assembly before use (usually during deployment, e.g., with Ngen.exe).

.NET Framework 1.0/1.1 had Econo-JIT, which is obsolete since .NET 2.0.

63. What does the term immutable mean?

The data value may not be changed. Changing a variable creates a new value in memory; the original immutable value is discarded.

64. What happens if you inherit multiple interfaces with conflicting method names?

Use Explicit Interface Implementation:

interface A { void Hi(); }
interface B { void Hi(); }
class Test : A, B {
  void A.Hi() { Console.WriteLine("Hi from A"); }
  void B.Hi() { Console.WriteLine("Hi from B"); }
}

65. What is a partial class?

Partial classes allow splitting a single class into multiple source code (.cs) files.

66. What is a PID? How is it useful when troubleshooting?

PID stands for Process Identification. It is useful for terminating or managing a specific process.

67. What is a Windows Service and how does its lifecycle differ from a standard EXE?

A Windows Service starts before user login, has no UI, writes messages to Event Log, can run under any user or system context, and is controlled via Service Control Manager. A standard EXE starts after login and interacts with the user interface.

68. What is an interface class?

Interfaces define properties, methods, and events but provide no implementation. They are implemented by classes.

69. What is async keyword?

A modifier indicating that the method is asynchronous.

70. What is await keyword?

An operator that suspends the execution of the containing method until the awaited task completes.

Back to Index
Previous C# Question Answers-51 - 60 C# Question Answers-71 - 80 Next
*
*