Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

dotnet_interview_questions

> 编程语言
Open source

.NET Interview Questions – Complete Study Guide A comprehensive collection of 130 interview questions for .NET developers Covering Arrays, …

906 stars0 likes1 views
WebsiteGitHub

About

.NET Interview Questions – Complete Study Guide A comprehensive collection of 130 interview questions for .NET developers Covering Arrays, …

.NET Interview Questions – Complete Study Guide

A comprehensive collection of 130 interview questions for .NET developers Covering Arrays, Lists, Trees, and General .NET / C# / SQL — with clean C# implementations, multiple solutions per problem, and full complexity analysis.


Table of Contents

  • Overview
  • What's Inside
  • Question Categories at a Glance
  • Interview Question Types
  • Arrays — 20 Questions
  • Lists — 20 Questions
  • Trees — 20 Questions
  • General .NET / C# / SQL — 70 Questions
  • Repository Structure
  • How to Use
  • Probability of Being Asked
  • Key Data Structures Comparison
  • Common Algorithm Patterns
  • Big-O Complexity Cheat Sheet
  • Interview Tips and Strategy
  • Coverage and Confidence
  • Author Notes

Overview

This repository is built for .NET interview preparation and contains:

Category Questions Format Focus
Arrays 20 C# class implementations Algorithms, manipulation, searching, sorting
*List* 20 C# class implementations Collections, LINQ, dynamic data
Trees 20 C# class implementations Recursion, BST, traversals, tree properties
General .NET 70 Q&A with code examples Language fundamentals, frameworks, SQL, best practices

Total: 130 interview questions covering the most commonly asked topics in .NET coding interviews — from junior to mid-senior level.


What's Inside

Every coding question (Arrays, Lists, Trees) includes:

  • ✅ Problem explanation in the class summary
  • ✅ 2–3 solutions per problem (brute force → optimal)
  • ✅ Time & space complexity analysis for each approach
  • ✅ Clean, commented C# code ready to run
  • ✅ Edge case discussion (empty inputs, nulls, duplicates, negatives)

The General .NET section provides:

  • ✅ Detailed answers to conceptual and framework questions
  • ✅ Code examples demonstrating key concepts
  • ✅ Coverage of Basic → Intermediate → Advanced → Framework-Specific → Testing & Best Practices → SQL

Question Categories at a Glance

…

Interview Question Types

Understanding the types of questions you'll face helps you prepare strategically:

1. Data Structure & Algorithm (DSA) Questions

""Write a function that...""

These require you to code a solution on the spot. They test:

  • Problem decomposition
  • Algorithm design (brute force → optimized)
  • Big-O analysis
  • Edge case handling

Covered by: Arrays (20), Lists (20), Trees (20) sections

2. Conceptual / Theoretical Questions

""Explain the difference between...""

These test your understanding of language and platform fundamentals:

  • Value types vs. reference types
  • Abstract class vs. interface
  • Managed vs. unmanaged code
  • Garbage collection internals

Covered by: General .NET (Q1–Q30)

3. Framework & Architecture Questions

""How would you implement...""

These test your practical knowledge of .NET ecosystem tools:

  • ASP.NET Core middleware pipeline
  • Entity Framework and ORM patterns
  • Dependency Injection
  • SignalR, Blazor, Web API versioning

Covered by: General .NET (Q31–Q40)

4. ✅ Testing & Best Practices Questions

""How do you ensure code quality...""

These assess your engineering maturity:

  • Unit testing and mocking
  • SOLID principles
  • Repository pattern
  • CI/CD pipelines

Covered by: General .NET (Q41–Q50)

5. SQL & Database Questions

""What is the difference between...""

These test your data layer knowledge:

  • JOINs, indexes, normalization
  • Transactions and ACID properties
  • Query optimization
  • SQL injection prevention

Covered by: General .NET — SQL (Q51–Q70)


Arrays — 20 Questions

Arrays are one of the first topics in any coding interview because they test fundamental problem-solving, loops, conditions, indexes, and serve as a basis for hashing, sorting, and algorithm design.

# Question Key Concepts File
1 Array vs ArrayList vs List\ Type safety, generics, performance Array_ArrayList_List.cs
2 Reverse an array Two-pointer, in-place ReverseArray.cs
3 Maximum product subarray Dynamic programming, tracking min/max MaxProductSubarray.cs
4 Remove duplicates from an array HashSet, sorting RemoveDuplicates.cs
5 Find the missing number (1 to N) Sum formula, XOR FindMissingNumber.cs
6 Find intersection of two arrays HashSet, two-pointer FindIntersection.cs
7 First non-repeating element Dictionary, frequency counting FirstNonRepeatingElement.cs
8 Rotate array by K steps Reversal algorithm, modular RotateArray.cs
9 Check if array is a palindrome Two-pointer CheckPalindromeArray.cs
10 Flatten a 2D array Nested iteration, LINQ Flatten2DArray.cs
11 Find majority element (> n/2) Boyer-Moore voting MajorityElementFinder.cs
12 Find all pairs with a given sum HashSet, two-pointer FindPairsWithSum.cs
13 Binary search Iterative, recursive BinarySearchArray.cs
14 Maximum subarray sum (Kadane's) Dynamic programming MaxSubarraySum.cs
15 Element frequency counter Dictionary, LINQ GroupBy ElementFrequencyCounter.cs
16 Jagged vs multidimensional arrays Memory layout, performance JaggedVsMultidimensionalArray.cs
17 Shuffle an array (Fisher-Yates) Randomization, in-place ShuffleArray.cs
18 Resize an array in C# Array.Resize, copying ResizeArray.cs
19 Sort custom objects IComparer, LINQ OrderBy SortCustomObjects.cs
20 Array operations time complexity O(1) access, O(n) search Conceptual

List\ — 20 Questions

List is the most commonly used collection in .NET, offering dynamic resizing, type safety with generics, and integration with LINQ.

# Question Key Concepts File
1 Remove duplicates HashSet, LINQ Distinct RemoveDuplicates.cs
2 Find second largest element Single-pass, sorting FindSecondLargest.cs
3 Reverse a list In-place, LINQ ReverseList.cs
4 Sort a list (multiple approaches) IComparer, LINQ, custom SortList.cs
5 Element frequency counter Dictionary, LINQ GroupBy ElementFrequencyCounter.cs
6 Find common elements (intersection) HashSet, LINQ Intersect FindCommonElements.cs
7 Merge two sorted lists Two-pointer merge MergeTwoLists.cs
8 Find missing numbers in a range HashSet, sequential check FindMissingNumbers.cs
9 Rotate a list by K positions Slice and concat, reversal RotateList.cs
10 Shuffle a list (Fisher-Yates) Randomization ShuffleList.cs
11 Check if list is a palindrome Two-pointer CheckPalindromeList.cs
12 First non-repeating element Dictionary, ordered scan FirstNonRepeatingElement.cs
13 Group duplicate elements Dictionary, LINQ GroupBy GroupDuplicates.cs
14 Remove all occurrences of a value RemoveAll, LINQ RemoveAllOccurrences.cs
15 Find all pairs with a given sum HashSet, brute force FindPairsWithSum.cs
16 Split list into chunks LINQ Chunk, manual slicing SplitListIntoChunks.cs
17 Flatten nested lists Recursion, SelectMany FlattenNestedLists.cs
18 Max contiguous subarray sum Kadane's algorithm MaxContiguousSum.cs
19 Move all zeros to end Two-pointer, partition MoveZerosToEnd.cs
20 Compare list equality SequenceEqual, set comparison CompareListEquality.cs

Trees — 20 Questions

Trees test recursive thinking, divide-and-conquer, and appear in real-world applications like file systems, org charts, and DOM trees.

Tree Node Model

All binary tree problems share a minimal TreeNode class:

csharp
public class TreeNode
{
    public int Value { get; set; }
    public TreeNode? Left { get; set; }
    public TreeNode? Right { get; set; }

    public TreeNode(int value) { Value = value; }
}
# Question Key Concepts File
1 Depth-first traversal (pre/in/post) Recursion, stack-based iterative DepthFirstTraversal.cs
2 Breadth-first / level order traversal Queue, BFS BreadthFirstTraversal.cs
3 Maximum depth of binary tree Recursion, DFS MaximumDepth.cs
4 Minimum depth of binary tree BFS (optimal), recursion MinimumDepth.cs
5 Check if tree is balanced Height comparison, DFS CheckBalancedTree.cs
6 Check if two trees are identical Recursive compare CheckIdenticalTrees.cs
7 Invert (mirror) a binary tree Recursive swap, BFS InvertBinaryTree.cs
8 Validate BST In-order check, min/max bounds ValidateBST.cs
9 Search in a BST Recursive, iterative SearchBST.cs
10 Insert into a BST Recursive, iterative InsertIntoBST.cs
11 Find min/max in BST Leftmost/rightmost node FindMinMaxBST.cs
12 Lowest common ancestor BST property, general tree LowestCommonAncestor.cs
13 Diameter of binary tree DFS, height tracking DiameterOfBinaryTree.cs
14 Check if tree is symmetric Mirror comparison CheckSymmetricTree.cs
15 Serialize / deserialize tree BFS, pre-order string SerializeDeserializeTree.cs
16 Path sum (root-to-leaf = target) DFS, backtracking PathSum.cs
17 All root-to-leaf paths DFS, path building RootToLeafPaths.cs
18 Count total nodes & leaf nodes Recursion, BFS CountNodes.cs
19 Kth smallest in BST In-order traversal KthSmallestInBST.cs
20 Build tree from relationships N-ary tree, org chart BuildTreeFromRelationships.cs

General .NET / C# / SQL — 70 Questions

These conceptual questions cover the .NET platform, C# language, ASP.NET Core framework, testing, and SQL — essential for the non-coding portion of interviews.

Basic (Q1–Q10)

# Question
1 What is .NET?
2 Can you explain the Common Language Runtime (CLR)?
3 What is the difference between managed and unmanaged code?
4 Explain the basic structure of a C# program
5 What are Value Types and Reference Types in C#?
6 What is garbage collection in .NET?
7 Explain exception handling in C#
8 What are the different types of classes in C#?
9 What is a namespace and how is it used?
10 What is encapsulation?

Intermediate (Q11–Q20)

# Question
11 Explain polymorphism and its types in C#
12 What are delegates and how are they used?
13 What is LINQ? Give an example
14 Abstract class vs interface — what's the difference?
15 How do you manage memory in .NET?
16 Explain threading in .NET
17 What is async/await and how does it work?
18 Describe Entity Framework and its advantages
19 What are extension methods?
20 How do you handle exceptions in a Task-returning method?

Advanced (Q21–Q30)

# Question
21 What is reflection in .NET?
22 Explain middleware in ASP.NET Core
23 Describe Dependency Injection in .NET Core
24 What is the purpose of .NET Standard?
25 Differences: .NET Core vs .NET Framework vs Xamarin
26 How does GC work and how to

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言