[go: up one dir, main page]

0% found this document useful (0 votes)
153 views41 pages

300 Most Asked C# Interview Questions

The document is a comprehensive list of commonly asked interview questions across various programming topics including OOP, C#, JavaScript, Angular, .NET Core, SQL, design patterns, and API testing. It covers fundamental concepts, practical scenarios, and coding challenges that candidates may encounter during technical interviews. The questions are organized by category, making it a useful resource for interview preparation.

Uploaded by

Ganit Vidyarthi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
153 views41 pages

300 Most Asked C# Interview Questions

The document is a comprehensive list of commonly asked interview questions across various programming topics including OOP, C#, JavaScript, Angular, .NET Core, SQL, design patterns, and API testing. It covers fundamental concepts, practical scenarios, and coding challenges that candidates may encounter during technical interviews. The questions are organized by category, making it a useful resource for interview preparation.

Uploaded by

Ganit Vidyarthi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

MOST ASKED

REAL-TIME
INTERVIEW
QUESTIONS
OOP/SOLID Interview Questions

Q1. What is Method Signature?


Q2. What is the Order of constructor
execution?

Q3. What is destructor and how many can be


there in a class ?

Q4. What happens when constructor is


private ?

Q5. If an Abstract class has concrete


method so can its child class have same
method name and can it modify it ?

Q6. Abstract vs Static class ?

Q7. Abstract vs Interface ?


Q8. Why Abstract Class has Constructors?
Q9. When to use abtract and when to use
interface give real time example in c#
Q10. Implicit and explicit interface ?

Q11. What are default interface and why do


we need it ?

Q12. Polymorphism in C# ?

Q13. Method overriding with example ?


Q14. Method hiding with example ?

Q15. Is return type considered in method


overloading? ?
Q16. Why and when to use method hiding?
give real time scenario
Q17. How to extend a Sealed Class?

Q18. What is extension method?


Write an example ?
Q19. What is solid principle and why to
implement?

Q20. State all the principles with example ?

Q21. What is Liskovs Substitute Principle,


explain with example
Q22. Difference in Open close and Liskove
principle ?

Q23. Difference between Liskov vs ISP ?


C# Interview Questions
Q24. Value type vs Ref type.

Q25. Ref vs Out, give real time example


and usage.

Q26. Can ref keyword be used in Async


programming?

Q27. Const vs Readonly ?

Q28. What is Garbage Collector?

Q29. How to remove unmanaged code?


(How we remove garbage in unmanaged code?

Q30. Throw vs Throw ex.


Q31. What are access modifiers?

Q32. What is Partial class give real time


scenario ?

Q33. What are generics? Have you


implemented any in your project ?

Q34. What are collections and its type ?

Q35. What is Dictionary, List, HashTable ?

Q36. What is Stack and Queue ?

Q37. Difference between Generics and non


generics ?

Q38. What is Concurrent Collection ?


Q39. What are delegates and built in
delegates ?

Q40. What is LINQ?

Q41. Single vs SingleOrDefault ?

Q42. First vs FirstOrDefault ?

Q43. Select vs SelectMany ?

Q44. What is the effect of combining


AsParallel with LINQ queries?

Q45. IEnumerable vs toList ?

Q46. IQueryable vs toList ?

Q47. IQueryable vs IEnumerable ?


Q48. What is Yield Keyword ?

Q49. Break vs Continue vs Return ?

Q50. Reflections in C# ?

Q51. What is TPL ?

Q52. TPL vs Thread

Q53. Async vs Thread ?

Q54. How to start a Task ?

Q55. what is Async and Await ?

Q56. difference between Async/Await and


TPL ?
Q57. What is a concurrency issue in an
application, and how do you handle it? Is this
related to performance?

Q58. Suppose the database layer is already


optimized, but performance issues still exist
on the application side. What steps would you
take to improve performance at the
application level?

Q59. If an application has heavy database


interactions, how can we optimize
performance—whether it's a legacy
application, a modern Web API, or a front-
end app like React?
Q60. Imagine there’s a production issue
with very limited information available. How
would you approach diagnosing and resolving
the root cause of the issue?

Q61. Which code will perform better ?


JAVASCRIPT QUESTIONS
Q62. Difference in reassign & redeclaration ?

Q63. VAR vs LET vs CONST ?

Q64. Types of object creation in JS ?

Q65. What is Hoisting concept in JS ?

Q66. What do you mean by Temporal Dead


Zone ?

Q67. What is Closure in JS ?

Q68. What is a Prototype ?

Q69. What is Spread Operator ?

Q70. What is Rest Operator ?

Q71. Difference between Spread and Rest


Operator ?
Q72. Splice vs Slice ?

Q73. What is Arrow Function ?

Q74. What is anonymous function ?

Q75. What is Array and its types ?

Q76. How to flatten multi-dimensional


array?

Q77. = VS == VS === state the name of


operators and explain the use ?
ANGULAR QUESTIONS

Q78. Why Angular ?


Q79. Which is the latest version going on ?

Q80. Difference JS and Angular ?

Q81. How to install Angular ?

Q82. What is AOT ?


Q83. What are Decorators ?

Q84. How do you create a component ?

Q85. How does Angular App starts ?


Q86. Package.json vs package.lock.json file ?

Q87. How to download or install other


packages ?
Q88. What is angular.json file ?

Q89. What are Modules ?

Q90. What is ngModel ?

Q91. What is routing and how it is


implemented?
Q92. Lazy Loading in Routing ?

Q93. What are directives and its type.


Explain with real examples.
Q94. How to create custom Directives ?
Q95. Types of data binding in angular with
examples
Q96. What is String Interpolation?
Q97. Difference between string
interpolation and Property binding ?
Q98. What is Http Interceptor ?
How to implement it ?
Q99. What are services in Angular ?
Q100. Dependency Injection in Angular ?

Q101. Ways to pass data from one


component to another?
Q102. List down all Life cycle hooks in
sequence with examples.

Q103. Constructor vs ngOnInit ?

Q104. ngOnChanges vs ngDoCheck ?

Q105. What is ViewChild ?


Q106. How to create API calls in Angular ?

Q107. What are HTTP filters in Angular ?


Q108. How to add http headers or
authorization in post call ?
Q109. What are Pipes and its type ?

Q110. How to create Pipes ?

Q111. Promise vs Observables ?

Q112. Observables vs Subject ?

Q113. Different Types of Subject ?

Q114. Can we do asynchronous programing in


Angular? How?
Q115. How to implement asynchronous
programing in Angular?
Q116. Template driven forms and Reactive
forms with their difference.
Q117. What is auth guard in Angular ?
Q118. Types of Auth Guards in Angular.
Q119. What is Local Storage ?
Q120. Have you used RXJS ? Why it is used?
Q121. Give some operators of RXJS.
Q122. What is Map Operator ?
Q123. What is Template Reference
Variable ?
Q124. How to do testing in Angular?
Q125. State management in Angular ?
.NET CORE WEB API QUESTIONS
Q126. Framework vs Core ?

Q127. Advantages/features of .NET core

Q128. Disadvantages of WebAPI .

Q129. How does .NET Core starts?

Q130. What is Middleware in .NET core ?

Q131. What is request Delegate?

Q132. app.Use vs app.Run ?

Q133. What are Filters in dot net core ?

Q134. What is Authorization Filter ?

Q135. What is Exception filter ?

Q136. What is Action filter ?


Q137. Middleware vs filter ?
Q138. Configure vs Configure Services ?

Q139. .NET Core 5.0 vs .NET Core 6.0 ?

Q140. Can we implement startup.cs file in 6.0?

Q141. What is dependency injection and


types ?
Q142. What is service life cycle?
(addTransient, addSingleton, addScoped),
State thier difference.
Q143. What is Routing and its types ?
Q144. What is an Attribute ?
Q145. Serialization and Deserialization
Q146. How to implement Global exception?
Q147. What is Session Management ?

Q148. What is caching and type of caching


and how to implement it in dot net core ?

Q149. What is MVC pattern ?

Q150. What is MVVP Pattern?

Q151. What is CORS policy?

Q152. What is Restful API?

Q153. SOAP vs REST ?

Q154. What is JSON ?

Q155. JSON vs XML ?

Q156. POST vs PUT ?


Q157. If We can modify resource via Post
call then why we need PUT call ?

Q158. Can GET call have request body ?

Q159. Can we add resource using GET call ?

Q160. What is Content negotiations in


Web API ?
Q161. What is Api Versioning and its type?
How to implement it
Q162. Return types in ..NET Core?

Q163. Can we have multiple return types in


net core?

Q164. How to implement sorting and paging


in .net core?
Q165. How to implement Authentication/
Authorization in dot net core ?

Q166. What is JWT? State its parts.


How it is implemented ?

Q167. How to save sensitive data in


database ?

Q168. What are some common encryption


techniques ?

Q169. What data encryption techniques you


have used in project ?

Q170. What is API gateway ?


Q171. Suppose There is a requirement to
upload a file with lakhs of records in
database from mvc.

Q172. How to do it so transaction will be


faster ?

Q173. Can you explain the MVC lifecycle and


describe the flow of a request from the
browser to the server and back?

Q174. What is cache management? How can


it be implemented in a React front-end
application? How do we manage caching in an
ASP.NET MVC web application? What about
in an ASP.NET Core Web API?
ORM THEORY QUESTIONS

Q175. What is ORM ?

Q176. Have you used any ORM in your


project ? Which one?

Q177. What is Dapper ?

Q178. What is EF core ?

Q179. EF Core vs Framework ?

Q180. What are navigation property in EF


core ?

Q181. How did you implement EF core with


relational database ?
Q182. How did you implement EF core with
relational database ?

Q183. Code first vs Database first

Q184. Commands used for code first ?

Q185. What are fluent APIs ?

Q186. How do you call a Stored Procedure


from EF core?
SQL SERVER THEORY QUESTIONS
Q187. What is Normalization and state its
form ?
Q188. What is BOYCE CODD normal form ?

Q189. Indexes in SQL ?


Q190. Cluster vs Non-Cluster ?
Q191. What is execution plan ?
Q192. Primary vs Unique ?
Q193. Union vs Union ALL ?
Q194. ISNULL vs Coalesce ?

Q195. Truncate vs Delete ?

Q196. Table vs Views ?

Q197. Stored Procedure vs Function ?


Q198. What is CTE ?

Q199. Temporary Table vs CTE ?

Q200. Temporary table vs Temporary Table


variable ?

Q201. Sub Queries vs CTE ?

Q202. SQL Injection and how will you


prevent it ?

Q203 Triggers in sql and its purpose ?

Q204. What is Rownumber ?

Q205. Rank vs DenseRank ?

Q206. What are Magic tables ?

Q207. What is Deadlock ?


Q208. What is WITH (NOLOCK) ?

Q209. What is Isolation Level ?

Q210. What is transaction and How to


implement it?

Q211. Merged Statement .

Q212. Send unlimited parameters


through stored procedures
DESIGN PATTERN QUESTIONS
Q213. What is Design Pattern and why do we
need ?
Q214. Types of Design Pattern - Creational,
Structural, Behavioral ?
Q215. Which Design patterns you have used in
in your project ?

Q216. Which Design Patterns you know ?

Q217. What is Singleton DP? Type down the


singleton pattern

Q218. Connection pooling many answer in


singleton but that can be problemtic.
Especially from DB perspective.

Q219. Singleton Pattern Disadvantage ?


Q220. Breaking the Singleton using direct
references. Iterator, IEnumerable
Q221. What is Strategy DP ?
Q222. What is Adapter DP ?
Q223. What is Abstract Factory DP?
Q224. What is Repository DP ? List its
advantages.
Q225. What is CQRS DP ?
Q226. What are 3 important elements ?
Q227. Why is MediatR in CQRS ?
Q228. Why CQRS is important in MS ?
Q229. What is event sourcing in
CQRS ?
Q230. Is SQL Server Event source ?
ARCHITECTURE QUESTIONS

Q231. Have you worked on Clean


Architecture ?

Q232. What are Microservices ?

Q233. Monolithic vs Microservices ?

Q234. Layer vs Tiered ?

Q235.How does one microservice call


other microservice internally ?
SCENARIO BASED QUESTIONS

Q236. How will you increase performance in


angular application?

Q237. If there is case of bulk upload


photos/videos, what will be your approch?

Q238. If you find slowness in angular


application how will you optimize it?

Q239. If an abstract Employee class has


abstract method GetManager() and one
concrete method GetSalary().
And Developer class and QA class inherits it.

Now your Client said there is a requirement to


add a CEO class which does not have a manage
but has salary.
How you will implement this scenario?

Option - You can extend it as it is or you can


change the existing code. But which one
would be optimal ?

Q240. There are 2 different Interfaces A,


B and both are having same method name.

Can a Class e.g. class C, implement both of


them? If yes, then how will it use the
method from Class A.

Q241. There is a sealed class and I want to


add new methods to it without changing the
existing logic.
Q242. Can a class have multiple constructor
with different access modifiers also with
static constructor, if yes then in what order
it will execute ?

Q243. If you need to fetch data but


parameter/query string is complex then you
will use GET or POST call and why ?

Q244. If you need to fetch data but


parameter/query string is complex then you
will use GET or POST call and why ?

Q245. How to do bulk insert, update in dot


net core?

Q246. How to limit the API hits in dot net


core?
Q247. How to handle huge payloads that
expires in 30 secs ?

Q248. In case of complex logic, will you


use linq (dot net core) or SQL (database)?

Q249. How to optimize a Stored


Procedure ?

Q250. If we told you to create a new


project then by which approach you will
choose Code first or Database first and
why?

Q251. How to do bulk insert, update in EF


core?
API TESTING QUESTIONS

Q252. Why we need Testing ?

Q253. What is Unit Testing ?

Q254. What is Integration Testing ?

Q255. Difference Unit and Integration?

Q256. Which unit testing framework you


used in your project ?

Q257. What is the Code Coverage


Percentage ?

Q258. What is Moq ? Have you used it in


project ?

Q259. How to handle exception in unit


testing?
CODING QUESTIONS

Q260. Finding two numbers in an array that


add up to a target

Q261. Reverse word in a string

Q262. Find occurrence of each character in


a given string.

Q263. Move 0’s to end of the array

Q264. Find the First Non-Repeating


Character.

Q265. Remove Duplicates from a String.

Q266. Reverse a String

Q267. Swapping two number


Q268. Extract the surname.
Q269. DSA based question.

Q270. Check if a String is a Palindrome.

Q271. Find the Longest Substring Without


Repeating Characters

Q272. Remove All White Spaces from a


String.

Q273. Find the Longest Palindromic


Substring.
Q274. Can you write a code on Boxing and
Unboxing in C#?

Q275. Left/Right rotate an array by K


places.
Q276. Prime Numbers.
Q277. Factorial using Recursion.

Q278. They will give a snippet and we need


to Spot errors and correct it.

Q279. They will give a snippet and we need to


optimize it or refactor it.

Q280. Questions related to DSA e.g. Stack


and Queue.

Q281. What is the next number: 1, 3, 7, 13

Q282. Create a countdown timer that will


countdown from 30 and update every second.
When the countdown hits 0, display 'Take
Off',
There is a Reset button next to the timer.

The Reset button will reset the timer to 30


sec if the takeoff has not already happened.
After takeoff, reset is not possible.

Q283. Write example of Date Pipe with


short date format.

Q284. Find Duplicate records in table.

Q285. Find Nth highest Salary

Q286. Find count of employees having 2nd


highest salary in each department.
Q287. Find the Employee's Manager in the
same table.

Q288. select Count(*) vs select Count(name)


vs select Count(address). Which one is
faster?

Q289. Find max salary from employees.

Q290. Find employees having 2nd highest


salary.

Q291. Left join in LINQ with any Method


syntax or Query syntax

You might also like