Frameworks

.NET / ASP.NET Core interview questions

Live

Dependency injection, the middleware pipeline, EF Core, auth and the questions every .NET backend loop asks.

120 questions · 60 theory · 60 codingWorks best after C#

Subtopics

  • DI & service lifetimes10
  • Middleware pipeline10
  • Configuration & Options10
  • EF Core change tracking10
  • EF Core loading & N+110
  • Migrations8
  • Minimal APIs vs controllers10
  • JWT auth10
  • Model validation8
  • Logging8
  • Caching10
  • Background services8
  • Unit testing8

Sample questions

  • CodingJuniorBackground services

    A worker wakes up and has to decide which of its jobs are due. Each entry in jobs is "<name> <lastRun> <interval>".

    Implement DueJobs(List<string> jobs, int now) returning the names of

  • CodingJuniorBackground services

    A PeriodicTimer loop cannot overlap itself: ticks are at multiples of the period, and if a handler runs long the ticks that passed while it was working are simply skipped.

  • TheoryJuniorBackground services

    What is a BackgroundService in ASP.NET Core? Describe its lifecycle and what you put in ExecuteAsync.

  • TheoryJuniorBackground services

    You inject a DbContext into the constructor of a BackgroundService and it either throws at startup or behaves strangely after a while. Explain why, and show me the right way.

  • CodingJuniorCaching

    A cache key has to include everything the cached value depends on, and it has to be stable - two requests with the same inputs in a different order must produce the same key.

  • CodingJuniorCaching

    Trace a cache with absolute expiration against a fake clock. Each entry in requests is "<key> <time>", in non-decreasing time order.

    Implement SimulateCache(List<string> requests, int ttl) returning