0
0
AWScloud~20 mins

Resources and methods in AWS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
API Gateway Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
API Gateway Resource and Method Behavior

You create an API Gateway REST API with a resource path /items and add a GET method integrated with a Lambda function. What happens when a client sends a POST request to /items?

AThe API Gateway returns a 405 Method Not Allowed error because POST method is not defined on the resource.
BThe API Gateway forwards the POST request to the Lambda function configured for GET method.
CThe API Gateway automatically creates a POST method and returns a 200 OK response.
DThe API Gateway returns a 404 Not Found error because POST method is not supported.
Attempts:
2 left
💡 Hint

Think about how API Gateway handles HTTP methods that are not explicitly configured on a resource.

Architecture
intermediate
2:00remaining
Designing Resources and Methods for Versioning

You want to design an API Gateway REST API that supports two versions: v1 and v2. Which resource structure best supports this versioning?

AUse a single resource <code>/api</code> and add a query parameter <code>version</code> to distinguish versions.
BCreate two top-level resources: <code>/v1</code> and <code>/v2</code>, each with their own methods and integrations.
CCreate one resource <code>/</code> and use different HTTP headers to specify the version.
DCreate separate APIs for v1 and v2 instead of using resources.
Attempts:
2 left
💡 Hint

Consider how resource paths can represent different API versions clearly.

security
advanced
2:00remaining
Securing Methods with IAM Authorization

You configure a POST method on a resource in API Gateway and set the authorization type to IAM. What must a client do to successfully invoke this method?

ASign the request with AWS credentials using Signature Version 4 signing process.
BInclude an API key in the request header.
CSend the request without any authentication; IAM authorization is automatic.
DProvide a valid OAuth 2.0 token in the Authorization header.
Attempts:
2 left
💡 Hint

Think about how IAM authorization works with API Gateway methods.

Configuration
advanced
2:00remaining
Configuring a Mock Integration Method

You want to create a GET method on a resource that returns a fixed JSON response without calling any backend. Which integration type should you configure?

ASet the integration type to HTTP and point to a dummy URL that returns the JSON.
BSet the integration type to AWS Service and call a service that returns the JSON.
CSet the integration type to MOCK and configure a method response with a static mapping template.
DSet the integration type to AWS Lambda and use a Lambda function that returns the JSON.
Attempts:
2 left
💡 Hint

Consider how to return a response directly from API Gateway without backend calls.

Best Practice
expert
2:00remaining
Optimizing API Gateway Resource and Method Structure for Caching

You want to enable caching for a GET method on a resource but only cache responses when the query parameter type is present. How should you configure caching keys?

AEnable caching on the method without specifying cache key parameters; all requests are cached.
BCaching cannot be configured based on query parameters in API Gateway.
CEnable caching and include all query string parameters as cache keys.
DEnable caching on the method and configure the cache key parameters to include <code>method.request.querystring.type</code> only.
Attempts:
2 left
💡 Hint

Think about how API Gateway cache keys can be customized to include specific request parameters.