Languages

C# interview questions

Live

Types, collections, LINQ, async and the language features .NET interviewers probe first.

120 questions · 60 theory · 60 coding

Subtopics

  • Value vs reference types12
  • Collections & LINQ12
  • async/await & Task12
  • OOP & interfaces12
  • Generics12
  • Exceptions12
  • Records & structs12
  • IDisposable & using12
  • Delegates & events12
  • String handling & spans12

Sample questions

  • CodingJuniorasync/await & Task

    Write a private async Task<int> helper that returns its argument doubled, then implement the public entry point SumDoubled(List<int> numbers). SumDoubled itself is synchronous: it must start one helper task per number, await them all with

  • CodingJuniorasync/await & Task

    An unreliable async operation is scripted by outcomes: attempt number i (zero-based) succeeds when outcomes[i] is true. Implement AttemptsUntilSuccess(List<bool> outcomes, int maxAttempts).

  • TheoryJuniorasync/await & Task

    What does await actually do when you hit it? Does it start a new thread?

  • TheoryJuniorasync/await & Task

    Why is async void almost always a mistake, and what is the one place it is legitimate?

  • CodingJuniorCollections & LINQ

    Implement GroupByLength(List<string> words) returning a Dictionary<int, int> from word length to how many words have that length. Ignore null and empty strings.

  • CodingJuniorCollections & LINQ

    Implement AboveThreshold(List<int> numbers, int threshold) that returns the distinct values strictly greater than threshold, sorted ascending, as a List<int>. Return an empty list when nothing qualifies.

C# interview questions · BuildStep