Microsoft software engineer interview questions start with code. Every round in the loop tends to include a problem you solve in a shared editor, in a language you choose. What makes Microsoft loops different is what happens after the code compiles: on teams that build on .NET and Azure, interviewers follow the solution into the stack. Why did you catch the exception that way? What happens to this collection when two threads touch it? What does your design do when the database starts returning 429?
That makes the stack worth preparing deliberately for a Microsoft software engineer interview on a team that uses it. The questions below come from the C#, Azure Cosmos DB and AZ-900 sets in squizzu's question bank, picked for the follow-ups those teams actually ask. Five are playable right here. Answer first, then read the reasoning; follow-up questions punish an answer that you recognised but could not explain.
Try 5 of them right now
No sign-up, no email. Every question comes with the explanation and an in-depth breakdown of why the wrong options fail.
The Cosmos DB question is the one experienced engineers get wrong most often, because the symptom it describes (latency spikes with no errors in the logs) points away from its cause. The throw; question looks basic, and yet a surprising number of production codebases still lose stack traces to throw ex;.
The other 15 questions
Grouped roughly as the follow-ups tend to run: ASP.NET Core and Entity Framework first, then C# language and runtime, then Azure. Use them as a checklist. If you cannot explain the behaviour and name the failure it causes, that is a topic to revise.
- What is a 'captive dependency' in the context of dependency injection, and how does it occur?C# • Dependency Management
- In an ASP.NET Core application, what is the key difference between a Scoped and a Transient service lifetime?C# • Dependency Management
- What is the key difference between the `app.Use()` and `app.Run()` middleware extension methods?C# • ASP.NET Core Basics
- What is the N+1 query problem in Entity Framework and how does it occur?C# • Entity Framework
- How does EF Core handle optimistic concurrency when using rowversion/timestamp columns?C# • Advanced Entity Framework
- What are tracking queries vs no-tracking queries and when should you use each?C# • Entity Framework
- What is a potential danger of using `async void`, and in what primary scenario is its use considered acceptable?C# • Concurrency and Parallelism
- What is the purpose of the 'yield' keyword in C#?C# • Collections Framework
- How does a Dictionary<TKey, TValue> handle key collisions?C# • Collections Framework
- What happens if a derived class defines a method with the same signature as a non-virtual base class method, without using the `new` keyword?C# • Polymorphism
- What does it mean for a lambda expression to 'capture' a variable?C# • Lambda Expressions
- In C#, which situation is the most appropriate use case for a WeakReference?C# • Memory Management
- A social media platform partitions posts on /authorId - millions of distinct values, textbook high cardinality. Yet when a celebrity account goes viral, reads against that one author throttle while the rest of the container is idle. What does this reveal about partition key design?Azure Cosmos DB • Partitioning & Data Modeling
- A team's autoscale setting has a rule to add an instance when CPU is above 70%, and no other rule. After a traffic spike ends, the bill stays high. Why?AZ-900 • Benefits of cloud services
- A Cosmos DB account with Strong consistency and a single write region in East US adds a read region in Southeast Asia. Immediately afterwards, write latency observed by applications rises sharply, even though the write region has not moved. What causes the increase?Azure Cosmos DB • Consistency & Global Distribution
The five answers, written out
Assigning IEnumerable<string> to IEnumerable<object>
Short answer: Covariance, which C# allows on generic interfaces and delegates whose type parameter is marked out.
Explanation: IEnumerable<out T> only ever hands values out, so treating a sequence of strings as a sequence of objects can never put a non-string into it. List<T> is invariant because it also accepts values through Add; if List<string> could be used as List<object>, you could add an integer to a list of strings. Contravariance is the mirror image, marked in: an Action<object> can be used where an Action<string> is expected. Arrays are the historical exception. They are covariant without that safety, so writing the wrong type into one compiles and then throws ArrayTypeMismatchException at run time.
What the interviewer is testing: Whether you understand why the rule exists, not just its name. The array case is the usual follow-up because it shows what goes wrong without the rule.
Common follow-up: "Why can't IList<T> be covariant?"
throw; versus throw ex;
Short answer: throw; rethrows the current exception with its original stack trace. throw ex; throws the same object again from the current line and resets the trace to start there.
Explanation: The difference is invisible in a unit test and very visible in a production incident. With throw ex;, the trace points at your catch block, and the line that actually failed, perhaps three calls deeper, is gone. If you need to add context, wrap it: throw new OrderProcessingException("...", ex) keeps the original as InnerException. If you need to rethrow an exception caught on another thread or stored for later, ExceptionDispatchInfo.Capture(ex).Throw() preserves the trace.
What the interviewer is testing: Production debugging habits. Rethrowing correctly is a small habit, and it decides whether an on-call engineer can find the bug from the log alone.
Common follow-up: "When should you catch an exception at all?" (When you can handle it, add context, or are at a boundary such as a request handler. Catching to log and rethrow at every layer floods the logs.)
Producer-consumer with a concurrent collection
Short answer: BlockingCollection<T>, which blocks consumers when it is empty and, with a bounded capacity, blocks producers when it is full.
Explanation: ConcurrentQueue<T> alone is thread-safe but gives a consumer no way to wait for an item, so it ends up polling. BlockingCollection<T> wraps a concurrent collection (a ConcurrentQueue<T> by default) and adds blocking Take, a bounded capacity that provides backpressure, CompleteAdding to signal that no more items are coming, and GetConsumingEnumerable for a clean consumer loop. In new async code, System.Threading.Channels provides the same pattern without blocking threads, and many interviewers will ask about it next.
What the interviewer is testing: Whether you know the standard tool rather than building one from a lock and a Monitor.Wait. The follow-up checks whether you know its async successor.
Common follow-up: "Why does a bounded capacity matter?" (Without it, a fast producer grows the queue until memory runs out.)
Latency spikes with no errors in the logs
Short answer: The Cosmos DB SDK is retrying throttled requests (HTTP 429) automatically, so the application sees slow successes instead of errors.
Explanation: Every Cosmos DB operation costs request units, and a container has a provisioned throughput. When a burst exceeds it, the service returns 429 with a retry-after interval, and the .NET SDK waits and retries by default before giving up. A 9 a.m. traffic burst therefore shows up as p99 latency climbing while the error rate stays at zero. The diagnosis is in Azure Monitor's metrics for throttled requests, or in the SDK diagnostics. The fixes depend on the cause: autoscale throughput, spreading the load if one partition is hot, or making the expensive query cheaper.
What the interviewer is testing: Whether you reason from a symptom to a hidden mechanism. Retries that hide failures are a general pattern, not a Cosmos detail, and the same answer applies to any client library with built-in retries.
Common follow-up: "The throttling is on one logical partition only. What does that tell you about the partition key?"
Reading a blob in the Archive tier
Short answer: Rehydrate it first, by copying it or changing its tier to Hot, Cool or Cold, and wait for that to finish.
Explanation: The Archive tier stores data offline at the lowest storage price, and in exchange you cannot read a blob there directly. Rehydration can take up to 15 hours at standard priority; high priority is faster and costs more. That makes Archive suitable for data you keep for compliance and almost never read, and wrong for anything a user might request on demand. Lifecycle management policies can move blobs between tiers automatically based on age or last access.
What the interviewer is testing: Whether you design with the cost of reading as well as the cost of storing. A design that archives data a support engineer needs within minutes fails on the first ticket.
Common follow-up: "Design the retention for audit logs: queried often for 30 days, occasionally for a year, kept for seven."
What the Microsoft loop actually tests
- Technical screens. One or two, each usually a coding problem of medium difficulty in a shared editor.
- Final loop. Four or five interviews of about an hour, usually virtual. Most include a coding problem; senior candidates get system design; many include behavioural questions.
- The "as appropriate" interview. Often last, with a senior leader who has seen the day's feedback so far. It can be technical, behavioural or both.
- Team-specific depth. Teams differ a lot. A .NET platform team will go deep on the runtime; an Azure service team on distributed systems; a product team on the language and the web stack.
Coding rounds
The coding problems are mostly medium: arrays and strings, linked lists, trees, graphs, and design-a-class questions such as an LRU cache. Interviewers usually want working code, tested by hand on an example, and a clear complexity analysis. In C#, know the costs of your tools: List<T> versus LinkedList<T>, Dictionary<TKey, TValue> and how it handles collisions, SortedDictionary and PriorityQueue<TElement, TPriority> (available since .NET 6), and when LINQ adds hidden allocations to a hot loop.
System design for .NET and Azure teams
Design questions for cloud-facing teams use Azure's building blocks. Expect a service that stores data, scales under load and survives a regional failure. The questions that matter are about limits rather than boxes. What happens when throughput is exhausted? How does a partition key create a hot spot? Which consistency level do you choose, and what does it cost in latency? Do your autoscale rules remove capacity as well as add it?
Behavioural questions and growth mindset
Microsoft's culture centres on growth mindset, and behavioural questions reflect it: a time you were wrong, feedback that changed how you work, a project that failed and what you learned. Interviewers look for specifics and for what you would do differently now. A story about a mistake you fixed well often scores better than a story where nothing went wrong.
What to do next
Reading the answers is not the same as producing them. The five above gave you the useful version: you committed first, then saw the reasoning.
Answer the remaining 15 in quiz mode on squizzu, with an explanation and an in-depth breakdown on every question, plus the full C# and Azure sets.
Preparing for a backend role more broadly? How to prepare for a backend developer interview in 2026 covers API correctness, databases, caching and queues with its own self-check. Comparing big-tech loops? 20 Amazon SDE interview questions follows the same format for Amazon.
