1. What is C#?

C# is a modern, object-oriented, type-safe programming language developed by Microsoft that runs on the .NET platform.

2. What is CLR?

CLR (Common Language Runtime) is the execution engine of .NET that manages memory, security, and exception handling.

3. What is .NET?

.NET is a development platform used to build desktop, web, cloud, and mobile applications.

4. What is the entry point of a C# program?

The Main() method is the entry point of a C# application.

5. What is a namespace?

A namespace is used to organize classes and avoid name conflicts.

6. What does using keyword do?

It imports a namespace so we can use its classes without writing full names.

7. What is a class?

A class is a blueprint used to create objects.

8. What is an object?

An object is an instance of a class.

9. What are comments?

Comments are non-executable statements used to explain code.

10. Types of comments?

Single-line (//), Multi-line (/* */), XML comments (///).

11. What is case sensitivity?

C# is case-sensitive. Variable and variable are different.

12. What are identifiers?

Names given to variables, methods, classes etc.

13. What are keywords?

Reserved words like int, class, public, static.

14. What is Console.WriteLine()?

It prints output to the console.

15. What is static keyword?

Static members belong to the class, not to objects.

16. What is void?

Void means a method does not return any value.

17. What is a method?

A block of code that performs a specific task.

18. What is a variable?

A container used to store data.

19. Variable declaration syntax?

int number = 10;

20. What is scope?

Scope defines where a variable can be accessed.

21. What is block in C#?

A block is code inside { } braces.

22. What is statement?

A complete instruction ending with a semicolon.

23. What is compilation?

Process of converting C# code into IL (Intermediate Language).

24. What is IL code?

Intermediate Language code executed by CLR.

25. What is JIT?

Just-In-Time compiler converts IL into machine code.

26. What is assembly?

A compiled output file (.exe or .dll).

27. What is access modifier?

Defines accessibility (public, private, protected).

28. Default access modifier of class?

Internal.

29. Default access modifier of class members?

Private.

30. What is const?

Constant value that cannot be changed.

31. What is readonly?

Value assigned only at declaration or constructor.

32. What is break statement?

Terminates loop or switch.

33. What is continue?

Skips current iteration.

34. What is return?

Returns value from method.

35. What is if statement?

Conditional statement.

36. What is switch?

Multi-branch selection statement.

37. What is loop?

Repeats block of code.

38. Types of loops?

for, while, do-while, foreach.

39. What is for loop?

Loop with initialization, condition, increment.

40. What is while loop?

Executes while condition is true.

41. What is do-while?

Executes at least once.

42. What is foreach?

Used to iterate collections.

43. What is exception?

An error that occurs during runtime.

44. What is try-catch?

Used for exception handling.

45. What is finally?

Block that always executes.

46. What is using block?

Automatically disposes resources.

47. What is preprocessor directive?

Instructions like #define, #region.

48. What is region?

Used to group code.

49. What is partial class?

Class split into multiple files.

50. What is sealed class?

Cannot be inherited.

51. What are data types?

They define type of data variable can store.

52. Types of data types?

Value, Reference, Pointer.

53. What is value type?

Stores actual value in stack memory.

54. Examples of value types?

int, float, double, bool, char.

55. What is reference type?

Stores reference to memory location.

56. Examples of reference types?

string, class, array, object.

57. What is int?

32-bit signed integer.

58. Range of int?

-2,147,483,648 to 2,147,483,647.

59. What is short?

16-bit integer.

60. What is long?

64-bit integer.

61. What is byte?

8-bit unsigned integer.

62. What is float?

32-bit decimal number.

63. What is double?

64-bit decimal number.

64. What is decimal?

High precision decimal used in financial calculations.

65. What is bool?

Stores true or false.

66. What is char?

Stores single character.

67. What is string?

Stores sequence of characters.

68. Is string value or reference type?

Reference type.

69. What is object type?

Base type of all types.

70. What is var?

Implicitly typed variable.

71. What is dynamic?

Type checked at runtime.

72. What is default value of int?

0

73. Default value of bool?

false

74. Default value of reference type?

null

75. What is nullable type?

Allows value types to store null.

76. Syntax of nullable?

int? num = null;

77. What is implicit casting?

Automatic conversion small to large type.

78. What is explicit casting?

Manual conversion large to small type.

79. What is boxing?

Converting value type to object type.

80. What is unboxing?

Converting object back to value type.

81. What is sizeof()?

Returns size of data type.

82. What is typeof()?

Returns type of class.

83. What is GetType()?

Returns type of object.

84. What is enum?

Value type used to define named constants.

85. What is struct?

User-defined value type.

86. Difference between struct and class?

Struct is value type; class is reference type.

87. What is array?

Collection of same type elements.

88. What is multi-dimensional array?

Array with more than one dimension.

89. What is jagged array?

Array of arrays.

90. What is string interpolation?

string name = "John";
Console.WriteLine($"Hello {name}");

91. What is string concatenation?

Combining strings using + operator.

92. What is Parse()?

Converts string to numeric type.

93. What is TryParse()?

Safely converts string to numeric without exception.

94. What is Convert class?

Provides methods for type conversion.

95. What is checked keyword?

Checks for overflow.

96. What is unchecked?

Ignores overflow checking.

97. What is implicit typing limitation?

Must initialize at declaration.

98. What is memory allocation of value type?

Stack memory.

99. What is memory allocation of reference type?

Heap memory.

100. Why are data types important?

They ensure type safety, memory efficiency, and better performance.

 

📢 Join Our WhatsApp Channel

💼 Get Daily IT Job Updates, Interview Preparation Tips & Instant Alerts directly on WhatsApp.

👉 Join WhatsApp Now

📢 Join Our Telegram Channel

💼 Get Daily IT Job Updates, Interview Tips & Exclusive Alerts directly on Telegram!

👉 Join Telegram

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © 2022 - 2025 itfreesource.com

Enable Notifications OK No thanks