Your question is Low-Level Authentication Flow Design. Take a moment with it on the right.
Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).
Low-level design of an authentication flow (ASP.NET Core middleware / request lifecycle context).
Asked in the Technical round stage. Backend/.NET fundamentals round.
Implement and explain the request lifecycle, including authentication middleware, token or cookie validation, claims construction, authorization handoff, failure responses, and safe handling of unauthenticated or malformed requests. Discuss middleware ordering, dependency injection, observability, and testing.