Top 4 Dotnet Interview Questions
Browse 4 real-world technical and behavioral interview questions about Dotnet. Review scenarios, edge cases, and architectural best practices.
A read-only endpoint that returns fifty thousand rows is slow and memory-heavy in EF Core. What is the context doing?
The context snapshots every entity it loads so it can work out what changed at save time, which is useful for a handful of entities and pure overhead for a read. AsNoTracking removes the snapshot, and the same mechanism explains why a stray mutation on a tracked entity gets written even though you never called Update.
Your .NET service keeps getting OOM-killed in its container while the GC reports a small heap. Where has the memory gone?
The kernel kills you on everything in the cgroup, while the GC only reports the managed heap. Committed-but-empty heap, per-core Server GC heaps, thread stacks, native buffers and loaded code all count against the limit and none of them appear in a heap size figure.
Two users edit the same record and both save. What does EF Core do about it?
EF Core optimistic concurrency uses a rowversion or concurrency token so a stale update affects zero rows instead of overwriting another user's change. The application must then merge, retry or ask the user.
You await Task.WhenAll over three calls and two of them fail. What does your catch block see?
One exception. WhenAll's task faults with an AggregateException holding every failure, but await rethrows only the first inner exception, so recovering the rest means keeping the WhenAll task in a variable and reading its Exception property.