Interview Q&A / AWS & Cloud

BeginnerQuick answer1 min readUpdated 3 Oct 2026

What is a Lambda cold start and how can you reduce it?

SHORT ANSWER

A cold start is the extra delay when Lambda has to create a new execution environment and load your code before running it. Reduce it with smaller packages, lighter runtimes, less work outside the handler, or provisioned concurrency.

Explain it simply

A cold start is like opening a tea stall in the morning. The first customer waits while you light the stove and boil water. After that, tea is served fast as long as the stove stays on. If no one comes for a while the stove is switched off and the next customer waits again.

Example

python
import boto3

# Runs once per new environment (cold start), then reused
s3 = boto3.client("s3")

def handler(event, context):
    # Runs on every invocation
    return {"statusCode": 200}

During a cold start Lambda downloads the code, starts the runtime and runs initialisation code outside the handler. Later invocations that reuse the same environment are "warm" and skip all that.

Ways to reduce it:

  • Keep deployment packages small and import only what you need.
  • Pick a fast-starting runtime. Java and .NET usually start slower than Node.js or Python.
  • Create SDK clients and connections outside the handler so warm calls reuse them.
  • Use provisioned concurrency to keep environments initialised (costs extra).
  • Avoid attaching to a VPC unless you need to.

What to say in the interview

"A cold start happens when Lambda must build a new execution environment. I keep packages small, initialise clients outside the handler, and use provisioned concurrency for latency-sensitive paths. For background jobs a cold start rarely matters."

Common mistakes

  • Putting expensive initialisation inside the handler so it runs every time.

#aws#lambda#serverless

Related questions

Practise more AWS & Cloud questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open AWS & Cloud quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.