Back to Articles
.NET Aug 24, 2026 27 min read

Top 500 .NET Interview Questions | Complete Preparation Guide

Preparing for a .NET developer interview? I collected 500 unique interview questions covering the most important areas of the .NET ecosystem. This is a useful revision resource for freshers and experienced .NET developers preparing for technical interviews. Save it, practice the questions category by category, and use it as a structured roadmap for your .NET interview preparation.

Top 500 .NET Interview Questions | Complete Preparation Guide

OOPS & C# - Basics

1. What is C#? What is the difference between C# and .NET?

2. What is OOPS? What are the main concepts of OOPS?

3. What are the advantages of OOPS?

4. What are the limitations of OOPS?

5. What are Classes and Objects?

6. What are the types of classes in C#?

7. Is it possible to prevent object creation of a class in C#?

8. What is Property?

9. What is the difference between Property and Function?

10. What are Namespaces?


OOPS & C# - Inheritance, Abstraction, Encapsulation & Polymorphism

11. What is Inheritance? When to use Inheritance?

12. What are the different types of Inheritance?

13. Does C# support Multiple Inheritance? How can you implement multiple inheritance in C#?

14. How to prevent a class from being Inherited?

15. Are private class members inherited to the derived class?

16. What is Abstraction? How to implement abstraction in real applications?

17. What is Encapsulation? How to implement encapsulation in real applications?

18. What is the difference between Abstraction and Encapsulation?

19. What is Polymorphism and what are its types? When to use polymorphism?

20. What is Method Overloading? In how many ways a method can be overloaded?

21. When should you use method overloading in real applications?

22. If two methods are same except return type, then methods are overloaded or what willl happen?

23. What is the difference between Overloading and Overriding?

24. What is the use of Overriding? When should I override the method in real applications?

25. If a method is marked as virtual, do we must have to "override" it from the child class?

26. What is the difference between Method Overriding and Method Hiding?


OOPS & C# - Abstract Class & Interface

27. What is the difference between an Abstract class and an Interface (atleast 4)?

28. When to use Interface and when Abstract class in real applications?

29. Why to create Interfaces in real applications?

30. Can we define body of Interfaces methods? When to define methods in Interfaces?

31. Can you create an instance of an Abstract class or an Interface?

32. Do Interface can have a Constructor?

33. Do abstract class have Constructors in C#?

34. What is the difference between abstraction and abstract class?

35. Can Abstract class be Sealed or Static in C#?

36. Can you declare abstract methods as private in C#?

37. Does Abstract class support multiple Inheritance?


OOPS & C# - Access Specifiers, Boxing, Unboxing, String & StringBuilder

38. What are Access Specifiers?

39. What is internal access modifier? Show example.

40. What is the default access modifier in a class?

41. What is Boxing and Unboxing? Where to use Boxing and Unboxing in real applications?

42. Which one is explicit Boxing or Unboxing?

43. Is Boxing and Unboxing good for performance?

44. What are the basic string operations in C#?

45. What is the difference between “String” and “StringBuilder”?

46. When to use String and when StringBuilder in real applications?

47. What is String Interpolation in C#?


OOPS & C# - Loops, Conditions, Exception Handling

48. What are the Loop types in C#? When to use what in real applications?

49. What is the difference between “continue” and “break” statement?

50. What are the alternative ways of writing if-else conditions? When to use what?

51. How to implement Exception Handling in C#?

52. Can we execute multiple Catch blocks?

53. When to use Finally in real applications?

54. Can we have only “Try” block without “Catch” block in real applications?

55. What is the difference between Finally and Finalize?

56. What is the difference between “throw ex” and “throw”? Which one to use in real applications?


OOPS & C# - Generics & Collections

57. Explain Generics in C#? When and why to use them in real applications?

58. What are Collections in C# and what are their types?

59. What is the difference between Array and ArrayList (atleast 2)?

60. What is the difference between Arraylist and Hashtable?

61. What is the difference between List and Dictionary Collections?

62. What is IEnumerable in C#?

63. What is the difference between IEnumerable and IEnumerator in C#?

64. What is the difference between IEnumerable and IQueryable in C#? Why to use IQueryable in sql queries?


OOPS & C# - Constructors

65. What is a Constructor? When to use constructor in real applications?

66. What are the types of constructor?

67. What is Default constructor?

68. What is Parameterized constructor?

69. What is Static constructor? What is the use in real applications?

70. Can we have parameters or access modifier in static constructor?

71. What is Copy constructor?

72. What is Private constructor? What is the use?

73. What is Constructor overloading?

74. What is Destructor?

75. Can you create object of class with private constructor in C#?

76. If base class and child class both have constructor which one will be called first, when derived class object is created?


OOPS & C# - Method Parameters, Delegates & Events

77. What is a Method in C#?

78. What is the difference between Pass by Value and Pass by Reference Parameters?

79. How to return more than one value from a method in C#?

80. What is the difference between “out” and “ref” parameters?

81. What is “params” keyword? When to use params keyword in real applications?

82. What are optional parameters in a method?

83. What are named parameters in a method?

84. What are Extension Methods in C#? When to use extension methods in real applications?

85. What are Delegates in C#? When to use delegates in real applications?

86. What are Multicast Delegates?

87. What are Anonymous Delegates in C#?

88. What are the differences between Events and Delegates?


OOPS & C# - Important Keywords

89. What is ‘this’ keyword in C#? When to use it in real applications?

90. What is the purpose of “using” keyword in C#?

91. Can we use Using keyword with other classes apart from DBConnection?

92. What is the difference between “is” and “as” operators?

93. What is the difference between “Readonly” and “Constant” variables (atleast 3)?

94. What is “Static" class? When to use static class in real application?

95. What is the difference between “var” and “dynamic” in C#?

96. What is Enum keyword used for?

97. Is it possible to inherit Enum in C#?

98. What is the use of Yield keyword in C#?


OOPS & C# - LINQ

99. What is LINQ? When to use LINQ in real applications?

100. What are the different types of LINQ?

101. What is Deferred Execution in LINQ?

102. What is Immediate Execution in LINQ?


.NET Framework - Basics

103. What is .NET Framework?

104. What are the main components of .NET Framework?

105. What is CLR?

106. What is CTS?

107. What is CLS?

108. What is Managed Code and Unmanaged Code?

109. What is an Assembly?


.NET Framework - Garbage Collection

110. What is Garbage Collection?

111. How does Garbage Collection work in .NET?

112. What are Generations in Garbage Collection?

113. What is the difference between Gen 0, Gen 1 and Gen 2?

114. What is IDisposable and how is it related to Garbage Collection?


.NET Framework - Threading

115. What is a Thread?

116. What is Multithreading?

117. What is the difference between Process and Thread?

118. What is Thread Synchronization?

119. What is a Thread Pool?


SQL - Basics

120. What is SQL?

121. What is the difference between DELETE, TRUNCATE and DROP?

122. What is a Primary Key?

123. What is a Foreign Key?

124. What is a Unique Key?

125. What is the difference between Primary Key and Unique Key?

126. What is Normalization?

127. What are the different Normal Forms?


SQL - Joins & Indexes

128. What is a Join?

129. What are the different types of Joins?

130. What is Inner Join?

131. What is Left Join?

132. What is Right Join?

133. What is Full Outer Join?

134. What is Self Join?

135. What is an Index?

136. What is the difference between Clustered and Non-Clustered Index?


SQL - Stored Procedure, Functions & Others

137. What is a Stored Procedure?

138. What are the advantages of Stored Procedures?

139. What is a Function in SQL Server?

140. What is the difference between Stored Procedure and Function?

141. What is a View?

142. What is a Trigger?

143. What is a Cursor?

144. What is a Transaction?

145. What are ACID properties?


ASP.NET – MVC - Part 1

146. What is ASP.NET MVC?

147. What are the main components of MVC?

148. What is the MVC design pattern?

149. What is the role of Model in MVC?

150. What is the role of View in MVC?

151. What is the role of Controller in MVC?

152. What is Routing in MVC?

153. What is Action Method?

154. What is ViewBag?


ASP.NET – MVC - Part 2

155. What is ViewData?

156. What is TempData?

157. What is the difference between ViewBag, ViewData and TempData?

158. What are Action Filters?

159. What are the different types of Filters in MVC?

160. What is Partial View?

161. What is Layout Page?

162. What is Model Binding?


ASP.NET - Web Forms

163. What is ASP.NET Web Forms?

164. What is ViewState?

165. What is the difference between ViewState and Session State?

166. What is PostBack?

167. What is AutoPostBack?

168. What is Page Life Cycle?

169. What are Server Controls?

170. What is the difference between Server Control and HTML Control?


ADO.NET & Entity Framework

171. What is ADO.NET?

172. What are the main components of ADO.NET?

173. What is SqlConnection?

174. What is SqlCommand?

175. What is SqlDataReader?

176. What is SqlDataAdapter?

177. What is DataSet?

178. What is DataTable?

179. What is Entity Framework?

180. What is Entity Framework Core?

181. What is the difference between ADO.NET and Entity Framework?


Web API - Basics

182. What is Web API?

183. What is REST?

184. What are REST principles?

185. What are HTTP Methods?

186. What is the difference between GET, POST, PUT, PATCH and DELETE?

187. What are HTTP Status Codes?

188. What is Content Negotiation?

189. What is Media Type Formatter?


Web API - Authentication & JWT

190. What is Authentication?

191. What is Authorization?

192. What is the difference between Authentication and Authorization?

193. What is JWT?

194. What are the components of a JWT?

195. How does JWT Authentication work?

196. What is Refresh Token?


Web API - More

197. What is CORS?

198. What is Dependency Injection in Web API?

199. What are Action Filters in Web API?

200. What is Middleware?

201. What is API Versioning?

202. What is Swagger/OpenAPI?

203. What is Rate Limiting?


.NET Core - Basics

204. What is .NET Core?

205. What are the advantages of .NET Core?

206. What is the difference between .NET Framework and .NET Core?

207. What is the difference between .NET Core and modern .NET?

208. What is Kestrel?

209. What is appsettings.json?

210. What is Program.cs in ASP.NET Core?

211. What is the Generic Host?

212. What is the Web Host?


.NET Core - Dependency Injection

213. What is Dependency Injection?

214. What are the different types of Dependency Injection?

215. What are the advantages of Dependency Injection?

216. How do you register a service in ASP.NET Core Dependency Injection?


.NET Core - Service Lifetimes, Middleware & Hosting

217. What are Service Lifetimes in ASP.NET Core?

218. What is Singleton?

219. What is Scoped?

220. What is Transient?

221. What is the difference between Singleton, Scoped and Transient?

222. What is Middleware in ASP.NET Core?

223. How does the ASP.NET Core Middleware Pipeline work?

224. What is Hosting in ASP.NET Core?


.NET Core - Routing, Files, CORS & More

225. What is Routing in ASP.NET Core?

226. What is Attribute Routing?

227. What is Conventional Routing?

228. What is Static File Middleware?

229. How do you serve static files in ASP.NET Core?

230. What is CORS in ASP.NET Core?

231. How do you configure CORS in ASP.NET Core?

232. What is Configuration in ASP.NET Core?

233. What is the Options Pattern?


SOLID Principles

234. What are SOLID Principles?

235. What is Single Responsibility Principle (SRP)?

236. What is Open/Closed Principle (OCP)?

237. What is Liskov Substitution Principle (LSP)?

238. What is Interface Segregation Principle (ISP)?

239. What is Dependency Inversion Principle (DIP)?

240. What are the advantages of SOLID Principles?


Design Patterns

241. What is a Design Pattern?

242. What are the different types of Design Patterns?

243. What is Singleton Design Pattern?

244. What is Factory Design Pattern?

245. What is Abstract Factory Design Pattern?

246. What is Repository Design Pattern?

247. What is Unit of Work Design Pattern?

248. What is Strategy Design Pattern?

249. What is Observer Design Pattern?

250. What is Dependency Injection Design Pattern?


OOPS & C#

251. What is the difference between a class and a structure?

252. What is operator overloading?

253. Can you call the base class method without creating an instance?

254. What are virtual functions and pure virtual functions?

255. Which oops concept exposes only the necessary information to the calling functions?

256. Is it always necessary to create objects from class?

257. What is early and late binding?

258. Which oops concept is used as a reuse mechanism?

259. In try block if we add return statement whether finally block is executed?

260. What you mean by inner exception?

261. List out some of the exceptions?

262. What is the difference between stack and queue collections?

263. Explain jagged arrays?

264. Explain multidimensional arrays?

265. Explain indexers?

266. What is the difference between methods – “system.array.clone()” and “system.array.copyto()”?

267. What are value type and reference types?

268. Can we override private virtual method?

269. Explain circular reference?

270. Explain object pool?

271. What are the types of delegates?

272. What are the three types of generic delegates?

273. What are the uses of delegates?

274. Can we use delegates for asynchronous method calls?

275. What is an escape sequence? Name some string escape sequences in C#.

276. What are regular expressions?

277. Why to use lock statement?

278. What is “extern” keyword?

279. What is “sizeof” operator?

280. Can we use “this” inside a static method?

281. What is the difference between CType and DirectCast?

282. Which string method is used for concatenation of two strings?

283. What is parsing? How to parse a date time string?

284. Explain partial class?

285. Explain anonymous type?

286. Explain get and set accessor properties?

287. What is the difference between var and dynamic in C#?

288. What is covariance in C#?


.NET FRAMEWORK

289. What is JIT?

290. What is MSIL?

291. What is meant by managed and unmanaged code?

292. What is difference between namespace and assembly?

293. What is manifest?

294. Where is version information stored of an assembly?

295. Is versioning applicable to private assemblies?

296. What is the application domain?

297. Explain CAS (Code Access Security).

298. What are synchronous and asynchronous operations?

299. What is multi-tasking?

300. Name some properties of Thread class.

301. What are the different states of a thread?

302. Can we have multiple threads in one App Domain?

303. Which namespace has threading?

304. Explain lock, monitors, and mutex object in threading.

305. What is Thread.Sleep() in threading?

306. What is suspend and resume in threading?

307. What the way to stop a long running thread?

308. Why we need multi-threading in our project?

309. How to start a thread in C#?

310. What is race condition?

311. What is livelock?

312. What is immutable object?

313. How managed code is executed?

314. What is the difference between system exceptions and application exceptions?

315. What is XSD?


ASP.NET MVC

316. In which assembly is the MVC framework defined?

317. Is it possible to share a view across multiple controllers?

318. What is route in MVC? What is default route in MVC?

319. Where are the routing rules defined in an ASP.NET MVC application?

320. What is validation summary in MVC?

321. Differences between Razor and ASPX view engine in MVC?

322. What are the main Razor syntax rules?

323. How do you implement Forms Authentication in MVC?

324. How we can register the area in ASP.NET MVC?

325. Explain the need of Display Mode in MVC?

326. What is route constraints in MVC?

327. What are the folders in MVC application solutions?

328. What are the methods of handling an error in MVC?

329. What is ViewStart?

330. How can we do custom error page in MVC?

331. What is server-side validation in MVC?

332. What is the use of remote validation in MVC?

333. Explain RenderSection in MVC?

334. What is the significance of NonActionAttribute?

335. How route table is created in ASP.NET MVC?

336. ASP.NET MVC application makes use of settings at 2 places for routing to work correctly. What are these 2 places?

337. What is the use of the following default route?

338. What is the difference between adding routes to a Web Forms application and to an MVC application?

339. If I have multiple filters implemented, what is the order in which these filters get executed?

340. Which filter executes first in an ASP.NET MVC application?

341. What are the levels at which filters can be applied in an ASP.NET MVC application?

342. Is it possible to create a custom filter?

343. What filters are executed in the end?

344. Is it possible to cancel filter execution?

345. What type of filter does OutputCacheAttribute class represent?

346. What are the 2 popular ASP.NET MVC view engines?

347. What symbol would you use to denote the start of a code block in Razor views?

348. What symbol would you use to denote the start of a code block in ASPX views?

349. What are sections?

350. What are the file extensions for Razor views?

351. How do you specify comments using Razor syntax?

352. Is it possible to combine ASP.NET Web Forms and ASP.NET MVC and develop a single web application?

353. What is the use of ViewModel in MVC?

354. Explain BundleConfig in MVC4?

355. How we can handle the exception at controller level in ASP.NET MVC?

356. Does TempData hold the data for other request in ASP.NET MVC?

357. Explain Keep method in TempData in ASP.NET MVC?

358. Explain Peek method in TempData in ASP.NET MVC?

359. What are child actions in ASP.NET MVC?

360. Explain the tools used for unit testing in ASP.NET MVC?

361. Can I use Razor code in JavaScript in ASP.NET MVC?

362. How can I return string result from action in ASP.NET MVC?

363. How to return the JSON from action method in ASP.NET MVC?

364. Give an example for authorization filters in an ASP.NET MVC application?

365. What is data annotation validator attributes in MVC?

366. What are the exception filters in MVC?

367. Which approach provides better support for Test Driven Development – ASP.NET MVC or ASP.NET Web Forms?


ASP.NET WEBFORMS

368. What's the use of Response.Output.Write()?

369. In which event of page cycle is the ViewState available?

370. From which base class all Web Forms are inherited?

371. Which validator control you use if you need to make sure the values in two different controls matched?

372. What is ViewState?

373. How long the items in ViewState exist?

374. What are the different validators in ASP.NET?

375. How you can add an event handler?

376. Which type of caching will be used if we want to cache the portion of a page instead of whole page?

377. Can we have a web application running without web.config file?

378. Can we add code files of different languages in App_Code folder?

379. What is protected configuration?

380. Write code to send e-mail from an ASP.NET application?

381. How can we prevent browser from caching an ASPX page?

382. What is the good practice to implement validations in ASPX page?

383. What are the event handlers that we can have in Global.asax file?

384. Which protocol is used to call a web service?

385. Explain role-based security?

386. How can we apply themes to an ASP.NET application?

387. What is RedirectPermanent in ASP.NET?

388. Explain the working of Passport Authentication.

389. What are the advantages of Passport Authentication?

390. What are the ASP.NET security controls?

391. How do you register JavaScript for WebControls?

392. Differentiate strong typing and weak typing.

393. List all templates of the Repeater control.

394. List the major built-in objects in ASP.NET?

395. What is the appSettings section in the web.config file?

396. Which namespaces are necessary to create a localized application?

397. What are the different types of cookies in ASP.NET?

398. What is the file extension of web service?

399. Is it possible to create web application with both Web Forms and MVC?

400. Can we have multiple web.config files for an ASP.NET application?

401. What is the difference between web.config and machine.config?

402. What is cross-page posting?


ADO.NET

403. What is object pooling?

404. What is connection pooling?

405. What is the difference between DataReader and DataSet?

406. What are all components of ADO.NET Data Provider?

407. Is it possible to load multiple tables in a DataSet?

408. What are different layers of ADO.NET?

409. What are all the classes that are available in System.Data namespace?

410. What are the data providers in ADO.NET?

411. What is the difference between ExecuteScalar and ExecuteNonQuery?

412. Which method is used by Command class to execute SQL statements that return single value?


SQL

413. What is denormalization?

414. What are all the different normalizations?

415. What is a relationship and what are they?

416. What are the types of subquery?

417. What are local and global variables and their differences?

418. What is data integrity?

419. What is data warehouse?

420. What is cross-join?

421. What is collation?

422. What are all different types of collation sensitivity?

423. Advantages and disadvantages of stored procedure?

424. What is Online Transaction Processing (OLTP)?

425. What is clause?

426. What is recursive stored procedure?

427. What is UNION, MINUS and INTERSECT commands?

428. What is an ALIAS command?

429. How can you create an empty table from an existing table?

430. How to fetch common records from two tables?

431. How to fetch alternate records from a table?

432. How to select unique records from a table?

433. What is the command used to fetch first 5 characters of the string?

434. What are all types of user-defined functions?

435. What are aggregate and scalar functions?

436. Which operator is used in query for pattern matching?

437. Define magic tables in SQL Server?


DESIGN PATTERNS

438. What is Prototype Design Pattern?

439. What is Builder Design Pattern?

440. What is Adapter Design Pattern?

441. What is Bridge Design Pattern?

442. What is Composite Design Pattern?

443. What is Decorator Design Pattern?

444. What is Facade Design Pattern?

445. What is Flyweight Design Pattern?

446. What is Proxy Design Pattern?


WEB API / WEB SERVICE / WCF

447. Is it right that ASP.NET Web API has replaced WCF?

448. Web API supports which protocol?

449. Which .NET Framework supports Web API?

450. Web API uses which of the following open-source library for JSON serialization?

451. By default, Web API sends HTTP response with which of the following status code for all uncaught exception?

452. What is SOAP?

453. What is the benefit of using REST in Web API?

454. How can we use Web API with ASP.NET Web Forms?

455. How you can return view from ASP.NET Web API method?

456. How to register exception filter globally?

457. How can you restrict access methods to specific HTTP verbs in Web API?

458. Who can consume Web API?

459. What are web services?

460. What are the features of web services?

461. What are the components of a web service?

462. How does a web service work?

463. What is the purpose of XML in a web service?

464. What are the benefits of web services?

465. What do you mean by interoperability of web services?

466. What do you mean by loosely coupled architecture of web services?

467. What is HTTP?

468. What is WSDL?

469. What is UDDI?

470. Explain what is WCF?

471. Mention what are the main components of WCF?

472. Explain how does WCF work?

473. Explain what is the difference between ASMX web services and WCF?

474. What are the transport schemas WCF supports?

475. Mention what are the ways of hosting a WCF service?

476. Mention the address syntax and the different formats of WCF transport scheme?

477. In WCF what are duplex contracts?

478. Mention what are the different instance modes in WCF?

479. Explain what is SOA?

480. What are the types of data contracts in WCF?

481. What are the three types of transaction manager WCF supports?

482. Name the namespace that is used to access WCF service?

483. What does SOA stand for?


.NET CORE

484. What is Host in ASP.NET Core?

485. Describe the Generic Host and Web Host?

486. Describe the servers in ASP.NET Core?

487. How configuration works in ASP.NET Core?

488. How to read values from appsettings.json file?

489. What is the Options Pattern in ASP.NET Core?

490. How to use multiple environments in ASP.NET Core?

491. Explain session and state management in ASP.NET Core?

492. Can ASP.NET application be run in Docker containers?

493. Explain the caching or response caching in ASP.NET Core?

494. What is in-memory cache?

495. What is distributed caching?

496. What is XSRF or CSRF?

497. How to prevent cross-site request forgery (XSRF/CSRF) attacks in ASP.NET Core?

498. Explain the caching and response caching in ASP.NET Core.

499. How to access HttpContext in ASP.NET Core?

500. What is the secret.json file in ASP.NET Core?


Category Summary

#CategoryQuestions
1OOPS & C# - Basics10
2OOPS & C# - Inheritance, Abstraction, Encapsulation & Polymorphism16
3OOPS & C# - Abstract Class & Interface11
4OOPS & C# - Access Specifiers, Boxing, Unboxing, String & StringBuilder10
5OOPS & C# - Loops, Conditions, Exception Handling9
6OOPS & C# - Generics & Collections8
7OOPS & C# - Constructors12
8OOPS & C# - Method Parameters, Delegates & Events12
9OOPS & C# - Important Keywords10
10OOPS & C# - LINQ4
11.NET Framework - Basics7
12.NET Framework - Garbage Collection5
13.NET Framework - Threading5
14SQL - Basics8
15SQL - Joins & Indexes9
16SQL - Stored Procedure, Functions & Others9
17ASP.NET – MVC - Part 19
18ASP.NET – MVC - Part 28
19ASP.NET - Web Forms8
20ADO.NET & Entity Framework11
21Web API - Basics8
22Web API - Authentication & JWT7
23Web API - More7
24.NET Core - Basics9
25.NET Core - Dependency Injection4
26.NET Core - Service Lifetimes, Middleware & Hosting8
27.NET Core - Routing, Files, CORS & More9
28SOLID Principles7
29Design Patterns10
30OOPS & C#37
31.NET FRAMEWORK27
32ASP.NET MVC52
33ASP.NET WEBFORMS35
34ADO.NET10
35SQL25
36DESIGN PATTERNS9
37WEB API / WEB SERVICE / WCF37
38.NET CORE17
Total Unique Questions500

Share this article

Dabananda Mitra

Dabananda Mitra

Software Engineer specializing in scalable backend systems and minimal, effective API design.

Comments

Loading comments...