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. Developers manage physical servers directly
B. Cloud providers manage the underlying servers
C. Applications run without any computing resources
D. Users purchase dedicated hardware for each application

2 Which is a common benefit of a serverless architecture?

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

3 Why should serverless functions generally be designed as stateless?

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

4 Which architectural style is commonly associated with serverless applications?

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

5 What is AWS Lambda primarily used for?

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

6 What is the purpose of a Lambda function handler?

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

7 Which event can directly trigger an AWS Lambda function?

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

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

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

9 What is the main purpose of Amazon API Gateway?

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

10 How can Amazon API Gateway work with AWS Lambda?

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

11 Which AWS service can help authenticate API Gateway users?

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

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

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

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

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

14 Which AWS service provides managed Kubernetes clusters?

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

15 What does AWS Fargate allow developers to do?

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

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 can be deployed independently
C. It requires dedicated hardware
D. It combines every business function

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

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

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 AppStream 2.0
C. Amazon CloudWatch
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 idle capacity
C. Paying for actual usage
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. Ignoring all failed events
C. Using retries and dead-letter queues
D. Sending every event to one permanently running desktop computer

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 AWS Lambda functions triggered by Amazon S3 events
B. Run a dedicated EC2 instance for each uploaded image
C. Run containers continuously on self-managed EC2 instances
D. Run a fixed-size Amazon EC2 Auto Scaling group

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 a larger Lambda deployment package that is updated after every request
B. In the function's global variables
C. In the function's temporary /tmp directory
D. In an external service such as Amazon DynamoDB

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. Store the deployment package in Amazon EFS
B. Increase the API Gateway integration timeout
C. Increase reserved concurrency to a very high value so that every possible request receives a permanently active environment
D. Enable provisioned concurrency for the function

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. Store pending orders only in Lambda environment variables
B. Call the payment service synchronously from the API
C. Retry the payment call continuously within the original API request
D. Place orders in Amazon SQS and process them asynchronously

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 API Gateway route for every uploaded object
B. Configure an S3 object-created event to invoke the function
C. Configure Lambda to poll the S3 bucket every minute
D. Configure an EC2 scheduled task to scan S3 and submit each image to Lambda

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. Reduce the SQS message retention period
B. Use an idempotency key for each payment operation
C. Delete every message before the function begins processing it
D. Increase the Lambda function's memory allocation

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. Configure provisioned concurrency above 500 so all requests immediately obtain database connections
B. Set the function timeout to 50 seconds
C. Set the function's reserved concurrency to 50
D. Increase the function's ephemeral storage to 50 GB

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 Route 53
C. Amazon Elastic Container Registry
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 Amazon S3 event notification integrated with Lambda
B. An Amazon EventBridge scheduled rule integrated with Lambda
C. An Amazon CloudFront distribution that invokes the function without an HTTP API origin
D. An API Gateway route integrated with Lambda

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 JWT authorizer
C. A request mapping template
D. A stage variable

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. Configure stage-level throttling
B. Increase the integration timeout for every method
C. Add a custom domain name
D. Enable binary media support

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. A usage plan that stores both field names and synchronizes them with the legacy database
B. An integration request mapping template
C. An API Gateway edge-optimized endpoint
D. A Lambda reserved concurrency setting

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. Amazon EC2 Dedicated Hosts
B. AWS Fargate
C. AWS Lambda layers
D. Amazon EKS managed node groups with manually maintained worker nodes and operating systems

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 Container Service configured without Kubernetes compatibility
B. Amazon Elastic Container Registry
C. Amazon Simple Queue Service
D. Amazon Elastic Kubernetes 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 Application Load Balancer with path-based rules
B. A Network Load Balancer with source-IP rules
C. An Amazon ECR repository with image-tag rules
D. An Amazon S3 bucket configured with a separate prefix for every container task

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. Deploy both microservices in one container so they always scale and fail together
B. Call the inventory container by its current task IP
C. Publish inventory update messages to Amazon SQS
D. Store inventory updates in the order container's memory

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. Store long-term IAM user credentials in environment variables
B. Use one shared role and add every permission that any future function might require
C. Assign all functions the AdministratorAccess policy
D. Assign each function a least-privilege IAM role

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. A larger Lambda deployment package
C. A higher API Gateway cache capacity that stores every failed asynchronous invocation
D. An on-failure destination or dead-letter queue

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. Increase every function's timeout to the maximum
B. Write all diagnostic data to local /tmp directories and retrieve it after execution
C. Enable AWS X-Ray tracing and propagate correlation identifiers
D. Inspect only the final function's CloudWatch log stream

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. Test multiple memory sizes and compare cost-duration results
B. Immediately set memory to the minimum supported value
C. Move the function to a permanently running EC2 instance
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. Retry both operations from the Lambda function until DynamoDB and EventBridge return successful responses
B. Publish the event first, then write the order after EventBridge confirms that all targets accepted it
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. Invoke Lambda through EventBridge every minute and reconstruct all connection state from DynamoDB
B. Run each connection in Lambda and renew the execution before the maximum duration is reached
C. Run the workload as long-running ECS services and scale tasks around sustained capacity requirements
D. Use API Gateway REST APIs with Lambda proxy integrations for every bidirectional connection

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

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

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. Enable partial batch responses, return failed message identifiers, and keep message handling idempotent
B. Convert the queue to FIFO and use one message group for all messages in the workload
C. Delete successful messages directly from SQS before returning a failure from the invocation
D. Set the batch size to one, disable the dead-letter queue, and rely on SQS retention

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. Enable batch bisection, configure finite retry or record-age limits, and send discarded failures to a destination
B. Increase the batch size, configure unlimited retries, and raise reserved concurrency for the function
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. 500, because Lambda always retains half of regional concurrency for unreserved functions
B. 1,000, because reserved concurrency limits Function A but does not reserve regional capacity
C. 600, because Function A's reserved allocation is removed from the shared unreserved pool
D. 900, because Function A currently consumes only 100 of the regional concurrency quota

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. Create two reserved-concurrency settings and let API Gateway alternate between function names
B. Publish immutable versions, route through a weighted alias, and use CodeDeploy alarm-based rollback
C. Update the unpublished $LATEST version in place and configure Route 53 weighted records
D. Upload both packages to one function and select the package through an environment variable

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. Reduce the cache TTL and rely on token expiration to prevent cross-user cache responses
B. Add the validated Authorization header to the method's cache key and keep authorization enabled
C. Use the stage name as the only cache key and create a deployment whenever a user signs in
D. Encrypt cached responses with the API Gateway stage key and share one cache entry among users

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. Stream periodic whitespace from Lambda through the REST integration until report generation completes
B. Increase client timeouts indefinitely and repeatedly invoke the synchronous API until one request succeeds
C. Return 202 Accepted with an operation ID, start work asynchronously, and expose a status endpoint
D. Return 200 OK immediately, continue processing in the same Lambda invocation, and omit job status

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. Return the same object after adding an API key and an IAM execution-role identifier
B. Base64-encode the entire Lambda invocation result and place it in a response header
C. Configure API Gateway to interpret every successful Lambda invocation as an HTTP 200 response
D. Return a proxy response containing statusCode, optional headers, and a string-valued body

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. Validate the token only inside Lambda and allow invocation from every API Gateway API in the account
C. Use a JWT authorizer with route scopes and restrict Lambda invocation permission by API execution ARN
D. Use CORS allowed origins as authorization and restrict Lambda invocation by the client's source IP

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. An ECS interface endpoint, a DynamoDB gateway endpoint, and an EventBridge interface endpoint
B. ECR API and ECR Docker interface endpoints, an S3 gateway endpoint, and a CloudWatch Logs 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. 0.5 vCPU and 2 GiB
B. 1 vCPU and 1 GiB
C. 2 vCPU and 4 GiB
D. 1 vCPU and 2 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 target-tracking metric based on visible queue messages divided by the number of running tasks
B. A scheduled policy that doubles desired count at the beginning of every hour regardless of backlog
C. A target-tracking metric based only on the average CPU utilization of the ECS cluster instances
D. A deployment policy based on the percentage of healthy targets registered with the load balancer

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 alb and register the ECS service discovery namespace as the downstream load balancer
B. Use target type instance and register the Fargate infrastructure hosts in the target group
C. Use target type ip and allow ECS to register each task's elastic network interface address
D. Use target type lambda and configure each task as a Lambda-compatible invocation target

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. Increase the best-effort function's timeout and configure both functions with identical memory
B. Assign reserved concurrency to the critical function and cap the best-effort function's reserved allocation
C. Place both functions behind one alias and distribute traffic using equal alias weights
D. Enable provisioned concurrency only for the best-effort function during peak traffic periods

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. Both configurations, because Lambda charges only for invocation count and not allocated memory
B. The 1-GiB configuration, because GB-s per invocation
C. Neither configuration, because increasing Lambda memory always doubles total invocation cost
D. The 2-GiB configuration, because GB-s per invocation

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 Secrets Manager, grant narrowly scoped access, and use rotation-aware local caching
B. Store the password in a DynamoDB item readable by every function role in the AWS account
C. Store the password in Lambda layer code and publish a new layer whenever the password rotates
D. Store the password in an API Gateway stage variable and let Lambda read it from each request

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. Use one CloudWatch alarm for total account errors and omit identifiers to reduce log storage costs
B. Record only API Gateway access logs because downstream services can reconstruct every internal transition
C. Increase log retention for every service but continue writing unrelated unstructured text messages
D. Propagate a correlation identifier through messages, emit structured logs, enable tracing, and publish service-level metrics