How a .NET Lambda Function Runs
Talk it through out loud with your AI coach.
The problem
- easy
A teammate's .NET Lambda function creates a new DynamoDB client and HttpClient inside the handler on every call, and stores the current user's id in a static field. Explain how Lambda runs a .NET function, from the first request to later ones, and what you'd change in this code.
What a strong answer covers
- The phases a function goes through and which code runs in each.
- How Lambda handles more traffic.
- What's worth setting up once and reusing.
- Why shared state across invocations is risky.
Common mistake: Assuming every invocation starts from a clean process, so static state is harmless and setup cost doesn't matter.
Knowing this is half of it. Saying it clearly out loud is the part the coach helps you practise.
Practise it out loud