Serverless Architecture Bonus Content
30 questions on Serverless Architecture.
Question 1: What is a 'Cold Start' in Serverless FaaS (Function as a Service)?
- A. The time it takes for a function to execute when database caches are empty.
- B. The latency spike occurring when a function is invoked after being idle, requiring the cloud provider to spin up a new container instance. β (correct answer)
- C. A system reboot of the underlying physical host machine.
- D. A security protocol execution for cleaning temporary files.
Explanation: Cold starts happen when the platform instantiates a function environment from scratch, introducing initial initialization latency.
Question 2: How does Event-Driven architecture drive Serverless pricing models?
- A. Users are billed monthly based on the size of their database schemas.
- B. Functions are billed only for active execution time (measured in milliseconds) triggered by events, resulting in zero cost when idle. β (correct answer)
- C. Users are billed for the peak network speed achieved.
- D. Users pay a flat rate for CPU reservations.
Explanation: Serverless abstracts host resources. You pay only for requests processed and RAM-milliseconds used during execution.
Question 3: Why is maintaining state within a Serverless Function instance considered an anti-pattern?
- A. Functions cannot connect to external databases.
- B. Memory allocations in serverless functions are limited to 128KB.
- C. Function containers are ephemeral, scaling up or down dynamically, meaning local state is lost between invocations. β (correct answer)
- D. Writing data to memory slows down API execution.
Explanation: Serverless functions are stateless. State must be externalized to database layers (e.g. DynamoDB, Redis) to ensure scale consistency.
Question 4: What is the role of an API Gateway in serverless system design?
- A. To compile backend container images in the cloud.
- B. To act as a entry hub, translating public HTTP requests into backend function invocations and handling throttling, CORS, and auth. β (correct answer)
- C. To backup database configurations to remote storage.
- D. To compress function code size before routing.
Explanation: API Gateways present structured endpoints to clients, delegating request payloads to serverless function runs.
Question 5: In serverless databases (e.g. Amazon Aurora Serverless), how is scale-to-zero capacity handled?
- A. The database drops old schemas to save memory.
- B. The database pauses compute resources when inactive, resuming automatically on the next query connection. β (correct answer)
- C. The database runs on client browsers to bypass host charges.
- D. The database limits query results to 10 rows.
Explanation: Serverless databases decouple compute from storage, shutting down compute nodes completely during zero-activity periods.
Question 6: What is Function as a Service (FaaS)?
- A. A programming language standard.
- B. A category of cloud computing services providing a platform allowing customers to execute code snippets in response to events without managing servers. β (correct answer)
- C. A database replication tool.
- D. A local network configuration.
Explanation: FaaS (e.g., Lambda, Azure Functions) is the core execution block of serverless applications.
Question 7: Which metric typically determines serverless function execution costs?
- A. The physical size of the code files.
- B. The combination of request counts and execution duration (measured in gigabyte-seconds or milliseconds). β (correct answer)
- C. The bandwidth speed of local connections.
- D. The number of database tables.
Explanation: Users pay for execution time scaled by the amount of RAM allocated to functions.
Question 8: How does the serverless concept of 'Concurrency Limits' protect backends?
- A. It speeds up compiler runs.
- B. It restricts the number of simultaneous active function runs, protecting downstream resources like relational databases from being overwhelmed. β (correct answer)
- C. It encrypts function payloads in transit.
- D. It resets variables on exit.
Explanation: Rate limits and concurrency caps block spikes from creating database thread exhaustion.
Question 9: What does it mean that a serverless function is 'ephemeral'?
- A. The function is secure and private.
- B. The container environment running the function exists temporarily, disappearing shortly after execution ends. β (correct answer)
- C. The code is written in Python.
- D. The function runs on local desktops.
Explanation: Ephemeral lifespans mean containers are destroyed when idle, freeing cloud cluster resources.
Question 10: What does 'Scale to Zero' mean?
- A. The application size decreases.
- B. The platform automatically terminates all active running instances during periods of zero traffic, incurring zero billing costs. β (correct answer)
- C. The database drops index files.
- D. The server bandwidth decreases.
Explanation: Scale-to-zero is a primary advantage, optimizing costs for low-use services.
Question 11: What is the purpose of 'Provisioned Concurrency' in AWS Lambda?
- A. Reducing S3 storage costs.
- B. Keeping a specified number of function environments initialized and ready to execute, completely eliminating cold start latency. β (correct answer)
- C. Restricting functions to admin users.
- D. Speeding up database joins.
Explanation: Provisioned concurrency keeps containers warm, avoiding initial setup delays at higher standby costs.
Question 12: Which service is standard for managing serverless API gateways in AWS?
- A. Amazon EC2
- B. Amazon API Gateway β (correct answer)
- C. Amazon S3
- D. AWS KMS
Explanation: API Gateway routes public requests, translating them to Lambda runs.
Question 13: How is security managed at the function level in serverless environments?
- A. By applying firewalls to individual containers.
- B. By assigning granular IAM roles/policies to each function, restricting access to target services. β (correct answer)
- C. By encrypting code files on disk.
- D. By validating user IPs in a settings file.
Explanation: The principle of least privilege ensures functions possess permissions only to resources they query.
Question 14: What is a 'Serverless Web Webhook'?
- A. A physical hardware connection.
- B. A serverless function exposed via an HTTP endpoint, triggered dynamically by external events or SaaS applications. β (correct answer)
- C. An administrative terminal.
- D. An encryption module.
Explanation: Webhooks trigger functions to process web payments, SMS alerts, or repository push events.
Question 15: What is a serverless database?
- A. A database with no tables.
- B. A database designed to scale compute resources dynamically to match query traffic, supporting scale-to-zero. β (correct answer)
- C. A database stored on client browsers.
- D. A database backup script.
Explanation: Serverless databases (e.g. DynamoDB) abstract server provisioning and scaling.
Question 16: What is the default execution timeout limit for AWS Lambda functions?
- A. 60 seconds
- B. 15 minutes β (correct answer)
- C. 1 hour
- D. Unlimited
Explanation: Lambda restricts runs to 15 minutes maximum, suited for short-lived microtasks.
Question 17: What is the benefit of using Orchestration Services (like AWS Step Functions) in serverless design?
- A. Compressing code bundles.
- B. Coordinating complex workflows, state changes, and parallel execution paths across multiple functions. β (correct answer)
- C. Caching database tables.
- D. Routing DNS requests.
Explanation: Step Functions manage state machine logic, decoupling routing flow from single functions.
Question 18: What does 'NoOps' imply about serverless environments?
- A. Operations teams are completely fired.
- B. Software developers can build and deploy applications without manually configuring or maintaining operating systems or servers. β (correct answer)
- C. SQL queries are disabled.
- D. Firewall configurations are ignored.
Explanation: NoOps delegates server configurations to cloud vendors, leaving developers to write code.
Question 19: What is the primary cause of high 'Cold Start' latency?
- A. Slow database queries.
- B. The time required to spin up container instances, load the runtime, and initialize helper scripts. β (correct answer)
- C. Network routing updates.
- D. High billing costs.
Explanation: Language runtimes (like Java/C#) have heavier cold start overheads than light ones (like Python/JS).
Question 20: How do you implement dead letter queues (DLQs) in serverless pipelines?
- A. By writing logs to text files.
- B. By routing failed asynchronous function runs to SQS queues or SNS topics for debugging. β (correct answer)
- C. By formatting database columns.
- D. By restarting server processes.
Explanation: DLQs isolate failed inputs, preventing data loss during event processing crashes.
Question 21: What is Google Cloud Functions?
- A. A math library.
- B. GCP's event-driven serverless FaaS environment. β (correct answer)
- C. A database backup tool.
- D. A server container registry.
Explanation: Cloud Functions runs code blocks in response to cloud events, scaling automatically.
Question 22: What does 'Serverless Framework' do?
- A. Compiles Node binaries.
- B. A popular open-source CLI tool used to deploy serverless applications and resources across multiple cloud providers. β (correct answer)
- C. Configures server hardware.
- D. Manages user logs.
Explanation: Serverless Framework maps serverless YAML settings, deploying functions and API nodes.
Question 23: What is the security risk of over-privileged IAM execution roles on functions?
- A. The function execution speed drops.
- B. If a function is compromised, attackers can query or edit resources they shouldn't have access to. β (correct answer)
- C. It blocks CORS headers.
- D. It disables logging tools.
Explanation: Limiting permissions bounds damage if bugs expose function executions.
Question 24: Which service is a serverless container hosting platform in GCP?
- A. Cloud SQL
- B. Cloud Run β (correct answer)
- C. App Engine
- D. Cloud functions
Explanation: Cloud Run runs docker containers serverlessly, scaling down to zero when idle.
Question 25: What is the function of the Serverless database 'Aurora Serverless'?
- A. It compresses file tables.
- B. It automatically starts, scales, and shuts down compute capacities based on application workload queries. β (correct answer)
- C. It routes traffic.
- D. It logs user queries.
Explanation: Aurora Serverless separates storage and compute, scaling compute nodes dynamically.
Question 26: Why is logging and monitoring complex in serverless architectures?
- A. Serverless lacks logging libraries.
- B. Systems are distributed, asynchronous, and short-lived, requiring central aggregators (like CloudWatch or Datadog) to trace calls. β (correct answer)
- C. Code files are read-only.
- D. Functions run without network access.
Explanation: Tracing calls across ephemeral functions requires correlation IDs and APM collectors.
Question 27: What is an 'Event Source' in serverless applications?
- A. A developer writing code.
- B. The cloud service or event (like S3 upload, API request) that triggers the execution of a serverless function. β (correct answer)
- C. The local network driver.
- D. The compiler script file.
Explanation: Event sources map triggers to functions, starting them automatically.
Question 28: What does AWS Lambda layers do?
- A. Speeds up compiler runs.
- B. Promotes code reuse by separating libraries, dependencies, or custom runtimes from the main function deployment package. β (correct answer)
- C. Configures network routing.
- D. Manages database credentials.
Explanation: Layers bundle shared dependencies (e.g. NumPy), keeping deploy packages small.
Question 29: What is a 'Warm Start'?
- A. Booting a computer manually.
- B. Reusing an existing, initialized container instance to execute a function, avoiding cold start latency. β (correct answer)
- C. Caching database index columns.
- D. Modifying code files.
Explanation: Warm starts skip container initialization, processing events with minimal delays.
Question 30: Which language runtime has the lowest cold start latency on average?
- A. Java
- B. Node.js (or Python) β (correct answer)
- C. C#
- D. Go
Explanation: Node.js and Python are lightweight, initializing faster than JVM or .NET runtimes.