DevOpsInterviewPrep logo
Cloud Platforms & Architecture / 05
mediumNewAmazonMicrosoftAtlassian

When is serverless the wrong choice? Talk me through cold starts and what they actually cost.

Most candidates can sell serverless. The question asks you to argue against it, which needs a real understanding of the execution model rather than the marketing.

Updated Sep 2026 · Grounded in researched DevOps, SRE and platform engineering interview loops, written to a senior-engineer editorial bar, and never padded to hit a word count.

TL;DR: For Lambda-style functions, reconsider when you have steady high throughput (cost per request stops being competitive), when you need predictable low latency (cold starts), when the work runs long or needs persistent connections, and when you are already paying for a container platform. Cold start is provisioning plus runtime initialisation plus your own initialisation, and the last part is usually the one you control.

How to approach it

Take the position the question asks for and support it with the execution model. An answer that lists benefits has not engaged with the question.

A strong answer

This answer concerns Lambda-style functions; serverless also includes managed container and data services with different execution models. Functions reduce infrastructure management and charge for execution, which is excellent for spiky, low-volume, event-driven work. The cases where it is the wrong tool follow from the same properties.

Steady high throughput. The pricing model is a premium per unit of compute in exchange for scaling to zero. If your traffic never goes to zero, you are paying the premium permanently. There is a crossover point where a reserved container fleet is cheaper, and for a service at constant load it arrives sooner than people expect. Work the arithmetic in the interview rather than asserting it: invocations times duration times memory against the equivalent always-on capacity.

Predictable low latency. A cold start has three parts. The provider provisions an execution environment, the language runtime initialises, and your code runs its own initialisation before handling the first request. The provider's part is largely out of your hands and is small for lightweight runtimes and much larger for a JVM. Your part is not: a function that opens database connections, loads configuration and builds a dependency graph at startup can turn a 200ms cold start into two seconds. If your p99 requirement is tight and your traffic is intermittent enough that instances get recycled, you will miss it. Provisioned concurrency reduces it for the configured capacity, while spillover and environment resets still need testing, which is also the point at which you are paying for idle capacity and have given up the main advantage.

Long-running or stateful work. There is an execution time limit, so anything longer must be decomposed or moved. Persistent connections are the subtler problem: each concurrent execution is a separate environment, so a thousand concurrent functions want a thousand database connections, and a traditional relational database will refuse long before that. This is a real and common failure, and the mitigations (a connection proxy, or a data store designed for it) are extra architecture you did not have when you started.

Where you already run a container platform. If a Kubernetes cluster exists and is paid for, adding a second deployment model has an organisational cost: two sets of tooling, two observability stories, two security models. That is a legitimate reason to say no to an otherwise reasonable fit.

The framing worth offering: serverless is excellent at the edges of a system (event handlers, glue, scheduled jobs, traffic that is bursty) and questionable at the core of a high-traffic service. Most mature architectures use both rather than choosing.

Lambda startup options documents the provider or model boundaries used here.

What interviewers probe next

"How would you reduce a cold start?" Smaller deployment package, a lighter runtime, lazy initialisation so only what the first request needs is built, and moving connection setup out of the handler path. Evaluate provisioned concurrency or SnapStart where the runtime and configuration support it, including restore behavior and pricing.

"What is the vendor lock-in argument?" Real but often overstated for the compute itself. The lock-in is in the surrounding managed services and the event wiring, not in the function body.

"How do you test it locally?" Emulators approximate it and diverge on IAM and event shapes. Deploy to a real environment early, because the differences that matter are the ones the emulator does not model.

Common mistakes

Selling serverless when asked to argue against it.

Describing cold start as one number rather than three components, only one of which you control.

Missing the connection exhaustion problem, which is the failure most teams actually hit.

That one was free, and so are 10 answers per topic without an account. Signing in doubles that to 20, keeps your bookmarks, and tracks which topics you keep getting wrong.one Google click · no card · nothing to cancel
HOW DID IT GO?
0
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

Nothing here yet. Say how you would answer it.