AWS Api GateWay & AWS Lambda Interview Questions Quiz

This easy quiz covers key concepts about Amazon API Gateway and AWS Lambda to test your understanding of their integration, endpoints, and security mechanisms.

  1. API Gateway Purpose

    What is the main use of Amazon API Gateway in an application architecture?

    1. To build and store databases
    2. To manage, secure, and monitor APIs at any scale
    3. To design mobile application interfaces
    4. To automate only backend machine learning pipelines

    Explanation: API Gateway is designed to handle creation, management, and monitoring of APIs. It is not used for building databases, automating machine learning pipelines, or designing mobile interfaces, which are handled by different AWS services.

  2. Lambda and API Gateway Integration

    How does AWS Lambda typically work with API Gateway?

    1. Lambda functions are triggered directly by HTTP requests via API Gateway
    2. API Gateway only stores Lambda logs
    3. API Gateway deploys Lambda code automatically
    4. Lambda functions manage API Gateway access policies

    Explanation: API Gateway forwards HTTP requests to Lambda functions, which then process them and return responses. API Gateway does not deploy Lambda code, store logs exclusively, or delegate access policy management to Lambda.

  3. API Gateway Endpoint Types

    Which endpoint type in API Gateway is best for internal applications within a VPC?

    1. Private
    2. Edge-optimized
    3. Public
    4. Regional

    Explanation: Private endpoints expose APIs only within a VPC, making them suitable for internal use. Edge-optimized and Regional are accessible from the internet, and 'Public' is not an official API Gateway endpoint type.

  4. API Gateway Security Options

    Which of the following is NOT a way API Gateway can secure APIs?

    1. Lambda Authorizers
    2. Cognito User Pools
    3. Building mobile push notifications
    4. IAM Permissions

    Explanation: Mobile push notifications are unrelated to API security. IAM Permissions, Cognito User Pools, and Lambda Authorizers are all supported methods for securing API Gateway endpoints.

  5. Edge-Optimized Endpoint Benefit

    What is a key benefit of an edge-optimized API Gateway endpoint?

    1. Support for offline requests
    2. Reduced latency through CloudFront's global edge locations
    3. Auto-scaling the backend database
    4. Exposing APIs only to private cloud

    Explanation: Edge-optimized endpoints use CloudFront to reduce latency worldwide. They are not for offline use, private cloud exclusivity, or database scaling.

  6. API Gateway Monitoring

    Which AWS service can API Gateway use to monitor and log API usage?

    1. S3
    2. DynamoDB
    3. CloudWatch
    4. SNS

    Explanation: CloudWatch is used for API logging and monitoring. S3 is a storage service, DynamoDB is for databases, and SNS is for messaging.

  7. API Gateway Request Handling

    What does API Gateway do when a user makes an HTTP request to an endpoint integrated with Lambda?

    1. Redirects the user to CloudFront directly
    2. Blocks the request automatically
    3. Stores the request as an S3 object
    4. Forwards the request to a designated Lambda function

    Explanation: API Gateway acts as a front door by forwarding incoming HTTP requests to Lambda. It does not store requests in S3, redirect users to CloudFront only, or block requests unless configured to do so.

  8. API Gateway Throttling

    Why would you use throttling and rate-limiting features in API Gateway?

    1. To increase Lambda execution speed
    2. To prevent abuse from excessive API requests
    3. To back up your database automatically
    4. To design user interface themes

    Explanation: Throttling and rate-limiting help control API traffic and prevent overload or abuse. They do not back up data, speed up Lambda, or assist with UI design.

  9. API Gateway with Cognito

    When would you use Cognito User Pools with API Gateway?

    1. For optimizing database queries
    2. For sending emails to users
    3. When authenticating users for API access
    4. To manage Lambda function memory

    Explanation: Cognito User Pools are designed for user authentication with APIs. They do not optimize databases, handle emails, or manage Lambda memory.

  10. Regional Endpoint Usage

    When is the Regional endpoint type in API Gateway most beneficial?

    1. For file system permissions management
    2. To enable access from all global locations automatically
    3. For enforcing endpoint encryption only
    4. For clients in the same AWS region as the API

    Explanation: Regional endpoints reduce cost and latency for clients in the same region. Global access is better handled by edge-optimized endpoints, and the other options do not describe endpoint type benefits.