FullStackFSCCafé
 
 
Sign in with GoogleSign in with Google. Opens in new tab
Kill Your Tech Interview
3877 Full-Stack, Algorithms & System Design Interview Questions
Answered To Get Your Next Six-Figure Job Offer
      
🤖 Having Machine Learning & DS Interview? Check  MLStack.Cafe - 1704 Data Science & ML Interview Questions & Answers!Having ML & DS Interview? Check 🤖 MLStack.Cafe - 1704 ML & DS Interview Questions and Answers

Top 130 C# Interview Questions

Entry Junior Mid Senior Expert
Sign in with GoogleSign in with Google. Opens in new tab
Topic Progress:

Theoretical Questions

Q1:   

What are Property Accessors?

  
Add to PDF   Entry 
Q2:   

What is the difference between continue and break statements in C#?

  
Add to PDF   Entry 
Q3:   

What is C#?

  
Add to PDF   Entry 
Q4:   

What is an Object?

  
Add to PDF   Entry 
Q5:   

What are partial classes?

  
Add to PDF   Junior 
Q6:   

What is enum in C#?

  
Add to PDF   Junior 
Q7:   

Can multiple catch blocks be executed?

  
Add to PDF   Junior 
Q8:   

What is namespace in C#?

  
Add to PDF   Junior 
Q9:   

How is Exception Handling implemented in C#?

  
Add to PDF   Junior 
Q10:   

What is the difference between string and StringBuilder in C#?

  
Add to PDF   Junior 
Q11:   

What is Boxing and Unboxing?

  Related To: .NET Core
Add to PDF   Junior 
Q12:   

What is LINQ in C#?

  Related To: LINQ
Add to PDF   Junior 
Q13:   

What is Serialization?

  
Add to PDF   Junior 
Q14:   

What are dynamic type variables in C#?

  
Add to PDF   Junior 
Q15:   

What are the different types of classes in C#?

  
Add to PDF   Junior 
Q16:   

What is the difference between a Struct and a Class in C#?

  
Add to PDF   Junior 
Q17:   

In how many ways you can pass parameters to a method?

  
Add to PDF   Junior 
Q18:   

Can this be used within a Static method?

  
Add to PDF   Junior 
Q19:   

Why to use finally block in C#?

  
Add to PDF   Junior 
Q20:   

What are Nullable types in C#?

  
Add to PDF   Junior 
Q21:   

What is Managed or Unmanaged Code?

  
Add to PDF   Junior 
Q22:   

What is the difference between a class and a structure?

  Related To: OOP
Add to PDF   Junior 
Q23:   

What you understand by Value types and Reference types in .NET? Provide some comparison.

  Related To: .NET Core
Add to PDF   Junior 
Q24:   

What are Reference Types in C#?

  
Add to PDF   Junior 
Q25:   

What is an Abstract Class?

  
Add to PDF   Junior 
Q26:   

What are generics in C#?

  
Add to PDF   Junior 
Q27:   

When to use Record vs Class vs Struct in C#?

  
 Add to PDF   Mid 
Q28:   

What is Record in C#?

  
 Add to PDF   Mid 
Q29:   

What are the uses of using in C#

  
 Add to PDF   Mid 
Q30:   

Explain the difference between Task and Thread in .NET

  Related To: .NET Core
 Add to PDF   Mid 
Q31:   

What is the use of the IDisposable interface?

  Related To: .NET Core
 Add to PDF   Mid 
Q32:   

Is there a way to catch multiple exceptions at once and without code duplication?

  Related To: .NET Core
 Add to PDF   Mid 
Q33:   

How encapsulation is implemented in C#?

  
 Add to PDF   Mid 
Q34:   

Explain assignment vs shallow copy vs deep copy for a Record in C#

  
 Add to PDF   Mid 
Q35:   

What is sealed Class in C#?

  
 Add to PDF   Mid 
Q36:   

How can you prevent a class from overriding in C#?

  Related To: OOP
 Add to PDF   Mid 
Q37:   

Explain Code Compilation in C#

  
 Add to PDF   Mid 
Q38:   

What is Extension Method in C# and how to use them?

  
 Add to PDF   Mid 
Q39:   

What is an anonymous function in C#?

  
 Add to PDF   Mid 
Q40:   

What is difference between constant and readonly?

  
 Add to PDF   Mid 
Q41:   

What is Reflection in C#.Net?

  
 Add to PDF   Mid 
Q42:   

What is scope of a Internal member variable of a C# class?

  
 Add to PDF   Mid 
Q43:   

What is the difference between overloading and overriding?

  
 Add to PDF   Mid 
Q44:   

What is a Destructor in C# and when shall I create one?

  
 Add to PDF   Mid 
Q45:   

What is the difference between Interface and Abstract Class?

  Related To: OOP
 Add to PDF   Mid 
Q46:   

Is there a difference between throw and throw ex?

  
 Add to PDF   Mid 
Q47:   

What is the difference between ref and out keywords?

  
 Add to PDF   Mid 
Q48:   

Explain Anonymous type in C#

  
 Add to PDF   Mid 
Q49:   

Why can't you specify the accessibility modifier for methods inside the Interface?

  
 Add to PDF   Mid 
Q50:   

What is the difference between dynamic type variables and object type variables?

  
 Add to PDF   Mid 
Q51:   

What is the difference between Virtual method and Abstract method?

  Related To: OOP
 Add to PDF   Mid 
Q52:   

What is lambda expressions in C#?

  
 Add to PDF   Mid 
Q53:   

What is the difference between Equality Operator (==) and Equals() Method in C#?

  
 Add to PDF   Mid 
Q54:   

What is the use of Null Coalescing Operator (??) in C#?

  
 Add to PDF   Mid 
Q55:   

What is Virtual Method in C#?

  
 Add to PDF   Mid 
Q56:   

What is difference between late binding and early binding in C#?

  
 Add to PDF   Senior 
Q57:   

What is the difference between Func<string,string> and delegate?

  
 Add to PDF   Senior 
Q58:   

Is operator overloading supported in C#?

  
 Add to PDF   Senior 
Q59:   

Can Multiple Inheritance implemented in C# ?

  
 Add to PDF   Senior 
Q60:   

What interface should your data structure implement to make the Where method work?

  
 Add to PDF   Senior 
Q61:   

What is a static constructor?

  Related To: OOP
 Add to PDF   Senior 
Q62:   

What is the use of conditional preprocessor directive in C#?

  
 Add to PDF   Senior 
Q63:   

Explain what is Ternary Search?

 CSJava Related To: Searching
 Add to PDF   Senior 
Q64:   

Explain how does Asynchronous tasks Async/Await work in .NET?

  Related To: .NET Core
 Add to PDF   Senior 
Q65:   

What happens when we Box or Unbox Nullable types?

  
 Add to PDF   Senior 
Q66:   

Can you explain the difference between Interface, abstract class, sealed class, static class and partial class in C#?

  
 Add to PDF   Senior 
Q67:   

How to solve Circular Reference?

  Related To: OOP
 Add to PDF   Senior 
Q68:   

Test if a Number belongs to the Fibonacci Series

 CSPY Related To: Fibonacci Series
 Add to PDF   Senior 
Q69:   

When to use ArrayList over array[] in C#?

  
 Add to PDF   Senior 
Q70:   

IEnumerable vs List - What to Use? How do they work?

  
 Add to PDF   Senior 
Q71:   

When would you use delegates in C#?

  
 Add to PDF   Senior 
Q72:   

What are the different ways a method can be overloaded?

  
 Add to PDF   Senior 
Q73:   

What is the best practice to have best performance using Lazy objects?

  
 Add to PDF   Senior 
Q74:   

What is scope of a Protected Internal member variable of a C# class?

  
 Add to PDF   Senior 
Q75:   

What is Indexer in C#?

  
 Add to PDF   Senior 
Q76:   

Explain what is Short-Circuit Evaluation in C#

  
 Add to PDF   Senior 
Q77:   

Can you create a function in C# which can accept varying number of arguments?

  
 Add to PDF   Senior 
Q78:   

What is Marshalling and why do we need it?

  
 Add to PDF   Senior 
Q79:   

What is the difference between is and as operators in C#?

  
 Add to PDF   Senior 
Q80:   

What are pointer types in C#?

  
 Add to PDF   Senior 
Q81:   

What is the yield keyword used for in C#?

  
 Add to PDF   Senior 
Q82:   

What's the difference between StackOverflowError and OutOfMemoryError?

  
 Add to PDF   Senior 
Q83:   

Why to use lock statement in C#?

  
 Add to PDF   Senior 
Q84:   

Explain the difference between Select and Where

  Related To: LINQ
 Add to PDF   Senior 
Q85:   

What is the difference between dispose and finalize methods in C#?

  
 Add to PDF   Senior 
Q86:   

What is the Constructor Chaining in C#?

  
 Add to PDF   Senior 
Q87:   

What is the difference between System.ApplicationException class and System.SystemException class?

  
 Add to PDF   Senior 
Q88:   

Why doesn't C# allow static methods to implement an interface?

  Related To: OOP
 Add to PDF   Expert 
Q89:   

Could you explain the difference between destructor, dispose and finalize method?

  
 Add to PDF   Expert 
Q90:   

Explain the difference between IQueryable, ICollection, IList & IDictionary interfaces?

  
 Add to PDF   Expert 
Q91:   

Can you add extension methods to an existing static class?

  
 Add to PDF   Expert 
Q92:   

What is the difference between Lambdas and Delegates?

  
 Add to PDF   Expert 
Q93:   

What is a preprocessor directives in C#?

  
 Add to PDF   Expert 
Q94:   

in C#, when should we use abstract classes instead of interfaces with extension methods?

  
 Add to PDF   Expert 
Q95:   

What is the method MemberwiseClone() doing?

  
 Add to PDF   Expert 
Q96:   

Implement the Where method in C#. Explain.

  
 Add to PDF   Expert 
Q97:   

Explain when to use Finalize vs Dispose?

  Related To: .NET Core
 Add to PDF   Expert 
Q98:   

What is the volatile keyword used for?

  
 Add to PDF   Expert 
Q99:   

What are Circular References in C#?

  
 Add to PDF   Expert 
Q100:   

Could you explain the difference between Func vs. Action vs. Predicate?

  
 Add to PDF   Expert 
Q101:   

You have defined a destructor in a class that you have developed by using the C#, but the destructor never executed. Why?

  Related To: OOP
 Add to PDF   Expert 
Q102:   

List some different ways for equality check in .NET

  
 Add to PDF   Expert 
Q103:   

What is Multicast Delegate in C#?

  
 Add to PDF   Expert 
Q104:   

What is the use of static constructors?

  
 Add to PDF   Expert 
Q105:   

What is jagged array in C# and when to prefer jagged arrays over multi-dimensional arrays?

  
 Add to PDF   Expert 
Q106:   

What are the differences between IEnumerable and IQueryable?

  
 Add to PDF   Expert 
Q107:   

What are the benefits of a Deferred Execution in LINQ?

  Related To: LINQ
 Add to PDF   Expert 
Q108:   

Why Abstract class can not be sealed or static?

  
 Add to PDF   Expert 
Q109:   

Explain what is Weak Reference in C#?

  
 Add to PDF   Expert 
Q110:   

What's the difference between the System.Array.CopyTo() and System.Array.Clone()?

  
 Add to PDF   Expert 
Q111:   

What is deep or shallow copy concept in C#?

  
 Add to PDF   Expert 

Code Challenges

Q1:   

Implement a Queue using two Stacks

 CSJSJavaPY Related To: Queues, Stacks, Java, JavaScript
 Add to PDF   Junior 
Q2:   

Filter out the first 3 even numbers from the list using LINQ

  Related To: LINQ
 Add to PDF   Junior 
Q3:   

Can you do Iterative Pre-order Traversal of a Binary Tree without Recursion?

 CSPY Related To: Binary Tree, Data Structures
  Add to PDF   Mid 
Q4:   

Can you return multiple values from a function in C#? Provide some examples.

  
  Add to PDF   Mid 
Q5:   

What is the output of the program below? Explain.

  
  Add to PDF   Mid 
Q6:   

Given an array of ints, write a C# method to total all the values that are even numbers.

  
  Add to PDF   Mid 
Q7:   

Explain how does the Sentinel Search work?

 CSPY Related To: Searching
  Add to PDF   Mid 
Q8:   

Refactor the code

  
  Add to PDF   Mid 
Q9:   

Reverse the ordering of words in a String

 CS Related To: Strings
  Add to PDF   Mid 
Q10:   

How to check if two Strings (words) are Anagrams?

 CSJavaPY Related To: Strings, Data Structures, Java
  Add to PDF   Mid 
Q11:   

Is the comparison of time and null in the if statement below valid or not? Why or why not?

  
  Add to PDF   Senior 
Q12:   

What is the output of the program below?

  
  Add to PDF   Senior 
Q13:   

Binet's formula: How to calculate Fibonacci numbers without Recursion or Iteration?

 CSJSJavaPY Related To: Fibonacci Series, Data Structures, JavaScript
  Add to PDF   Senior 
Q14:   

Find Merge (Intersection) Point of Two Linked Lists

 CSJavaPY Related To: Linked Lists
  Add to PDF   Senior 
Q15:   

Is relying on && short-circuiting safe in .NET?

  
  Add to PDF   Senior 
Q16:   

Explain what is Fibonacci Search technique?

 CSJSJavaPY Related To: Divide & Conquer, Fibonacci Series, Searching, Data Structures, JavaScript
  Add to PDF   Senior 
Q17:   

What is the output of the short program below? Explain your answer.

  
  Add to PDF   Senior 
Q18:   

What is the output of the program below? Explain your answer.

  
  Add to PDF   Senior 
Q19:   

Calculate the circumference of the circle

  
  Add to PDF   Expert 
 

Rust has been Stack Overflow’s most loved language for four years in a row and emerged as a compelling language choice for both backend and system developers, offering a unique combination of memory safety, performance, concurrency without Data races...

Clean Architecture provides a clear and modular structure for building software systems, separating business rules from implementation details. It promotes maintainability by allowing for easier updates and changes to specific components without affe...

Azure Service Bus is a crucial component for Azure cloud developers as it provides reliable and scalable messaging capabilities. It enables decoupled communication between different components of a distributed system, promoting flexibility and resili...

Cosmos DB has gained popularity among developers and organizations across various industries, including finance, e-commerce, gaming, IoT, and more. Follow along and learn the 24 most common and advanced Azure Cosmos DB interview questions and answers...
More than any other NoSQL database, and dramatically more than any relational database, MongoDB's document-oriented data model makes it exceptionally easy to add or change fields, among other things. It unlocks Iteration on the project. Iteration f...
Unit Tests and Test Driven Development (TDD) help you really understand the design of the code you are working on. Instead of writing code to do something, you are starting by outlining all the conditions you are subjecting the code to and what outpu...
Domain-Driven Design is nothing magical but it is crucial to understand the importance of Ubiquitous Language, Domain Modeling, Context Mapping, extracting the Bounded Contexts correctly, designing efficient Aggregates and etc. before your next DDD p...
At its core, Microsoft Azure is a public cloud computing platform - with solutions including Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS) that can be used for services such as analytics, virtual c...
As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications. Follow along to refresh your knowledge and explore the 52 most frequently asked and advanced Node JS Interview Questions and Answers every...
Dependency Injection is most useful when you're aiming for code reuse, versatility and robustness to changes in your problem domain. DI is also useful for decoupling your system. DI also allows easier unit testing without having to hit a database and...