Serverless
28 bites tagged Serverless — interview questions with model answers, and 60-second explainers.
Aurora Serverless v2 for spiky traffic
Serverless v2 autoscales capacity in fine-grained ACU steps near-instantly, you pay per-ACU-second, and provisioned is fixed cost regardless of load. matching capacity model to traffic shape.
Event bus versus message queue for triggers
A queue is point-to-point buffered work for one consumer group; an event bus routes and filters one event to many decoupled subscribers. Event bus wins when many independent services must react. messaging pattern selection.
Strangler Fig with serverless and an event bus
API Gateway acts as the routing facade, new features run as Lambda functions, an event bus decouples and fans out to new services, and traffic shifts feature by feature until the monolith… applying incremental migration with serverless.
Inference performance bottlenecks on Lambda
Cold starts loading the model, memory and CPU limits, no GPU, and package size dominate; mitigate with provisioned concurrency, loading the model once outside the handler, smaller models, and right-sized… serverless ML serving limits.
High-throughput serverless stream processing
Partition by key for per-user ordering, use a sharded log with batched consumers for backpressure, and tune batch size and shards for cost. stream design at scale. a global FIFO queue or per-event invocation at 100k/sec.
Serverless functions with a relational database
Concurrent function instances each open connections and exhaust the database's bounded pool; fix with a connection proxy or pooler, init-phase reuse, or capped concurrency. the connection-storm problem. a connection per call.
Distributed tracing for serverless apps
Propagate a trace context through every hop, instrument with OpenTelemetry or X-Ray, capture spans including the database, and correlate traces with structured logs. end-to-end observability. per-service logs, no correlation.
Idempotency in event-driven systems
Idempotency means repeated processing yields the same end state; it matters because messages get redelivered; achieve it with idempotency keys and conditional writes. handling at-least-once delivery. assuming exactly-once.
State machines versus long-running functions
State machines externalize state, pause for human input without running compute, give built-in retries and audit history, and bill per transition. orchestration for long workflows. a function blocking for days on input.
Purpose and setup of a Dead-Letter Queue
A DLQ captures messages that repeatedly fail so they neither block the queue nor get lost; configure a redrive policy with a max receive count and alarm on it. handling unprocessable messages. silently dropping failures.
Serverless cold starts and how to mitigate them
A cold start is the latency to provision and initialize a fresh environment; mitigate with provisioned concurrency, smaller packages, and lighter runtimes. the serverless execution model. calling every slow call cold.
Cold starts in serverless environments
A cold start is the delay to provision a fresh instance and initialize the runtime; mitigate with provisioned concurrency and by shrinking init work. serverless latency internals. blaming network or steady-state latency.
Cloudflare Sandboxes Cut Container Heartbeat Plumbing
Kent C. Dodds replaced Cloudflare Containers with Sandboxes, deleting heartbeat and shutdown logic for his FFmpeg pipeline. PR #729 uses one-shot exec() inside the existing queue worker, cutting deploy surface and eliminating long-lived service orchestration.
How do you manage database connections in serverless Next.js API routes?
This tests serverless concurrency and connection limits. A strong answer notes lambda scaling exhausts DB connections, advocates connection pooling or serverless drivers, and caches the client globally.
How can you use Edge Middleware for auth and trade-offs versus getServerSideProps?
Middleware checks cookies/JWT for fast Edge rewrites/redirects; getServerSideProps uses full Node.js for heavy sessions with colder starts. Auth placement judgment. Claiming Edge Middleware can query a database directly.
CloudEvents: The Event Data Standard
CloudEvents provides a common envelope for event data, enabling routing without custom parsers. Use it when events cross clouds, SaaS tools, or internal services. It standardizes wrappers, not payloads, so producers and consumers still need aligned schemas.
Build a pipeline to load a daily CSV into a database
This tests your ability to connect basic cloud services (storage, compute, database) into a simple, event-driven data pipeline. A good answer mentions an event trigger (S3), a serverless function (Lambda), and a database (RDS), plus error handling.
Build a pipeline to load CSVs into a database
Tests your grasp of event-driven architecture and basic ETL. A good answer outlines a trigger (storage event), a processing function (serverless), and a destination (database), mentioning error handling. A red flag is describing a manual or cron-based process.
Next.js Runtimes: Edge vs. Node.js
Choose your server environment in Next.js: a fast, limited Edge function or a powerful Node.js backend. Use the Edge for low-latency tasks like auth checks; stick with Node.js for its full API set and heavier computation.
Mangum: Run Python ASGI Apps on Serverless
Mangum is an adapter for running Python ASGI apps (like FastAPI) on serverless platforms like AWS Lambda. It translates serverless events into ASGI requests, letting you deploy existing async web apps without a rewrite.
Serverless Inference: Run ML Models Without Managing Servers
Serverless inference treats ML prediction like a function call, abstracting away servers. You pay for compute time per prediction, not for idle infrastructure.
Serverless State Machines: The Conductor for Your Functions
A serverless state machine is the conductor for your microservices, telling each function when to run and how to handle errors. It's built for multi-step processes like ETL pipelines or coordinating parallel tasks. The footgun is creating a visual monolith.
AWS SAM: A Shorthand for Serverless on AWS
Think of AWS SAM as a developer-friendly shorthand for defining serverless applications. It simplifies creating Lambda functions and APIs by abstracting away verbose CloudFormation syntax, letting you build and test locally before deploying.
Serverless Cold Starts: The Price of 'Pay-per-Use'
A serverless cold start is the initial delay when a function boots from scratch, like waking a computer from being off versus asleep. It happens on the first request or after inactivity.
Get Serverless bites daily.
Five a day, five minutes, offline. With quizzes so it sticks.
Open testing — you’ll join as an early tester.