C# Interview Questions 2026

Published July 22, 2026 · Updated July 22, 2026

5 C# interview questions from Microsoft. All difficulty levels, all roles. Upvoted by engineers who were asked them.

5 questions
Companies: Microsoft
239 upvotes

C# Questions by Company

Microsoft (5)

Microsoft Medium Technical round .NETC#

Explain the difference between process and thread in Windows. What is a fiber? Describe how the .NET thread pool works and when you would use async/await vs raw Thread vs ThreadPool.

↑ 48 upvotes · 29 engineers asked this · SDE2
Microsoft Medium Technical round JavaC#Python

Given a binary tree, print nodes level by level (BFS traversal). Then modify it to print alternate levels in reverse order (zigzag traversal). Analyse time and space complexity.

↑ 61 upvotes · 40 engineers asked this · SDE1
Microsoft Hard Technical round JavaPythonC#

Given a 2D grid of 0s and 1s, count the number of islands. Then extend: find the largest island, and then explain how you would solve this for a streaming grid that changes in real time using a Union-Find structure.

↑ 54 upvotes · 34 engineers asked this · SDE2
Microsoft Easy Screening round JavaC#Python

Find all pairs in an array that sum to a given target value. Explain the HashSet approach for O(n) time, handle duplicate pairs correctly, and discuss edge cases (negative numbers, empty array).

↑ 55 upvotes · 37 engineers asked this · SDE1
Microsoft Medium Technical round 2-5 yearsC#

In C#, what is the difference between Task.Wait() and await? Why does calling .Wait() on the UI thread risk a deadlock in a way that await does not?

↑ 21 upvotes · 12 engineers asked this · Senior SDE

Practice these questions with AI feedback

Get instant grading on your answers, identify your weak areas, and generate a personalised 14-day study plan — all free.

Build my study plan →

C# questions at each company

Microsoft C#

Frequently asked questions

Explain the difference between process and thread in Windows. What is a fiber? Describe how the .NET thread pool works and when you would use async/await vs raw Thread vs ThreadPool.
Explain the difference between process and thread in Windows. What is a fiber? Describe how the .NET thread pool works and when you would use async/await vs raw Thread vs ThreadPool.
Given a binary tree, print nodes level by level (BFS traversal). Then modify it to print alternate levels in reverse order (zigzag traversal). Analyse time and space complexity.
Given a binary tree, print nodes level by level (BFS traversal). Then modify it to print alternate levels in reverse order (zigzag traversal). Analyse time and space complexity.
Given a 2D grid of 0s and 1s, count the number of islands. Then extend: find the largest island, and then explain how you would solve this for a streaming grid that changes in real time using a Union-Find structure.
Given a 2D grid of 0s and 1s, count the number of islands. Then extend: find the largest island, and then explain how you would solve this for a streaming grid that changes in real time using a Union-Find structure.
Find all pairs in an array that sum to a given target value. Explain the HashSet approach for O(n) time, handle duplicate pairs correctly, and discuss edge cases (negative numbers, empty array).
Find all pairs in an array that sum to a given target value. Explain the HashSet approach for O(n) time, handle duplicate pairs correctly, and discuss edge cases (negative numbers, empty array).
In C#, what is the difference between Task.Wait() and await? Why does calling .Wait() on the UI thread risk a deadlock in a way that await does not?
In C#, what is the difference between Task.Wait() and await? Why does calling .Wait() on the UI thread risk a deadlock in a way that await does not?