AI Interview Assistant for C# and .NET

Prepare for the C# questions, the coding exercise and the ASP.NET Core discussion. When a live question goes deeper, Hiintly uses what you hear, the code you share and your project experience to suggest an answer you can explain.

What a .NET interview can cover

A .NET interview may combine language fundamentals, an exercise in a shared editor and a discussion about a service you built. Use the job description to decide where to start: an API role may spend more time on HTTP and data access, while a general coding round may focus on the language and collections.

If your Microsoft software engineering role calls for C#, try the calendar coding exercise in the Microsoft interview guide to practice explaining interval boundaries and testing your solution.

Technical screen
Predict what a short snippet does, then explain why. A question about a LINQ filter can turn into one about when the source is read and what happens if it changes.
Coding round
Clarify input, ordering and equality before choosing a collection. Walk through one normal input and one edge case, then explain the time and space cost.
Project discussion
Pick a service or feature you worked on. Be ready to trace one request and explain what you changed, why you chose it and how you knew it worked.

C# interview questions and answers

These questions test whether you can connect a language feature to the behavior of real code. Lead with what happens, then explain why it matters.

Does async start a new thread?

No. When an awaited database or network operation is incomplete, the method can suspend and resume after it finishes. Waiting for asynchronous I/O doesn't require a thread to sit blocked. CPU work still needs processor time.

If asked to load two results together, explain when the operations are independent. For example, don't run two queries concurrently on one EF Core DbContext. Microsoft’s C# async guide explains how tasks and awaits fit together.

When does a LINQ filter run?

For a LINQ to Objects sequence, Where creates a deferred query. Iterating it runs the filter. If a list changes between iterations, the same query can see the new data.

If you need the same results twice, ToList() evaluates the sequence and stores the results. It costs memory and makes a list of the values or references produced at that point, without cloning referenced objects.

When would you use an interface instead of a base class?

Use an interface to define what callers need from interchangeable implementations. An IOrderNotifier can let an order service send through email or a test double without tying the service to either implementation.

An abstract base class can make sense when related implementations share state or steps that must run in the same order. If the only thing in common is a method signature, that alone doesn't justify a class hierarchy.

C# coding exercise: keep the first event per ID

You receive a sequence of events in arrival order. Return the first event for each distinct ID, preserving the order of the events you keep. Assume each event has a non-null string Id and IDs are case-sensitive.

static List<Event> KeepFirst(IEnumerable<Event> events)
{
    var seen = new HashSet<string>(StringComparer.Ordinal);
    var result = new List<Event>();

    foreach (var item in events)
    {
        if (seen.Add(item.Id))
            result.Add(item);
    }

    return result;
}

Explain the loop before you write it

HashSet.Add tells you whether an ID was new. Append to the result only on that first encounter. The list preserves input order even though the set is only used for membership. For IDs A, B, A, C, you keep the events at positions 1, 2 and 4. An empty input produces an empty list.

For n events and k distinct IDs, expect O(n) time under normal hashing assumptions when ID lengths are bounded, and O(k) extra space including the returned list.

Follow-up: “What if we want the newest timestamp?”

First clarify how ties and output order should work. Keep the best event per ID in a dictionary and replace it only when you see a later timestamp. If output still follows first occurrence of each ID, keep a separate list of IDs in that order and use it to read from the dictionary.

If the interviewer shows the prompt on screen, send a screenshot to Hiintly with the tie and ordering rules you agreed on. Ask for the minimal code change and a test that distinguishes latest timestamp from last arrival. The coding interview copilot guide shows how to carry constraints like these into a follow-up.

ASP.NET Core interview questions

Practice tracing what happens from the incoming HTTP request to the database query. In an interview, that gives you a concrete way to explain framework features and the bugs they help prevent.

How do you choose a dependency injection lifetime?

A transient service is created each time it's resolved, a scoped service once per scope (typically an HTTP request), and a singleton once for the container. An EF Core context registered with AddDbContext is scoped by default.

If a singleton background worker needs a context, create a scope per unit of work and resolve the context within it. Holding a scoped context in the singleton would outlive its intended scope. See Microsoft’s service lifetime guidance.

Why does middleware order matter?

Middleware can do work before and after the next component, or return a response early. For an endpoint that needs a signed-in user, authentication needs to establish the identity before authorization evaluates it.

If a request reaches authorization without an identity, trace how authentication is configured and where it runs. If an authenticated user is denied, check whether the identity actually meets the endpoint’s policy. The two symptoms send you looking in different places.

How would you investigate a slow EF Core endpoint?

Look at the SQL and the number of database calls first. If the endpoint only displays order IDs and totals, filter and project the fields before materializing the query. Limit the result and use a stable sort so the first page is predictable.

For a follow-up about the next page, add an ID boundary for this sort order. If each row shows related data, check for a query inside a loop or lazy loading that fetches it one row at a time. Microsoft’s EF Core query guidance covers projection, paging and extra round trips. The backend invoice API example explores the same pagination choice when rows are scoped to an account.

var rows = await db.Orders
    .Where(o => o.Status == OrderStatus.Open)
    .OrderBy(o => o.Id)
    .Select(o => new { o.Id, o.Total })
    .Take(pageSize)
    .ToListAsync(cancellationToken);

Use Hiintly when the interview moves past the first answer

Add your resume and the job description, then use Extra Instructions to specify the C# or .NET version and the parts of the project you actually owned. Choose Software Engineer for a mixed technical discussion, or Coding Interview if the session centers on an editor.

When the interviewer asks about a change you made, send the transcribed question and ask Hiintly to organize your answer around the evidence you have. For example: “I changed the orders endpoint to project a DTO. Help me explain what that removed from the query. I checked the SQL logs, but I don't have latency numbers.”

If they show a query and ask whether it will issue extra SQL, capture the relevant code from your selected screen source, add the new question and press Send. Use the suggestion to identify where execution happens and which database calls you would verify.

Hiintly desktop overlay displaying a coding suggestion

C# and .NET interview FAQ

Which C# interview questions should I study first?

Start with questions that ask you to predict behavior: when a LINQ query runs, what happens when you pass a value type to a method, or how a Task reports completion and failure. Then practice explaining which collection, interface or async API you would use for a specific requirement.

What should I expect in a senior .NET interview?

Prepare to walk through decisions from a real service: what failed, how you diagnosed it and which trade-offs you accepted. Be ready for a follow-up on database round trips, request cancellation, shared state or deployment. The job description is a better guide to the emphasis than seniority alone.

Can I use modern C# syntax in a coding interview?

Check which compiler and runtime the editor provides. If you need records, collection expressions or a newer library API, confirm support first. State the version in Hiintly’s Extra Instructions so the suggested code fits the environment.

How do I try Hiintly with a C# question?

Start a free 10-minute session without a credit card. Give Hiintly the C# version and the question, or send a screenshot of the code. You can start another free session after the cooldown.

Bring a C# question to your first session

Start with an async question, a shared snippet or an API decision from your resume. Give Hiintly the constraints and see how the suggested explanation changes when you add a follow-up.