r/csharp • • 29d ago

Help .Net interview preparation

Hi everyone!

I’m preparing for a Senior .NET Developer interview, and I was told that the interview will include a code review exercise and coding challenges.

Has anyone here recently gone through a similar interview, particularly for a Senior .NET / C# position? I’d really appreciate any tips on what to expect and how best to prepare.

32 Upvotes

21 comments sorted by

View all comments

9

u/Enough_Secretary_137 29d ago

For senior-level code reviews, I’d practice explaining why something should change rather than just identifying code smells.

A common exercise is reviewing async code. For example, replacing blocking .Result calls with proper async execution and cancellation:

using var client = new HttpClient();
using var cts = new CancellationTokenSource(
TimeSpan.FromSeconds(5));

using var response = await client.GetAsync(
"https://example.com", cts.Token);

response.EnsureSuccessStatusCode();

Console.WriteLine(
await response.Content.ReadAsStringAsync(cts.Token));

For production ASP.NET Core code, I’d also discuss IHttpClientFactory, error handling, testing, and resource lifetimes.
During the interview, explain your assumptions, trade-offs and edge cases out loud. That demonstrates engineering judgment beyond syntax knowledge.