Unit 6: Serverless and Microservices Architectures - Practice Quiz

INT364 — Cloud Architecture And Implementation-Ii 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What does the term serverless computing primarily mean?

Serverless and architectural considerations Easy
A. Cloud providers manage the underlying servers
B. Applications run without any computing resources
C. Developers manage physical servers directly
D. Users purchase dedicated hardware for each application

2 Which is a common benefit of a serverless architecture?

Serverless and architectural considerations Easy
A. Complete control over the operating system, physical network, and server hardware
B. Manual hardware maintenance
C. Automatic resource scaling
D. Permanent server allocation

3 Why should serverless functions generally be designed as stateless?

Serverless and architectural considerations Easy
A. Function instances may be temporary
B. Cloud services reject stored data
C. Databases cannot store state
D. Functions cannot receive input

4 Which architectural style is commonly associated with serverless applications?

Serverless and architectural considerations Easy
A. Single-device architecture
B. Manual-processing architecture
C. Event-driven architecture
D. Mainframe-only architecture

5 What is AWS Lambda primarily used for?

Building serverless applications with AWS Lambda Easy
A. Purchasing physical server hardware
B. Creating private network cables
C. Running code in response to events
D. Managing desktop operating systems

6 What is the purpose of a Lambda function handler?

Building serverless applications with AWS Lambda Easy
A. To create an AWS billing account
B. To permanently reserve a server
C. To receive and process an event
D. To install physical network equipment

7 Which event can directly trigger an AWS Lambda function?

Building serverless applications with AWS Lambda Easy
A. A disconnected keyboard input
B. A manual replacement of physical storage hardware inside an AWS data center
C. An Amazon S3 object upload
D. A local printer paper change

8 What allows an AWS Lambda function to access other AWS services securely?

Building serverless applications with AWS Lambda Easy
A. A hardware access card
B. A desktop user account
C. An IAM execution role
D. A public IP address

9 What is the main purpose of Amazon API Gateway?

Extending functionality using Amazon API Gateway Easy
A. Designing database storage disks
B. Creating and managing APIs
C. Compiling operating systems
D. Repairing physical servers

10 How can Amazon API Gateway work with AWS Lambda?

Extending functionality using Amazon API Gateway Easy
A. It converts Lambda into a database
B. It invokes Lambda for API requests
C. It replaces Lambda with physical servers
D. It downloads and installs a complete desktop operating system for every API request

11 Which AWS service can help authenticate API Gateway users?

Extending functionality using Amazon API Gateway Easy
A. AWS Snowball
B. Amazon Route 53
C. Amazon Cognito
D. Amazon S3 Glacier

12 Which HTTP method is commonly used to retrieve a resource through an API?

Extending functionality using Amazon API Gateway Easy
A. GET
B. PATCH
C. POST
D. DELETE

13 Which AWS service is designed to orchestrate Docker-compatible containers?

Running microservices with AWS container services Easy
A. Amazon WorkSpaces
B. Amazon Route 53
C. Amazon CloudFront
D. Amazon ECS

14 Which AWS service provides managed Kubernetes clusters?

Running microservices with AWS container services Easy
A. Amazon RDS
B. Amazon EKS
C. Amazon SQS
D. Amazon SES

15 What does AWS Fargate allow developers to do?

Running microservices with AWS container services Easy
A. Manually configure every physical server and network switch used by a container
B. Run containers without managing servers
C. Store long-term database backups
D. Register public internet domain names

16 What is a key characteristic of a microservice?

Running microservices with AWS container services Easy
A. It must use one shared codebase
B. It requires dedicated hardware
C. It combines every business function
D. It can be deployed independently

17 Which practice supports the Security pillar in a serverless architecture?

Applying Well-Architected principles to serverless architectures Easy
A. Sharing one password across services
B. Allowing every function to access all resources in every AWS account
C. Granting administrator access by default
D. Applying least-privilege permissions

18 Which AWS service is commonly used to monitor Lambda metrics and logs?

Applying Well-Architected principles to serverless architectures Easy
A. Amazon Lightsail
B. Amazon CloudWatch
C. Amazon AppStream 2.0
D. AWS Direct Connect

19 Which serverless pricing characteristic supports the Cost Optimization pillar?

Applying Well-Architected principles to serverless architectures Easy
A. Buying servers in advance
B. Paying for actual usage
C. Paying for idle capacity
D. Maintaining unused hardware

20 Which practice can improve the reliability of event-driven serverless processing?

Applying Well-Architected principles to serverless architectures Easy
A. Disabling application logs
B. Sending every event to one permanently running desktop computer
C. Using retries and dead-letter queues
D. Ignoring all failed events

21 An image-processing workload receives unpredictable traffic spikes and remains idle for several hours each day. Which architecture best minimizes operational effort and idle cost?

Serverless and architectural considerations Medium
A. Run a dedicated EC2 instance for each uploaded image
B. Run a fixed-size Amazon EC2 Auto Scaling group
C. Run AWS Lambda functions triggered by Amazon S3 events
D. Run containers continuously on self-managed EC2 instances

22 A serverless shopping-cart function must preserve cart data across multiple invocations. Where should the application store this state?

Serverless and architectural considerations Medium
A. In an external service such as Amazon DynamoDB
B. In the function's global variables
C. In the function's temporary /tmp directory
D. In a larger Lambda deployment package that is updated after every request

23 A synchronous serverless API has strict latency requirements, but users occasionally experience delays when new Lambda execution environments are created. Which change most directly reduces this issue?

Serverless and architectural considerations Medium
A. Increase the API Gateway integration timeout
B. Store the deployment package in Amazon EFS
C. Enable provisioned concurrency for the function
D. Increase reserved concurrency to a very high value so that every possible request receives a permanently active environment

24 An order API invokes a payment-processing component. Temporary payment-service failures must not cause orders to be lost, and the API should respond quickly. Which design is most appropriate?

Serverless and architectural considerations Medium
A. Call the payment service synchronously from the API
B. Place orders in Amazon SQS and process them asynchronously
C. Store pending orders only in Lambda environment variables
D. Retry the payment call continuously within the original API request

25 A Lambda function must create thumbnails whenever users upload images to a specific Amazon S3 bucket. What is the most direct event configuration?

Building serverless applications with AWS Lambda Medium
A. Configure an S3 object-created event to invoke the function
B. Configure an API Gateway route for every uploaded object
C. Configure an EC2 scheduled task to scan S3 and submit each image to Lambda
D. Configure Lambda to poll the S3 bucket every minute

26 An SQS-triggered Lambda function may receive the same message more than once. The function writes payment records to a database. Which implementation prevents duplicate charges?

Building serverless applications with AWS Lambda Medium
A. Use an idempotency key for each payment operation
B. Increase the Lambda function's memory allocation
C. Reduce the SQS message retention period
D. Delete every message before the function begins processing it

27 A Lambda function consumes records rapidly, but its relational database can handle only 50 simultaneous connections. Which configuration best protects the database?

Building serverless applications with AWS Lambda Medium
A. Increase the function's ephemeral storage to 50 GB
B. Configure provisioned concurrency above 500 so all requests immediately obtain database connections
C. Set the function's reserved concurrency to 50
D. Set the function timeout to 50 seconds

28 A document workflow contains validation, approval, and notification Lambda functions. It needs branching, retries, and execution history. Which AWS service should coordinate the workflow?

Building serverless applications with AWS Lambda Medium
A. AWS Step Functions
B. Amazon Elastic Container Registry
C. Amazon Route 53
D. AWS CloudFormation

29 A company wants to expose a Lambda function as a synchronous HTTPS endpoint that accepts POST requests. Which integration is most appropriate?

Extending functionality using Amazon API Gateway Medium
A. An API Gateway route integrated with Lambda
B. An Amazon S3 event notification integrated with Lambda
C. An Amazon EventBridge scheduled rule integrated with Lambda
D. An Amazon CloudFront distribution that invokes the function without an HTTP API origin

30 A mobile application receives JSON Web Tokens from an identity provider. The API must reject invalid tokens before invoking its Lambda backend. Which API Gateway feature should be used?

Extending functionality using Amazon API Gateway Medium
A. A usage plan that validates token signatures and user claims inside each throttling rule
B. A stage variable
C. A JWT authorizer
D. A request mapping template

31 A public REST API is overwhelming its backend during sudden traffic bursts. Which API Gateway configuration most directly limits the request rate reaching the backend?

Extending functionality using Amazon API Gateway Medium
A. Increase the integration timeout for every method
B. Enable binary media support
C. Add a custom domain name
D. Configure stage-level throttling

32 A legacy backend expects a field named customer_id, but API clients send customerId. The backend code cannot be changed. Which API Gateway feature can adapt the request?

Extending functionality using Amazon API Gateway Medium
A. An API Gateway edge-optimized endpoint
B. A usage plan that stores both field names and synchronizes them with the legacy database
C. A Lambda reserved concurrency setting
D. An integration request mapping template

33 A team wants to run containerized microservices using Amazon ECS without provisioning or managing EC2 worker instances. Which compute option should it select?

Running microservices with AWS container services Medium
A. AWS Lambda layers
B. AWS Fargate
C. Amazon EKS managed node groups with manually maintained worker nodes and operating systems
D. Amazon EC2 Dedicated Hosts

34 An organization has existing Kubernetes manifests and requires Kubernetes APIs for its containerized microservices. Which AWS service is the best fit?

Running microservices with AWS container services Medium
A. Amazon Elastic Kubernetes Service
B. Amazon Elastic Container Registry
C. Amazon Elastic Container Service configured without Kubernetes compatibility
D. Amazon Simple Queue Service

35 Three ECS services must share one public endpoint. Requests to /orders, /users, and /catalog must be sent to different services. Which component should perform this routing?

Running microservices with AWS container services Medium
A. An Amazon ECR repository with image-tag rules
B. A Network Load Balancer with source-IP rules
C. An Amazon S3 bucket configured with a separate prefix for every container task
D. An Application Load Balancer with path-based rules

36 An order microservice must notify an inventory microservice, but inventory updates can occur asynchronously. Which design best reduces tight coupling between the services?

Running microservices with AWS container services Medium
A. Store inventory updates in the order container's memory
B. Call the inventory container by its current task IP
C. Publish inventory update messages to Amazon SQS
D. Deploy both microservices in one container so they always scale and fail together

37 Five Lambda functions currently share one IAM role with broad permissions. Which change best follows the security pillar of the AWS Well-Architected Framework?

Applying Well-Architected principles to serverless architectures Medium
A. Use one shared role and add every permission that any future function might require
B. Assign all functions the AdministratorAccess policy
C. Assign each function a least-privilege IAM role
D. Store long-term IAM user credentials in environment variables

38 An asynchronously invoked Lambda function occasionally fails after all configured retries. The application must retain failed events for later investigation and reprocessing. What should be configured?

Applying Well-Architected principles to serverless architectures Medium
A. A shorter CloudWatch Logs retention period
B. An on-failure destination or dead-letter queue
C. A higher API Gateway cache capacity that stores every failed asynchronous invocation
D. A larger Lambda deployment package

39 A request passes through API Gateway and several Lambda functions. Operators need to identify where latency occurs across the complete request path. Which approach provides the most useful observability?

Applying Well-Architected principles to serverless architectures Medium
A. Write all diagnostic data to local /tmp directories and retrieve it after execution
B. Inspect only the final function's CloudWatch log stream
C. Enable AWS X-Ray tracing and propagate correlation identifiers
D. Increase every function's timeout to the maximum

40 A Lambda function has been assigned 3,008 MB of memory, but monitoring shows low CPU use and short, simple executions. Which action best supports cost optimization without assuming that the smallest memory setting is ideal?

Applying Well-Architected principles to serverless architectures Medium
A. Move the function to a permanently running EC2 instance
B. Test multiple memory sizes and compare cost-duration results
C. Immediately set memory to the minimum supported value
D. Keep the current memory because Lambda pricing is based only on request count and not execution resources

41 An order service writes an order to DynamoDB and then publishes an OrderCreated event to EventBridge. A process failure between these operations sometimes leaves orders without events. Which design most reliably eliminates this dual-write inconsistency?

Serverless and architectural considerations Hard
A. Publish the event first, then write the order after EventBridge confirms that all targets accepted it
B. Retry both operations from the Lambda function until DynamoDB and EventBridge return successful responses
C. Write the order and an outbox item in one DynamoDB transaction, then relay outbox records through DynamoDB Streams
D. Place the DynamoDB write and EventBridge call in parallel branches of an AWS Step Functions workflow

42 A workload maintains thousands of long-lived bidirectional connections, performs steady CPU-intensive processing continuously, and has highly predictable 24-hour utilization. Which architecture is the strongest default choice?

Serverless and architectural considerations Hard
A. Run each connection in Lambda and renew the execution before the maximum duration is reached
B. Use API Gateway REST APIs with Lambda proxy integrations for every bidirectional connection
C. Invoke Lambda through EventBridge every minute and reconstruct all connection state from DynamoDB
D. Run the workload as long-running ECS services and scale tasks around sustained capacity requirements

43 A multi-tenant event processor has one high-volume tenant that can exhaust concurrency and delay events for premium tenants. Which redesign provides the strongest workload-level bulkhead isolation?

Serverless and architectural considerations Hard
A. Route tenant classes to separate queues and functions, then assign reserved concurrency to each function
B. Increase the shared function's memory and configure one account-wide concurrency alarm
C. Store tenant priorities in DynamoDB and let every invocation inspect them before processing
D. Place every tenant on one FIFO queue and use the tenant identifier as the message group ID

44 One domain event must be consumed independently by billing, analytics, and notification services. A failure or slowdown in analytics must not delay the other consumers. Which topology best satisfies this requirement?

Serverless and architectural considerations Hard
A. Store events in one DynamoDB item that each consumer updates after completing its work
B. Invoke the three services sequentially from a single Lambda function and retry the entire sequence
C. Publish to one SQS queue and let all three consumers compete for messages from that queue
D. Publish to an SNS topic with a separate SQS queue and dead-letter queue for each consumer

45 A Lambda event source mapping reads SQS messages in batches of 10. If one message fails, nine successful messages are repeatedly processed with the retried batch. Which change minimizes redundant work without assuming exactly-once delivery?

Building serverless applications with AWS Lambda Hard
A. Set the batch size to one, disable the dead-letter queue, and rely on SQS retention
B. Enable partial batch responses, return failed message identifiers, and keep message handling idempotent
C. Convert the queue to FIFO and use one message group for all messages in the workload
D. Delete successful messages directly from SQS before returning a failure from the invocation

46 A Lambda function consumes a Kinesis shard in order. One malformed record repeatedly fails its batch and prevents later records in the shard from being processed. Which configuration best limits the blockage while preserving recovery evidence?

Building serverless applications with AWS Lambda Hard
A. Increase the batch size, configure unlimited retries, and raise reserved concurrency for the function
B. Enable batch bisection, configure finite retry or record-age limits, and send discarded failures to a destination
C. Increase ParallelizationFactor and allow later batches to commit before every earlier batch succeeds
D. Disable stream retries and configure the Lambda function's asynchronous dead-letter queue

47 An AWS account has a Lambda regional concurrency quota of 1,000. Function A is assigned reserved concurrency of 400 but currently uses only 100. Function B has no reserved concurrency. Ignoring burst-rate limits and other functions, what is Function B's maximum concurrency?

Building serverless applications with AWS Lambda Hard
A. 600, because Function A's reserved allocation is removed from the shared unreserved pool
B. 900, because Function A currently consumes only 100 of the regional concurrency quota
C. 500, because Lambda always retains half of regional concurrency for unreserved functions
D. 1,000, because reserved concurrency limits Function A but does not reserve regional capacity

48 A team needs to shift 10% of production traffic to a new Lambda release and automatically return all traffic to the previous release when a CloudWatch alarm enters ALARM. Which deployment mechanism is most appropriate?

Building serverless applications with AWS Lambda Hard
A. Publish immutable versions, route through a weighted alias, and use CodeDeploy alarm-based rollback
B. Update the unpublished $LATEST version in place and configure Route 53 weighted records
C. Upload both packages to one function and select the package through an environment variable
D. Create two reserved-concurrency settings and let API Gateway alternate between function names

49 An API Gateway REST API caches GET /profile, whose response depends on the authenticated user. The method path and query string are identical for all users. Which configuration prevents one user's cached profile from being returned to another user while retaining caching?

Extending functionality using Amazon API Gateway Hard
A. Encrypt cached responses with the API Gateway stage key and share one cache entry among users
B. Use the stage name as the only cache key and create a deployment whenever a user signs in
C. Reduce the cache TTL and rely on token expiration to prevent cross-user cache responses
D. Add the validated Authorization header to the method's cache key and keep authorization enabled

50 An API operation starts a report that can require several minutes. Clients currently keep an API Gateway request open until a Lambda workflow finishes, causing integration timeouts and retries. Which API design is most resilient?

Extending functionality using Amazon API Gateway Hard
A. Increase client timeouts indefinitely and repeatedly invoke the synchronous API until one request succeeds
B. Return 200 OK immediately, continue processing in the same Lambda invocation, and omit job status
C. Stream periodic whitespace from Lambda through the REST integration until report generation completes
D. Return 202 Accepted with an operation ID, start work asynchronously, and expose a status endpoint

51 A Lambda proxy integration completes successfully but returns { "result": "ok" } directly. API Gateway responds to the client with 502 Bad Gateway. What is the most likely correction?

Extending functionality using Amazon API Gateway Hard
A. Base64-encode the entire Lambda invocation result and place it in a response header
B. Return a proxy response containing statusCode, optional headers, and a string-valued body
C. Return the same object after adding an API key and an IAM execution-role identifier
D. Configure API Gateway to interpret every successful Lambda invocation as an HTTP 200 response

52 An HTTP API exposes routes to OAuth 2.0 clients. Only tokens with the orders.write scope may call POST /orders, and the Lambda function must not be directly invocable by unrelated AWS resources. Which design best meets both requirements?

Extending functionality using Amazon API Gateway Hard
A. Use an API key with a usage plan and grant the Lambda function a broad service-principal permission
B. Use a JWT authorizer with route scopes and restrict Lambda invocation permission by API execution ARN
C. Use CORS allowed origins as authorization and restrict Lambda invocation by the client's source IP
D. Validate the token only inside Lambda and allow invocation from every API Gateway API in the account

53 ECS tasks on Fargate run in private subnets without public IP addresses. They must pull private ECR images and send logs to CloudWatch Logs without using a NAT gateway. Which endpoint set is required for this path?

Running microservices with AWS container services Hard
A. ECR API and ECR Docker interface endpoints, an S3 gateway endpoint, and a CloudWatch Logs interface endpoint
B. An ECS interface endpoint, a DynamoDB gateway endpoint, and an EventBridge interface endpoint
C. Only an ECR API interface endpoint, because ECR returns image layers and forwards logs automatically
D. Only an S3 gateway endpoint, because Fargate proxies all control-plane and logging traffic through S3

54 An ECS Fargate task has an application container reserving 512 CPU units and 1,024 MiB, plus a sidecar reserving 256 CPU units and 512 MiB. What is the smallest listed valid task size that can satisfy the combined reservations?

Running microservices with AWS container services Hard
A. 1 vCPU and 2 GiB
B. 2 vCPU and 4 GiB
C. 0.5 vCPU and 2 GiB
D. 1 vCPU and 1 GiB

55 An ECS worker service processes an SQS queue. Message arrival rates vary sharply, and processing time per message is approximately stable. CPU utilization remains low even when the queue is growing. Which scaling signal best reflects required capacity?

Running microservices with AWS container services Hard
A. A deployment policy based on the percentage of healthy targets registered with the load balancer
B. A scheduled policy that doubles desired count at the beginning of every hour regardless of backlog
C. A target-tracking metric based on visible queue messages divided by the number of running tasks
D. A target-tracking metric based only on the average CPU utilization of the ECS cluster instances

56 An ECS service uses Fargate and awsvpc networking with an Application Load Balancer. Tasks receive dynamically allocated private IP addresses. Which target group configuration is required?

Running microservices with AWS container services Hard
A. Use target type lambda and configure each task as a Lambda-compatible invocation target
B. Use target type instance and register the Fargate infrastructure hosts in the target group
C. Use target type alb and register the ECS service discovery namespace as the downstream load balancer
D. Use target type ip and allow ECS to register each task's elastic network interface address

57 Critical and best-effort Lambda workloads share an account. During traffic spikes, best-effort invocations consume all unreserved concurrency and throttle the critical function. Which Lambda control most directly creates a concurrency bulkhead?

Applying Well-Architected principles to serverless architectures Hard
A. Place both functions behind one alias and distribute traffic using equal alias weights
B. Enable provisioned concurrency only for the best-effort function during peak traffic periods
C. Increase the best-effort function's timeout and configure both functions with identical memory
D. Assign reserved concurrency to the critical function and cap the best-effort function's reserved allocation

58 A Lambda function uses 1 GiB and averages 900 ms per invocation. Testing shows that 2 GiB reduces average duration to 430 ms with the same request count and result. Ignoring free tier and architecture-specific price differences, which configuration has lower duration-based compute usage?

Applying Well-Architected principles to serverless architectures Hard
A. Neither configuration, because increasing Lambda memory always doubles total invocation cost
B. The 2-GiB configuration, because GB-s per invocation
C. The 1-GiB configuration, because GB-s per invocation
D. Both configurations, because Lambda charges only for invocation count and not allocated memory

59 A Lambda function needs a rotating database password. The password is currently stored in an encrypted environment variable, but rotations still require function configuration updates. Which design best follows the security pillar?

Applying Well-Architected principles to serverless architectures Hard
A. Store the password in a DynamoDB item readable by every function role in the AWS account
B. Store the password in an API Gateway stage variable and let Lambda read it from each request
C. Store the password in Secrets Manager, grant narrowly scoped access, and use rotation-aware local caching
D. Store the password in Lambda layer code and publish a new layer whenever the password rotates

60 A request travels through API Gateway, Lambda, SQS, another Lambda function, and an ECS service. Operators cannot connect failures in the final service to the initiating request. Which observability design best addresses this gap?

Applying Well-Architected principles to serverless architectures Hard
A. Propagate a correlation identifier through messages, emit structured logs, enable tracing, and publish service-level metrics
B. Use one CloudWatch alarm for total account errors and omit identifiers to reduce log storage costs
C. Increase log retention for every service but continue writing unrelated unstructured text messages
D. Record only API Gateway access logs because downstream services can reconstruct every internal transition