Split View: AWS Developer Associate (DVA-C02) 실전 모의고사 65문제
AWS Developer Associate (DVA-C02) 실전 모의고사 65문제
시험 개요
| 항목 | 내용 |
|---|---|
| 시험 코드 | DVA-C02 |
| 시험 시간 | 130분 |
| 문제 수 | 65문제 |
| 합격 기준 | 720점 / 1000점 |
| 시험 형태 | 단일 선택, 복수 선택 |
도메인별 출제 비율
| 도메인 | 비율 |
|---|---|
| Domain 1: AWS 서비스를 활용한 개발 | 32% |
| Domain 2: 보안 | 26% |
| Domain 3: 배포 | 24% |
| Domain 4: 문제 해결 및 최적화 | 18% |
핵심 개발자 서비스 요약
Lambda 핵심 포인트
- 호출 유형: Synchronous(RequestResponse), Asynchronous(Event), Poll-based
- 동시성: Reserved Concurrency(최대 제한), Provisioned Concurrency(콜드 스타트 방지)
- 콜드 스타트: VPC Lambda에서 더 오래 걸림, Provisioned Concurrency로 해결
- 레이어: 공통 라이브러리 공유, 최대 5개 레이어
DynamoDB 핵심 포인트
- 파티션 키: 높은 카디널리티 선택, 핫 파티션 방지
- GSI: 다른 파티션 키/정렬 키로 쿼리, Eventually Consistent Read만 지원
- LSI: 같은 파티션 키, 다른 정렬 키, 테이블 생성 시에만 추가 가능
- DAX: 마이크로초 단위 응답, Eventually Consistent Read만 캐싱
API Gateway 핵심 포인트
- REST API: 완전한 기능, WAF 지원, 캐싱 지원
- HTTP API: 저비용, OIDC/JWT 인증, Lambda Proxy만 지원
- WebSocket API: 양방향 실시간 통신
Kinesis 핵심 포인트
- 샤드 계산: 쓰기 = max(입력 MB/s, 레코드 수/1000) / 샤드당 1MB/s 또는 1000 레코드/s
- Enhanced Fan-out: 샤드당 2MB/s 읽기, 푸시 방식
- Data Firehose: 자동 스케일링, S3/Redshift/Elasticsearch로 직접 전송
실전 연습 문제 65문제
Domain 1: AWS 서비스를 활용한 개발
Q1. Lambda 함수가 VPC 내부에 배포되어 있습니다. 함수 실행 시 콜드 스타트가 매우 길게 발생합니다. 이를 해결하기 위한 가장 적절한 방법은?
A) Lambda 함수의 메모리를 늘린다 B) Provisioned Concurrency를 설정한다 C) Lambda 레이어를 사용한다 D) 환경 변수를 줄인다
정답: B
설명: VPC 내 Lambda는 ENI(Elastic Network Interface) 생성으로 인해 콜드 스타트가 더 길게 발생합니다. Provisioned Concurrency를 설정하면 미리 초기화된 실행 환경을 유지하여 콜드 스타트를 제거할 수 있습니다. 메모리 증가는 실행 속도를 높이지만 콜드 스타트 자체를 제거하지는 않습니다.
Q2. DynamoDB 테이블에서 특정 사용자의 주문 내역을 최근 날짜 순으로 조회해야 합니다. 테이블의 파티션 키는 userId이고 정렬 키는 orderId입니다. 날짜 기반 정렬을 효율적으로 지원하려면?
A) 새 GSI를 userId(파티션 키)와 orderDate(정렬 키)로 생성한다 B) LSI를 userId(파티션 키)와 orderDate(정렬 키)로 추가한다 C) Scan 작업으로 모든 항목을 가져와 애플리케이션에서 정렬한다 D) DynamoDB Streams를 활성화한다
정답: A
설명: LSI는 테이블 생성 시에만 추가할 수 있으므로 기존 테이블에는 GSI를 사용해야 합니다. userId를 파티션 키로, orderDate를 정렬 키로 하는 GSI를 생성하면 특정 사용자의 주문을 날짜 순으로 효율적으로 조회할 수 있습니다. Scan은 비효율적이며 대규모 데이터에서 비용이 큽니다.
Q3. 다음 Python 코드로 SQS 메시지를 처리하는 Lambda 함수는 어떤 호출 유형을 사용합니까?
def handler(event, context):
for record in event['Records']:
body = record['body']
process_message(body)
return {'statusCode': 200}
A) Synchronous(동기) 호출 B) Asynchronous(비동기) 호출 C) Poll-based 호출 D) Stream 기반 호출
정답: C
설명: SQS 트리거를 사용하는 Lambda는 Poll-based(이벤트 소스 매핑) 호출 방식입니다. Lambda 서비스가 SQS 큐를 폴링하여 메시지를 가져오고 Lambda 함수를 호출합니다. event['Records']에 여러 메시지가 배치로 전달됩니다. Kinesis, DynamoDB Streams도 동일한 Poll-based 방식입니다.
Q4. API Gateway REST API에서 특정 엔드포인트의 응답을 캐싱하고 싶습니다. 클라이언트가 캐시를 무시하고 항상 신선한 데이터를 받으려면 어떻게 해야 합니까?
A) Cache-Control: no-cache 헤더를 요청에 포함한다 B) X-Amz-Cache-Control: invalidate 헤더를 사용한다 C) API Gateway 스테이지에서 캐시를 비활성화한다 D) Lambda 함수에서 캐시 무효화 API를 호출한다
정답: A
설명: API Gateway 캐싱이 활성화된 경우, 클라이언트는 HTTP 요청에 Cache-Control: no-cache 헤더를 포함하여 캐시를 우회할 수 있습니다. 단, 이 기능을 허용하려면 API Gateway 설정에서 "Require authorization to invalidate cache" 옵션을 적절히 구성해야 합니다. 스테이지 캐시를 비활성화하면 모든 요청에 영향을 미칩니다.
Q5. Kinesis Data Streams에서 초당 5,000개의 레코드를 처리해야 하고, 각 레코드의 평균 크기는 2KB입니다. 필요한 최소 샤드 수는?
A) 5 B) 8 C) 10 D) 15
정답: C
설명: 샤드당 용량: 초당 1,000 레코드 또는 1MB/s(쓰기 기준).
레코드 수 기준: 5,000 / 1,000 = 5 샤드 데이터 크기 기준: (5,000 × 2KB) / 1,024KB = 약 9.77MB/s → 10 샤드
더 큰 값인 10샤드가 필요합니다. 두 제약 중 더 큰 값을 선택해야 합니다.
Q6. SQS FIFO 큐를 사용하는 애플리케이션에서 동일한 메시지가 중복으로 처리되는 것을 방지하려면?
A) VisibilityTimeout을 늘린다 B) MessageDeduplicationId를 설정한다 C) MessageGroupId를 고유하게 설정한다 D) Dead-letter 큐를 구성한다
정답: B
설명: SQS FIFO 큐는 MessageDeduplicationId를 사용하여 5분 내에 동일한 ID로 전송된 메시지를 중복 제거합니다. ContentBasedDeduplication을 활성화하면 메시지 본문의 SHA-256 해시를 자동으로 사용합니다. MessageGroupId는 순서 보장을 위한 것이고, VisibilityTimeout은 메시지 재처리 방지와 관련됩니다.
Q7. S3 버킷의 대용량 파일(5GB)을 안정적으로 업로드하는 최선의 방법은?
A) 단일 PUT 요청으로 업로드한다 B) Multipart Upload API를 사용한다 C) S3 Transfer Acceleration을 사용한다 D) Pre-signed URL을 생성한다
정답: B
설명: S3 단일 PUT 요청은 최대 5GB까지 지원하지만, 100MB 이상 파일에는 Multipart Upload를 권장합니다. Multipart Upload는 파일을 여러 부분으로 나누어 병렬 업로드하고, 실패 시 해당 부분만 재시도할 수 있습니다. S3 Transfer Acceleration은 Edge Location을 통해 속도를 높이지만 대용량 업로드 안정성과는 별개입니다.
Q8. DynamoDB DAX(DynamoDB Accelerator)가 캐싱을 지원하지 않는 읽기 작업은?
A) GetItem B) Query C) Scan D) TransactGetItems
정답: D
설명: DAX는 eventually consistent read(GetItem, Query, Scan)를 캐싱합니다. TransactGetItems는 strongly consistent read를 사용하는 트랜잭션 작업으로, DAX가 캐싱하지 않고 DynamoDB에 직접 전달합니다. 또한 strongly consistent read(ConsistentRead=True)도 DAX 캐시를 우회합니다.
Q9. Lambda 함수에서 데이터베이스 연결을 핸들러 함수 밖에 초기화하는 이유는?
A) 보안을 강화하기 위해 B) 실행 컨텍스트 재사용으로 성능을 최적화하기 위해 C) 메모리 사용량을 줄이기 위해 D) 타임아웃을 방지하기 위해
정답: B
설명: Lambda의 실행 환경은 재사용될 수 있습니다(warm start). 핸들러 외부에 초기화된 코드(데이터베이스 연결, SDK 클라이언트 등)는 컨테이너가 재사용될 때 다시 실행되지 않아 성능이 향상됩니다. 이를 실행 컨텍스트 재사용(Execution Context Reuse)이라고 합니다.
Q10. API Gateway WebSocket API와 REST API의 차이점으로 올바른 것은?
A) WebSocket API는 서버리스를 지원하지 않는다 B) WebSocket API는 클라이언트와 서버 간 양방향 통신을 지원한다 C) REST API는 실시간 알림에 더 적합하다 D) WebSocket API는 캐싱을 지원한다
정답: B
설명: WebSocket API는 클라이언트와 서버 간 지속적인 연결을 유지하여 양방향 실시간 통신을 지원합니다. 채팅 애플리케이션, 실시간 대시보드, 게임 등에 적합합니다. REST API는 요청-응답 패턴으로 단방향입니다. WebSocket API도 Lambda 함수를 백엔드로 사용할 수 있습니다.
Q11. 다음 DynamoDB 조건에서 GSI와 LSI의 차이로 올바른 것은?
A) GSI는 테이블 생성 후 추가 불가, LSI는 추가 가능 B) LSI는 테이블 생성 시에만 추가 가능, GSI는 나중에 추가 가능 C) GSI는 동일한 파티션 키를 사용해야 한다 D) LSI는 전체 테이블 크기가 10GB로 제한된다
정답: B
설명: LSI(Local Secondary Index)는 테이블 생성 시에만 정의할 수 있으며, 나중에 추가하거나 삭제할 수 없습니다. GSI(Global Secondary Index)는 테이블 생성 후 언제든지 추가하거나 삭제할 수 있습니다. LSI는 기본 테이블과 동일한 파티션 키를 사용하지만 다른 정렬 키를 사용합니다.
Q12. S3 Pre-signed URL의 주요 사용 사례로 가장 적합한 것은?
A) S3 버킷을 퍼블릭으로 공개하는 것 B) 인증 없이 일시적으로 특정 S3 객체 접근을 허용하는 것 C) S3 버킷 정책을 우회하는 것 D) S3 객체를 자동으로 암호화하는 것
정답: B
설명: Pre-signed URL은 서명된 URL로 특정 S3 객체에 일정 시간 동안 인증 없이 접근할 수 있게 합니다. 파일 다운로드 링크를 일시적으로 공유하거나, 클라이언트가 직접 S3에 파일을 업로드(PUT)할 수 있게 할 때 사용합니다. 버킷을 퍼블릭으로 공개하지 않아도 됩니다.
Q13. SQS 메시지의 VisibilityTimeout 값을 너무 짧게 설정하면 어떤 문제가 발생합니까?
A) 메시지가 Dead-letter 큐로 이동한다 B) 동일한 메시지가 여러 소비자에게 전달될 수 있다 C) 메시지가 영구적으로 삭제된다 D) 큐의 용량이 초과된다
정답: B
설명: VisibilityTimeout은 메시지가 소비자에게 전달된 후 다른 소비자에게 보이지 않는 시간입니다. 너무 짧게 설정하면 첫 번째 소비자가 처리를 완료하기 전에 타임아웃이 만료되어 동일한 메시지가 다른 소비자에게도 전달될 수 있습니다. 이는 중복 처리를 유발합니다. 일반적으로 함수 처리 시간보다 충분히 길게 설정해야 합니다.
Q14. Lambda 함수에서 Reserved Concurrency를 0으로 설정하면 어떻게 됩니까?
A) 무제한 동시성을 허용한다 B) 함수 호출이 완전히 차단된다 C) 콜드 스타트가 방지된다 D) 자동 스케일링이 활성화된다
정답: B
설명: Reserved Concurrency를 0으로 설정하면 해당 Lambda 함수는 완전히 호출이 차단되어 Throttling 오류가 발생합니다. 이는 함수를 일시적으로 비활성화하거나 다른 함수를 위한 동시성을 보존하는 데 사용할 수 있습니다. 함수를 활성화하려면 Reserved Concurrency를 삭제하거나 0보다 큰 값으로 설정해야 합니다.
Q15. Kinesis Data Firehose가 Kinesis Data Streams와 다른 주요 특징은?
A) Firehose는 수동 샤드 관리가 필요하다 B) Firehose는 자동으로 스케일링되고 데이터를 목적지로 직접 전달한다 C) Firehose는 실시간 처리에 더 적합하다 D) Firehose는 소비자 애플리케이션이 필요하다
정답: B
설명: Kinesis Data Firehose는 완전 관리형 서비스로 자동 스케일링을 지원합니다. S3, Redshift, OpenSearch Service, Splunk로 데이터를 자동으로 전달합니다. Data Streams는 샤드를 수동으로 관리해야 하고 소비자 애플리케이션이 필요합니다. Firehose는 버퍼링(최소 60초 또는 1MB)으로 인해 실시간보다는 근실시간입니다.
Domain 2: 보안
Q16. Cognito User Pool과 Identity Pool의 차이로 올바른 것은?
A) User Pool은 AWS 서비스 접근 권한을 제공하고, Identity Pool은 사용자 인증을 담당한다 B) User Pool은 사용자 인증 및 사용자 디렉토리를 제공하고, Identity Pool은 AWS 자격 증명을 제공한다 C) Identity Pool은 소셜 로그인을 지원하지 않는다 D) User Pool과 Identity Pool은 동일한 기능을 한다
정답: B
설명: Cognito User Pool은 사용자 등록, 로그인, MFA 등 사용자 인증 기능과 사용자 디렉토리를 제공하며 JWT 토큰(ID Token, Access Token, Refresh Token)을 발급합니다. Identity Pool은 인증된 사용자(User Pool, Google, Facebook 등)에게 임시 AWS 자격 증명(IAM Role)을 제공하여 AWS 서비스에 직접 접근할 수 있게 합니다.
Q17. KMS 봉투 암호화(Envelope Encryption)에서 데이터 키(Data Key)는 어떻게 사용됩니까?
A) 데이터 키는 KMS에 저장되고 CMK로 암호화된다 B) 데이터 키로 실제 데이터를 암호화하고, 데이터 키는 CMK로 암호화되어 저장된다 C) CMK가 데이터를 직접 암호화한다 D) 데이터 키는 항상 평문으로 저장된다
정답: B
설명: 봉투 암호화에서는 (1) KMS가 데이터 키(DEK)를 생성하고, (2) 데이터 키로 실제 데이터를 암호화합니다, (3) 데이터 키 자체는 CMK(Customer Master Key)로 암호화됩니다. 암호화된 데이터 키는 암호화된 데이터와 함께 저장됩니다. CMK는 KMS 외부로 절대 나가지 않습니다. 이 방식으로 대용량 데이터를 효율적으로 암호화할 수 있습니다.
Q18. IAM에서 리소스 기반 정책(Resource-based Policy)과 자격 증명 기반 정책(Identity-based Policy)의 차이는?
A) 리소스 기반 정책은 EC2에만 연결할 수 있다 B) 자격 증명 기반 정책은 Principal을 지정하고, 리소스 기반 정책은 IAM 엔티티에 연결된다 C) 리소스 기반 정책은 Principal을 지정하고, 자격 증명 기반 정책은 IAM 엔티티에 연결된다 D) 두 정책 유형은 동일하다
정답: C
설명: 리소스 기반 정책(S3 버킷 정책, Lambda 리소스 정책 등)은 리소스에 직접 연결되며 Principal(누가 접근할 수 있는지)을 명시합니다. 자격 증명 기반 정책(IAM User/Role/Group 정책)은 IAM 엔티티에 연결되며 Principal 없이 무엇을 할 수 있는지를 정의합니다. 크로스 계정 접근에는 리소스 기반 정책 또는 STS AssumeRole이 필요합니다.
Q19. AWS Secrets Manager와 SSM Parameter Store의 차이로 올바른 것은?
A) Parameter Store는 자동 교체를 지원하지만 Secrets Manager는 지원하지 않는다 B) Secrets Manager는 비밀 자동 교체 및 교차 계정 공유를 지원하고 추가 비용이 있다 C) 둘 다 동일한 기능을 제공한다 D) Parameter Store는 암호화를 지원하지 않는다
정답: B
설명: Secrets Manager는 데이터베이스 비밀번호 등의 자동 교체, 교차 계정 접근, 비밀 복제를 지원하며 비밀당 월 요금이 발생합니다. Parameter Store는 무료(Standard) 또는 저비용(Advanced) 티어로 운영되며, 자동 교체 기능이 없습니다(Lambda로 커스텀 구현 가능). 데이터베이스 자격증명처럼 자동 교체가 중요한 경우 Secrets Manager를 사용합니다.
Q20. STS AssumeRole을 사용할 때 ExternalId의 역할은?
A) 역할의 최대 세션 시간을 설정한다 B) 혼동된 대리인(Confused Deputy) 공격을 방지한다 C) MFA 인증을 활성화한다 D) 교차 리전 접근을 허용한다
정답: B
설명: ExternalId는 혼동된 대리인(Confused Deputy) 문제를 방지합니다. 제3자 서비스가 고객 A의 역할을 수임할 때, 악의적인 고객 B가 고객 A의 ARN을 사용하여 자신의 환경에서 고객 A의 데이터에 접근하는 것을 막습니다. ExternalId는 신뢰 정책에 조건으로 설정되어, 올바른 ExternalId 없이는 역할을 수임할 수 없게 합니다.
Q21. Lambda 함수에서 환경 변수를 암호화할 때 권장하는 방법은?
A) 환경 변수를 Base64로 인코딩한다 B) KMS CMK를 사용하여 환경 변수를 암호화하고 런타임에 복호화한다 C) 환경 변수를 코드에 직접 하드코딩한다 D) S3에 저장하고 런타임에 읽어온다
정답: B
설명: Lambda 환경 변수는 기본적으로 AWS 관리형 키로 암호화됩니다. 더 강력한 보안을 위해 고객 관리형 CMK를 사용할 수 있습니다. 민감한 정보(API 키, 비밀번호)는 KMS로 암호화하고 런타임에 SDK로 복호화하거나, Secrets Manager/Parameter Store에서 런타임에 동적으로 가져오는 것이 권장됩니다.
Q22. Cognito에서 JWT ID Token에 포함된 클레임으로 올바른 것은?
A) AWS IAM 정책 B) 사용자 이름, 이메일, 사용자 그룹 정보 C) AWS 임시 자격 증명 D) S3 버킷 접근 권한
정답: B
설명: Cognito User Pool의 ID Token(JWT)에는 사용자 이름(sub), 이메일, 전화번호, Cognito 사용자 그룹(cognito:groups), 커스텀 속성 등의 클레임이 포함됩니다. Access Token은 API 접근을 위한 OAuth 2.0 스코프를 포함합니다. AWS 임시 자격 증명은 Identity Pool에서 ID Token을 교환하여 얻습니다.
Q23. S3 서버 측 암호화(SSE) 옵션 중 고객이 직접 암호화 키를 제공하는 방식은?
A) SSE-S3 B) SSE-KMS C) SSE-C D) CSE(클라이언트 측 암호화)
정답: C
설명: SSE-C(Server-Side Encryption with Customer-Provided Keys)는 고객이 HTTPS 요청에 암호화 키를 직접 제공합니다. AWS는 키를 저장하지 않고 암호화/복호화에만 사용합니다. SSE-S3는 AWS 관리 키, SSE-KMS는 KMS 관리 키를 사용합니다. CSE는 업로드 전에 클라이언트 측에서 암호화합니다.
Q24. API Gateway에서 Lambda 권한 부여자(Lambda Authorizer)의 두 가지 유형은?
A) Header 권한 부여자, Body 권한 부여자 B) TOKEN 권한 부여자, REQUEST 권한 부여자 C) JWT 권한 부여자, API Key 권한 부여자 D) IAM 권한 부여자, Cognito 권한 부여자
정답: B
설명: Lambda 권한 부여자는 두 가지 유형입니다. TOKEN 유형은 Bearer 토큰(JWT, OAuth)을 Authorization 헤더에서 추출하여 검증합니다. REQUEST 유형은 요청 헤더, 쿼리 파라미터, 스테이지 변수 등 전체 요청 컨텍스트를 사용하여 인증을 수행합니다. 두 유형 모두 IAM 정책을 반환합니다.
Q25. KMS 데이터 키 캐싱(Data Key Caching)을 사용하는 이유는?
A) KMS API 호출 횟수와 비용을 줄이기 위해 B) 암호화 강도를 높이기 위해 C) 키 자동 교체를 활성화하기 위해 D) CMK를 생성하기 위해
정답: A
설명: 매 암호화 작업마다 KMS에 새 데이터 키를 요청하면 API 호출이 많아져 비용이 증가하고 지연 시간이 늘어납니다. 데이터 키 캐싱을 사용하면 로컬에서 캐싱된 데이터 키를 재사용하여 KMS 호출을 줄일 수 있습니다. AWS Encryption SDK에서 제공하는 기능입니다. 단, 키를 오래 재사용할수록 보안 위험이 증가할 수 있습니다.
Domain 3: 배포
Q26. AWS CodeDeploy에서 Blue/Green 배포의 주요 이점은?
A) 서버 비용이 절반으로 줄어든다 B) 배포 실패 시 즉각적인 롤백이 가능하다 C) 빌드 시간이 단축된다 D) 테스트 환경이 필요 없다
정답: B
설명: Blue/Green 배포는 현재 환경(Blue)과 동일한 새 환경(Green)을 생성하여 새 버전을 배포합니다. 트래픽을 Green으로 전환하고, 문제 발생 시 트래픽을 Blue로 즉시 되돌릴 수 있습니다. 이는 다운타임 없는 배포와 빠른 롤백을 가능하게 합니다. 단, 두 환경을 동시에 실행하므로 비용이 일시적으로 증가합니다.
Q27. AWS SAM(Serverless Application Model) 템플릿에서 AWS::Serverless::Function 리소스가 변환되는 CloudFormation 리소스는?
A) AWS::Lambda::Function만 B) AWS::Lambda::Function, AWS::IAM::Role, AWS::Lambda::EventSourceMapping C) AWS::Lambda::Function, AWS::EC2::Instance D) AWS::Serverless::Function은 변환되지 않는다
정답: B
설명: SAM 템플릿은 CloudFormation macro를 통해 변환됩니다. AWS::Serverless::Function은 Lambda 함수(AWS::Lambda::Function), 실행 역할(AWS::IAM::Role), 이벤트 소스 매핑(AWS::Lambda::EventSourceMapping), 이벤트 권한(AWS::Lambda::Permission) 등 여러 CloudFormation 리소스로 확장됩니다. sam build && sam deploy 명령으로 배포합니다.
Q28. Elastic Beanstalk Rolling with Additional Batch 배포 정책의 특징은?
A) 모든 인스턴스를 한 번에 업데이트하여 배포가 빠르다 B) 기존 용량을 유지하면서 새 배치를 먼저 시작한 후 롤링 업데이트한다 C) 새 환경을 생성하고 DNS를 변경한다 D) 하나씩 순차적으로 업데이트한다
정답: B
설명: Rolling with Additional Batch는 추가 인스턴스 배치를 먼저 시작하여 전체 용량을 유지하면서 롤링 업데이트를 수행합니다. 배포 중에도 전체 서비스 용량이 유지됩니다. 반면 단순 Rolling은 배포 중 일부 용량이 감소합니다. 가용성이 중요하고 비용 증가를 허용할 수 있을 때 적합합니다.
Q29. ECS Fargate와 EC2 Launch Type의 주요 차이점은?
A) Fargate는 고정 비용이고 EC2는 사용량 기반이다 B) Fargate는 서버 관리가 불필요하고 EC2 Launch Type은 EC2 인스턴스를 직접 관리한다 C) EC2 Launch Type은 서버리스이다 D) Fargate는 Windows 컨테이너를 지원하지 않는다
정답: B
설명: Fargate는 서버리스 컨테이너 실행 환경으로 EC2 인스턴스를 프로비저닝하거나 관리할 필요가 없습니다. vCPU와 메모리 사용량에 따라 과금됩니다. EC2 Launch Type은 ECS가 실행되는 EC2 인스턴스를 직접 관리해야 하지만, GPU 워크로드, 특수 인스턴스 유형, 비용 최적화에 더 유연합니다.
Q30. CodePipeline에서 수동 승인(Manual Approval) 단계를 추가하는 목적은?
A) 배포 속도를 높이기 위해 B) 프로덕션 배포 전에 사람의 검토와 승인을 요구하기 위해 C) 자동 테스트를 건너뛰기 위해 D) 비용을 줄이기 위해
정답: B
설명: 수동 승인 단계는 파이프라인이 다음 단계로 진행하기 전에 지정된 사람의 승인을 요구합니다. 스테이징에서 프로덕션으로 배포 전에 QA 팀이나 관리자가 검토하고 승인하는 게이트 역할을 합니다. SNS 알림으로 검토자에게 알림을 보내고, 콘솔, CLI, API를 통해 승인 또는 거부할 수 있습니다.
Q31. AWS CodeBuild에서 빌드 사양(buildspec.yml)의 phases 순서로 올바른 것은?
A) install → pre_build → build → post_build B) build → test → deploy → clean C) pre_build → build → post_build → install D) setup → build → verify → deploy
정답: A
설명: buildspec.yml의 phases 순서는 install(패키지 설치, 런타임 설정) → pre_build(로그인, 의존성 다운로드) → build(실제 빌드 명령) → post_build(패키징, ECR 푸시, 알림)입니다. 각 단계는 선택 사항이며, 단계 실패 시 후속 단계가 실행되지 않습니다.
Q32. ECR(Elastic Container Registry)에서 이미지 보안 스캐닝을 활성화하면 어떤 기능이 제공됩니까?
A) 이미지 자동 삭제 B) 이미지의 알려진 CVE 취약점 스캐닝 및 보고 C) 이미지 자동 업데이트 D) 이미지 암호화
정답: B
설명: ECR 이미지 스캐닝(Enhanced Scanning with Inspector, Basic Scanning)은 컨테이너 이미지의 OS 패키지와 프로그래밍 언어 패키지의 CVE(Common Vulnerabilities and Exposures)를 스캔합니다. 푸시 시 자동 스캔 또는 수동 스캔을 설정할 수 있으며, 발견된 취약점을 심각도별로 보고합니다.
Q33. CodeDeploy에서 appspec.yml 파일의 hooks 섹션에서 ApplicationStop 이벤트의 역할은?
A) 새 애플리케이션 버전을 시작한다 B) 현재 실행 중인 애플리케이션을 정지시킨다 C) 배포를 롤백한다 D) 서버를 재시작한다
정답: B
설명: CodeDeploy 배포 수명 주기 이벤트 순서: ApplicationStop → DownloadBundle → BeforeInstall → Install → AfterInstall → ApplicationStart → ValidateService. ApplicationStop은 현재 실행 중인 애플리케이션을 정상적으로 종료하는 스크립트를 실행합니다. 이전 배포의 appspec.yml에 정의된 스크립트가 실행됩니다.
Q34. Elastic Beanstalk에서 .ebextensions 디렉토리의 역할은?
A) 환경 변수만 설정한다 B) AWS 리소스 프로비저닝 및 EC2 인스턴스 구성을 커스터마이징한다 C) 애플리케이션 소스 코드를 저장한다 D) SSL 인증서를 관리한다
정답: B
설명: .ebextensions 디렉토리의 .config 파일(YAML/JSON)을 통해 EC2 인스턴스 구성, 파일 생성, 패키지 설치, 명령 실행, AWS 리소스(RDS, SQS 등) 프로비저닝, 환경 변수 설정 등을 커스터마이징할 수 있습니다. CloudFormation 구문을 사용하여 추가 리소스를 정의할 수 있습니다.
Q35. CodeCommit에서 브랜치 보호(branch protection)를 구현하는 방법은?
A) CodeCommit 설정에서 직접 브랜치 보호를 활성화한다 B) IAM 정책으로 특정 브랜치에 직접 푸시를 제한한다 C) CodePipeline으로 푸시를 제어한다 D) S3 버킷 정책을 사용한다
정답: B
설명: CodeCommit은 GitHub처럼 네이티브 브랜치 보호 기능이 없습니다. IAM 정책의 조건(StringNotEquals, codecommit:References)을 사용하여 main/master 브랜치에 직접 푸시를 제한할 수 있습니다. Pull Request 기반 워크플로우를 강제하려면 IAM으로 직접 푸시 권한을 제거하는 방법을 사용합니다.
Domain 4: 문제 해결 및 최적화
Q36. Lambda 함수에서 X-Ray 트레이싱을 활성화했을 때 나타나는 세그먼트(Segment)와 서브세그먼트(Subsegment)의 차이는?
A) 세그먼트는 서브세그먼트보다 더 세밀한 정보를 제공한다 B) 세그먼트는 Lambda 함수 전체 호출을 나타내고, 서브세그먼트는 그 안의 특정 작업을 나타낸다 C) 서브세그먼트는 외부 서비스 호출만 추적한다 D) 두 개념은 동일하다
정답: B
설명: X-Ray에서 세그먼트(Segment)는 단일 서비스 또는 요청에 대한 최상위 추적 단위입니다. Lambda 함수의 전체 호출을 나타냅니다. 서브세그먼트(Subsegment)는 세그먼트 내의 개별 작업(DynamoDB 쿼리, HTTP 요청 등)을 나타냅니다. AWS SDK 호출은 자동으로 서브세그먼트로 캡처되며, 커스텀 서브세그먼트도 추가할 수 있습니다.
Q37. DynamoDB에서 ProvisionedThroughputExceededException 오류가 발생하는 원인과 해결 방법은?
A) 테이블 크기가 제한을 초과했다 - 데이터를 삭제한다 B) 읽기/쓰기 처리량이 프로비저닝된 RCU/WCU를 초과했다 - Auto Scaling 또는 용량 증가 C) 인터넷 연결 문제 - 재시도한다 D) IAM 권한이 없다 - 정책을 수정한다
정답: B
설명: ProvisionedThroughputExceededException은 요청 처리량이 프로비저닝된 RCU(Read Capacity Units) 또는 WCU(Write Capacity Units)를 초과할 때 발생합니다. 해결 방법: (1) Auto Scaling 활성화로 자동 용량 조정, (2) 온디맨드 용량 모드 전환, (3) DAX 추가로 읽기 부하 감소, (4) 지수 백오프(Exponential Backoff)로 재시도. 핫 파티션이 원인인 경우 파티션 키 설계를 재검토합니다.
Q38. CloudWatch Logs에서 특정 패턴의 로그를 실시간으로 모니터링하고 알림을 받으려면?
A) CloudWatch 대시보드를 생성한다 B) Metric Filter를 생성하고 CloudWatch Alarm을 설정한다 C) S3로 로그를 내보낸다 D) CloudTrail을 활성화한다
정답: B
설명: CloudWatch Logs Metric Filter를 사용하여 로그 이벤트에서 특정 패턴을 필터링하고 사용자 정의 메트릭을 생성합니다. 예를 들어 "ERROR" 패턴을 필터링하여 에러 카운트 메트릭을 만들 수 있습니다. 이 메트릭에 CloudWatch Alarm을 연결하면 임계값 초과 시 SNS를 통해 알림을 받을 수 있습니다.
Q39. Lambda 함수의 동시 실행 수(Concurrent Executions)가 계정 제한에 도달하면 어떤 일이 발생합니까?
A) Lambda가 자동으로 스케일 다운된다 B) 새 요청은 Throttle(조절) 오류를 받는다 C) Lambda가 EC2 인스턴스로 전환된다 D) 요청이 SQS 큐에 자동 저장된다
정답: B
설명: 계정의 총 동시 실행 수(기본 1,000)에 도달하면 추가 Lambda 호출은 Throttle 오류(HTTP 429)를 받습니다. 동기 호출의 경우 클라이언트에 직접 오류가 반환됩니다. 비동기 호출의 경우 Lambda가 자동으로 재시도합니다. Service Quota 증가 요청으로 제한을 높일 수 있습니다.
Q40. X-Ray에서 주석(Annotations)과 메타데이터(Metadata)의 차이는?
A) 주석은 인덱싱되어 검색 가능하고, 메타데이터는 인덱싱되지 않는다 B) 메타데이터는 인덱싱되어 검색 가능하고, 주석은 인덱싱되지 않는다 C) 두 개념은 동일하다 D) 주석은 숫자만 지원하고, 메타데이터는 모든 유형을 지원한다
정답: A
설명: X-Ray Annotations는 키-값 쌍(문자열, 숫자, 부울)으로 인덱싱되어 트레이스 검색 및 필터링에 사용할 수 있습니다. Metadata는 객체나 배열 등 모든 JSON 직렬화 가능한 값을 저장할 수 있지만 인덱싱되지 않아 검색에 사용할 수 없습니다. 디버깅 정보를 저장할 때는 Metadata, 필터링이 필요한 정보는 Annotations를 사용합니다.
Q41. Lambda 함수에서 비동기(Asynchronous) 호출의 기본 재시도 동작은?
A) 재시도하지 않는다 B) 최대 2번 재시도(총 3번 시도)하고 실패 시 DLQ로 이동 C) 무한 재시도한다 D) 1번 재시도하고 성공 여부와 관계없이 종료한다
정답: B
설명: Lambda 비동기 호출이 실패하면 Lambda는 자동으로 최대 2번 재시도합니다(총 3번 시도). 재시도 간격은 점점 증가합니다. 3번 모두 실패하면 설정된 Dead-Letter Queue(SQS 또는 SNS)로 이벤트를 전송합니다. 이벤트 대상(Destination)을 설정하면 성공/실패 이벤트를 다른 AWS 서비스로 라우팅할 수 있습니다.
Q42. CloudWatch에서 사용자 정의 메트릭을 게시할 때 고해상도(High Resolution) 메트릭을 사용하는 상황은?
A) 메트릭을 더 오래 보관하고 싶을 때 B) 1분 미만(1초~59초) 단위의 세밀한 모니터링이 필요할 때 C) 비용을 절감하고 싶을 때 D) 여러 리전에서 메트릭을 집계할 때
정답: B
설명: 표준 해상도 메트릭은 1분 단위로 게시됩니다. 고해상도 메트릭은 1초 단위까지 지원하여 더 세밀한 모니터링이 가능합니다. 단, 고해상도 메트릭은 표준보다 비용이 더 많이 발생합니다. 금융 거래, 게임 이벤트 등 초 단위 정밀도가 필요한 경우에 사용합니다.
Q43. DynamoDB Streams를 활용하는 일반적인 사용 사례로 올바른 것은?
A) DynamoDB 테이블 백업 B) 데이터 변경 이벤트를 Lambda로 트리거하여 다른 시스템에 전파 C) DynamoDB 읽기 성능 향상 D) 글로벌 테이블 생성
정답: B
설명: DynamoDB Streams는 테이블의 항목 수준 변경 사항(INSERT, MODIFY, REMOVE)을 순서대로 기록합니다. Lambda 이벤트 소스 매핑으로 스트림 레코드를 처리하여 다른 데이터베이스에 변경 사항 전파, 이메일 알림 발송, 검색 인덱스 업데이트, 감사 로그 생성 등을 구현할 수 있습니다. 스트림 레코드는 24시간 동안 보관됩니다.
Q44. API Gateway에서 응답 코드 502 Bad Gateway 오류가 발생하는 일반적인 원인은?
A) 클라이언트의 잘못된 요청 형식 B) Lambda 함수 또는 백엔드가 잘못된 형식의 응답을 반환했거나 타임아웃 C) IAM 권한 부족 D) API Gateway 캐시가 가득 찼다
정답: B
설명: API Gateway 502 Bad Gateway는 백엔드 통합에서 발생하는 오류입니다. 주요 원인: (1) Lambda 함수가 예상 형식(statusCode, headers, body)이 아닌 응답 반환, (2) Lambda 함수 실행 오류(예외 발생), (3) Lambda 타임아웃(API Gateway 타임아웃: 29초). 401/403은 인증/권한 오류, 400은 잘못된 요청, 500은 내부 서버 오류입니다.
Q45. Lambda Cold Start 시간에 영향을 주는 요소들로 올바른 것은?
A) 함수의 호출 빈도만 B) 런타임 유형, 배포 패키지 크기, VPC 구성, 초기화 코드 실행 시간 C) AWS 리전만 D) Lambda 레이어 수만
정답: B
설명: Lambda 콜드 스타트 시간에 영향을 주는 요소: (1) 런타임 유형(Java/C#이 Python/Node.js보다 느림), (2) 배포 패키지 크기(크면 다운로드 시간 증가), (3) VPC 설정(ENI 생성 추가 지연), (4) 초기화 코드(핸들러 외부 코드 실행 시간), (5) Lambda 레이어. 콜드 스타트 최소화: 작은 패키지, Provisioned Concurrency, 경량 런타임 사용.
Q46. SQS Dead-Letter Queue(DLQ)로 메시지가 이동하는 조건은?
A) 메시지 크기가 256KB를 초과할 때 B) 메시지가 maxReceiveCount 횟수만큼 처리 실패했을 때 C) 큐 용량이 가득 찰 때 D) VisibilityTimeout이 만료될 때마다
정답: B
설명: SQS DLQ는 소스 큐에서 maxReceiveCount로 설정된 횟수 이상 수신(처리 실패)된 메시지를 자동으로 이동받습니다. 예를 들어 maxReceiveCount=3이면 메시지가 3번 수신되어 처리 실패했을 때 DLQ로 이동합니다. DLQ의 메시지를 분석하여 처리 실패 원인을 파악하거나 재처리 큐로 이동할 수 있습니다.
Q47. 다음 Lambda 함수 코드의 문제점은 무엇입니까?
import boto3
def handler(event, context):
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('MyTable')
response = table.scan()
return response['Items']
A) boto3 import가 잘못되었다 B) DynamoDB 클라이언트를 핸들러 내부에서 초기화하여 재사용이 안 된다 C) scan() 메서드는 Lambda에서 사용할 수 없다 D) 반환 형식이 잘못되었다
정답: B
설명: DynamoDB 리소스 객체가 핸들러 함수 내부에서 초기화되어 매 호출마다 새로 생성됩니다. 실행 컨텍스트 재사용의 이점을 활용하지 못합니다. 핸들러 외부(전역 범위)에서 초기화하면 warm 재사용 시 기존 연결을 재사용하여 성능이 향상됩니다. 또한 Scan은 전체 테이블을 읽어 비용이 크므로 Query로 대체하는 것이 좋습니다.
Q48. CloudWatch Logs Insights 쿼리에서 Lambda 함수의 에러 로그를 찾는 쿼리는?
A) SELECT * WHERE level = 'ERROR' B) fields @timestamp, @message | filter @message like /ERROR/ | sort @timestamp desc C) GET errors FROM lambda_logs D) SEARCH 'ERROR' IN CloudWatch
정답: B
설명: CloudWatch Logs Insights는 자체 쿼리 언어를 사용합니다. fields 명령으로 표시할 필드를 선택하고, filter로 특정 패턴을 필터링하며, sort로 정렬합니다. like /ERROR/ 또는 like /Exception/ 패턴으로 에러 로그를 찾습니다. stats count(*) by bin(5m)으로 시간별 에러 수를 집계할 수도 있습니다.
Q49. API Gateway에서 사용 계획(Usage Plan)과 API 키의 주요 목적은?
A) API 보안 강화 B) API 요청 수와 속도를 제한하여 남용을 방지하고 수익화를 가능하게 한다 C) API 버전 관리 D) 캐싱 활성화
정답: B
설명: 사용 계획(Usage Plan)은 API 키별로 스로틀링(초당 요청 수: RPS, 버스트 크기)과 할당량(일/주/월별 총 요청 수)을 설정합니다. API 키를 발급하여 사용 계획에 연결하면 고객별로 다른 제한을 적용할 수 있습니다. API 수익화, 파트너 API 제공, 남용 방지에 활용됩니다.
Q50. Lambda 함수에서 timeout 설정의 최대값은?
A) 5분 B) 10분 C) 15분 D) 30분
정답: C
설명: Lambda 함수의 최대 실행 시간(timeout)은 15분(900초)입니다. 기본값은 3초입니다. 15분을 초과하는 작업에는 Step Functions(상태 머신), ECS 태스크, 또는 EC2 인스턴스를 사용해야 합니다. 타임아웃이 발생하면 Lambda는 함수를 강제 종료하고 비동기 호출의 경우 재시도합니다.
Q51. DynamoDB의 단일 테이블 설계(Single-Table Design) 패턴에서 overloading partition key와 sort key를 사용하는 이유는?
A) DynamoDB 비용을 줄이기 위해 B) 여러 엔티티 유형을 단일 테이블에 저장하여 조인 없이 효율적인 쿼리를 지원하기 위해 C) 데이터 암호화를 개선하기 위해 D) 백업을 간소화하기 위해
정답: B
설명: DynamoDB는 조인 연산을 지원하지 않으므로, 여러 관련 엔티티를 단일 테이블에 저장하고 파티션 키와 정렬 키를 오버로딩합니다. 예: PK=USER#123, SK=USER#123(사용자 정보), SK=ORDER#456(주문 정보). 단일 GetItem 또는 Query로 관련 데이터를 함께 조회할 수 있습니다. Rick Houlihan의 설계 패턴이 유명합니다.
Q52. SNS(Simple Notification Service) 팬아웃(Fan-out) 패턴의 설명으로 올바른 것은?
A) SNS가 단일 SQS 큐에 메시지를 전달한다 B) SNS 토픽에 발행된 메시지가 여러 SQS 큐와 Lambda, HTTP 엔드포인트에 동시 전달된다 C) SQS가 여러 Lambda 함수를 동시에 트리거한다 D) 하나의 Lambda가 여러 SNS 토픽에 발행한다
정답: B
설명: SNS 팬아웃 패턴은 SNS 토픽에 하나의 메시지를 발행하면 구독하는 모든 엔드포인트(SQS 큐, Lambda 함수, HTTP/HTTPS, 이메일, SMS)에 동시에 전달되는 패턴입니다. 예를 들어 주문 완료 이벤트를 발행하면 이메일 알림, 재고 업데이트, 배송 처리 등 여러 시스템이 동시에 처리할 수 있습니다.
Q53. Elastic Beanstalk 환경 유형에서 Worker 환경의 특징은?
A) 인터넷 트래픽을 처리하는 웹 서버 B) SQS 큐의 메시지를 폴링하여 백그라운드 작업을 처리한다 C) 데이터베이스 처리에 특화된 환경 D) 오직 Fargate 컨테이너만 실행한다
정답: B
설명: Elastic Beanstalk Worker 환경은 SQS 데몬(sqsd)이 내장되어 있어 SQS 큐를 폴링하고 HTTP POST 요청으로 애플리케이션에 메시지를 전달합니다. 웹 환경(Web Server Tier)과 분리하여 비동기 백그라운드 작업(이미지 처리, 이메일 발송, 데이터 처리 등)을 처리합니다.
Q54. AWS CloudFormation 스택 업데이트 시 리소스 교체(Replacement)가 발생하는 경우의 예시는?
A) EC2 인스턴스의 태그 변경 B) RDS 인스턴스의 DB 엔진 버전 업그레이드 C) S3 버킷 이름 변경 D) Lambda 함수의 메모리 설정 변경
정답: C
설명: S3 버킷 이름은 불변 속성으로, 이름을 변경하면 기존 버킷이 삭제되고 새 이름의 버킷이 생성됩니다(교체). EC2 태그 변경이나 Lambda 메모리 변경은 현재 리소스를 업데이트합니다. CloudFormation은 속성 변경의 업데이트 유형을 'Update requires: Replacement', 'Update requires: No interruption', 'Update requires: Some interruptions'로 문서화합니다.
Q55. S3 이벤트 알림(Event Notifications)을 통해 Lambda를 트리거할 때의 호출 유형은?
A) 동기(Synchronous) 호출 B) 비동기(Asynchronous) 호출 C) Poll-based 호출 D) 스트리밍 호출
정답: B
설명: S3 이벤트 알림이 Lambda를 트리거할 때는 비동기(Asynchronous/Event) 호출 방식을 사용합니다. S3는 이벤트를 Lambda에 발행하고 응답을 기다리지 않습니다. Lambda는 실패 시 자동으로 재시도하며, DLQ 또는 Lambda Destination 설정이 가능합니다. SNS, SES, CloudWatch Events도 비동기 호출을 사용합니다.
Q56. DynamoDB TransactWriteItems의 특징으로 올바른 것은?
A) 단일 파티션에만 적용된다 B) 최대 100개 항목에 대한 원자적(Atomic) ACID 트랜잭션을 지원한다 C) 비동기로만 실행된다 D) 읽기 전용 작업에만 사용된다
정답: B
설명: TransactWriteItems는 여러 테이블에 걸쳐 최대 100개(또는 4MB)의 항목에 대한 원자적 쓰기 작업을 수행합니다. 모든 작업이 성공하거나 모두 실패합니다(ACID). Put, Update, Delete, ConditionCheck 작업을 조합할 수 있습니다. TransactGetItems는 읽기 트랜잭션을 지원합니다. 표준 작업보다 2배의 읽기/쓰기 용량을 소비합니다.
Q57. Lambda 함수의 환경 변수 최대 크기는?
A) 4KB B) 8KB C) 16KB D) 32KB
정답: A
설명: Lambda 함수의 모든 환경 변수의 총 크기는 4KB로 제한됩니다. 이 제한을 초과하는 구성 값은 SSM Parameter Store 또는 Secrets Manager에 저장하고 런타임에 API를 통해 가져와야 합니다. 환경 변수는 함수 배포 패키지와 분리되어 있어 코드 변경 없이 구성을 업데이트할 수 있습니다.
Q58. CodeBuild 빌드 환경에서 환경 변수를 안전하게 전달하는 방법은?
A) buildspec.yml에 직접 하드코딩한다 B) Parameter Store 또는 Secrets Manager 참조를 사용한다 C) 소스 코드 저장소에 저장한다 D) S3 버킷의 평문 파일에서 읽는다
정답: B
설명: CodeBuild에서 민감한 환경 변수(API 키, 비밀번호 등)는 buildspec.yml에 직접 작성하지 않고, SSM Parameter Store의 SecureString 파라미터 또는 Secrets Manager 시크릿을 참조합니다. buildspec.yml에서 parameter-store 또는 secrets-manager 필드로 참조할 수 있으며, 빌드 실행 시 자동으로 복호화되어 환경 변수로 설정됩니다.
Q59. S3 Lifecycle Policy에서 객체를 Glacier로 전환하는 최소 경과 일수는?
A) 1일 B) 30일 C) 60일 D) 90일
정답: B
설명: S3 Standard에서 S3 Glacier Flexible Retrieval로 직접 전환하는 최소 기간은 30일입니다. S3 Standard-IA에서 Glacier로는 30일, S3 Intelligent-Tiering에서는 직접 전환이 가능합니다. Glacier Instant Retrieval로의 전환 최소 기간은 90일입니다. Lifecycle Policy를 잘못 설정하면 예상치 못한 비용이 발생할 수 있습니다.
Q60. API Gateway에서 스테이지 변수(Stage Variables)의 사용 사례는?
A) 사용자 인증 정보를 저장한다 B) 환경별(개발/스테이징/프로덕션)로 다른 Lambda 함수 ARN 또는 엔드포인트를 참조한다 C) API 버전을 자동으로 증가시킨다 D) 캐시 설정을 저장한다
정답: B
설명: 스테이지 변수는 API Gateway 스테이지별로 다른 값을 설정할 수 있는 키-값 쌍입니다. 예를 들어 lambdaAlias 변수를 dev 스테이지에서는 "dev", prod 스테이지에서는 "prod"로 설정하고, Lambda 통합 URI에서는 stageVariables.lambdaAlias 표현식으로 참조합니다. 동일한 API 정의로 여러 환경을 지원할 수 있습니다.
Q61. Lambda 함수를 업데이트할 때 버전(Version)과 별칭(Alias)을 사용하는 주요 이유는?
A) 비용을 절감하기 위해 B) 트래픽 분산(Canary 배포)과 안정적인 ARN 참조를 제공하기 위해 C) 실행 속도를 높이기 위해 D) 로깅을 활성화하기 위해
정답: B
설명: Lambda 버전은 배포된 코드와 구성의 불변 스냅샷입니다. 별칭은 특정 버전(또는 $LATEST)을 가리키는 이름입니다. 별칭 ARN을 API Gateway나 이벤트 소스에 연결하면, 새 버전 배포 시 별칭만 업데이트하면 됩니다. 또한 별칭의 라우팅 구성으로 두 버전 간 트래픽을 분산(예: v1=90%, v2=10%)하여 Canary 배포를 구현할 수 있습니다.
Q62. DynamoDB에서 Conditional Write를 사용하는 시나리오는?
A) 데이터 암호화를 위해 B) 낙관적 잠금(Optimistic Locking)을 구현하거나 항목이 존재하지 않을 때만 삽입하기 위해 C) 읽기 성능을 향상시키기 위해 D) 자동 인덱싱을 활성화하기 위해
정답: B
설명: DynamoDB Conditional Write는 지정된 조건이 true일 때만 쓰기 작업을 수행합니다. 예를 들어 attribute_not_exists(pk) 조건으로 항목이 없을 때만 삽입(중복 방지), version 속성의 버전 번호를 확인하여 낙관적 잠금 구현이 가능합니다. 조건 실패 시 ConditionalCheckFailedException이 발생합니다. 소비되는 WCU는 조건 성공 여부와 관계없이 동일합니다.
Q63. AWS X-Ray 서비스 맵(Service Map)에서 볼 수 있는 정보로 올바른 것은?
A) AWS 비용 정보 B) 서비스 간 연결, 응답 시간, 오류율, 요청 수 C) IAM 권한 정보 D) 네트워크 대역폭 사용량
정답: B
설명: X-Ray 서비스 맵은 애플리케이션의 서비스 토폴로지를 시각화합니다. 각 노드는 서비스(Lambda, DynamoDB, API Gateway 등)를 나타내며 평균 응답 시간(레이턴시), 요청 수(분당), 오류율(4xx), 결함률(5xx)을 표시합니다. 서비스 간 화살표는 호출 관계를 보여줍니다. 성능 병목 지점과 오류 발생 서비스를 시각적으로 파악할 수 있습니다.
Q64. Lambda 함수에서 /tmp 디렉토리의 특징으로 올바른 것은?
A) 함수 호출 간에 공유되지 않으며 영구 저장소로 사용할 수 없다 B) 최대 10GB의 임시 스토리지를 제공하며 같은 컨테이너 재사용 시 데이터가 유지될 수 있다 C) 모든 Lambda 함수가 동일한 /tmp 디렉토리를 공유한다 D) /tmp 디렉토리는 암호화되지 않는다
정답: B
설명: Lambda /tmp 디렉토리는 최대 10GB(기본 512MB, 조정 가능)의 임시 스토리지를 제공합니다. 같은 실행 환경(컨테이너)이 재사용(warm 재실행)될 때 이전 호출에서 저장한 데이터가 남아 있을 수 있습니다. 이는 캐싱에 활용할 수 있지만 보안에 주의해야 합니다(민감 데이터 정리 필요). 다른 Lambda 인스턴스와는 공유되지 않습니다.
Q65. 다음 중 Lambda 이벤트 소스 매핑(Event Source Mapping)을 사용하는 서비스들로 올바른 것은?
A) S3, SNS, API Gateway B) SQS, Kinesis Data Streams, DynamoDB Streams, MSK, MQ C) CloudWatch Events, EventBridge, SNS D) CodeCommit, CodePipeline, CodeDeploy
정답: B
설명: 이벤트 소스 매핑은 Lambda가 능동적으로 폴링하는 스트림/큐 기반 서비스에서 사용됩니다: SQS, Kinesis Data Streams, DynamoDB Streams, Apache Kafka(MSK), Amazon MQ. Lambda 서비스가 직접 폴링하여 배치로 처리합니다. 반면 S3, SNS, API Gateway, EventBridge는 Lambda를 직접 호출(push 방식)합니다.
합격 전략
- 핵심 서비스 집중: Lambda, DynamoDB, API Gateway, SQS, Cognito가 전체의 50% 이상
- 실습 필수: AWS Free Tier로 직접 구현 경험 쌓기
- 공식 문서: 각 서비스의 개발자 가이드와 API 레퍼런스 숙지
- 화이트페이퍼: AWS 보안 모범 사례, 서버리스 아키텍처 화이트페이퍼 필독
- 시험 팁: 문제에서 가장 "효율적", "비용 효과적", "최소 운영 오버헤드" 키워드에 주목
AWS Developer Associate (DVA-C02) Practice Exam — 65 Questions
Exam Overview
| Item | Details |
|---|---|
| Exam Code | DVA-C02 |
| Duration | 130 minutes |
| Questions | 65 |
| Passing Score | 720 / 1000 |
| Format | Single choice, Multiple choice |
Domain Weightings
| Domain | Weight |
|---|---|
| Domain 1: Development with AWS Services | 32% |
| Domain 2: Security | 26% |
| Domain 3: Deployment | 24% |
| Domain 4: Troubleshooting and Optimization | 18% |
Key Service Summary
Lambda Key Points
- Invocation types: Synchronous (RequestResponse), Asynchronous (Event), Poll-based
- Concurrency: Reserved Concurrency (hard limit), Provisioned Concurrency (eliminates cold start)
- Cold Start: Longer in VPC Lambda; solved with Provisioned Concurrency
- Layers: Share common libraries, up to 5 layers per function
DynamoDB Key Points
- Partition Key: Choose high cardinality; avoid hot partitions
- GSI: Different partition/sort key; Eventually Consistent reads only
- LSI: Same partition key, different sort key; can only be added at table creation
- DAX: Microsecond responses; caches only Eventually Consistent reads
API Gateway Key Points
- REST API: Full features, WAF support, caching
- HTTP API: Lower cost, OIDC/JWT auth, Lambda Proxy only
- WebSocket API: Bidirectional real-time communication
Kinesis Key Points
- Shard calculation: Write = max(input MB/s, records/1000) per shard (1 MB/s or 1,000 records/s per shard)
- Enhanced Fan-out: 2 MB/s per shard read, push-based
- Data Firehose: Auto-scaling, direct delivery to S3/Redshift/Elasticsearch
Practice Questions — 65 Questions
Domain 1: Development with AWS Services
Q1. A Lambda function is deployed inside a VPC. You notice very long cold start times on function invocations. What is the most appropriate solution?
A) Increase the Lambda function's memory B) Configure Provisioned Concurrency C) Use Lambda Layers D) Reduce the number of environment variables
Answer: B
Explanation: Lambda functions inside a VPC experience longer cold starts due to the creation of Elastic Network Interfaces (ENIs). Configuring Provisioned Concurrency maintains pre-initialized execution environments, eliminating cold starts. Increasing memory speeds up execution but does not eliminate cold starts themselves.
Q2. You need to query a DynamoDB table to retrieve a specific user's order history sorted by most recent date. The table's partition key is userId and sort key is orderId. How do you efficiently support date-based sorting?
A) Create a new GSI with userId (partition key) and orderDate (sort key) B) Add an LSI with userId (partition key) and orderDate (sort key) C) Perform a Scan and sort results in the application D) Enable DynamoDB Streams
Answer: A
Explanation: LSIs can only be defined at table creation time, so for an existing table you must use a GSI. Creating a GSI with userId as partition key and orderDate as sort key allows efficient querying of a user's orders sorted by date. Scan is inefficient and expensive at scale.
Q3. When a Lambda function processes SQS messages with the following code, what invocation type is used?
def handler(event, context):
for record in event['Records']:
body = record['body']
process_message(body)
return {'statusCode': 200}
A) Synchronous invocation B) Asynchronous invocation C) Poll-based invocation D) Stream-based invocation
Answer: C
Explanation: Lambda triggered by SQS uses poll-based invocation (event source mapping). The Lambda service polls the SQS queue, retrieves messages, and invokes the function with a batch in event['Records']. Kinesis Data Streams and DynamoDB Streams also use poll-based invocation.
Q4. API Gateway REST API has caching enabled on an endpoint. How can a client bypass the cache and always receive fresh data?
A) Include a Cache-Control: no-cache header in the request B) Use an X-Amz-Cache-Control: invalidate header C) Disable cache at the API Gateway stage level D) Call a cache invalidation API from the Lambda function
Answer: A
Explanation: When API Gateway caching is enabled, clients can bypass it by including Cache-Control: no-cache in the HTTP request. Note that you need to configure "Require authorization to invalidate cache" appropriately in API Gateway settings. Disabling the stage cache affects all requests.
Q5. A Kinesis Data Stream must handle 5,000 records per second, with an average record size of 2 KB. What is the minimum number of shards required?
A) 5 B) 8 C) 10 D) 15
Answer: C
Explanation: Each shard supports up to 1,000 records/s or 1 MB/s for writes.
Records-based: 5,000 / 1,000 = 5 shards Data-size-based: (5,000 × 2 KB) / 1,024 KB ≈ 9.77 MB/s → 10 shards
The larger of the two values applies, so 10 shards are required.
Q6. An application uses an SQS FIFO queue. How do you prevent duplicate processing of the same message?
A) Increase the VisibilityTimeout B) Set a MessageDeduplicationId C) Set unique MessageGroupIds D) Configure a Dead-Letter Queue
Answer: B
Explanation: SQS FIFO queues use MessageDeduplicationId to deduplicate messages sent with the same ID within a 5-minute window. Enabling ContentBasedDeduplication automatically uses the SHA-256 hash of the message body. MessageGroupId is for ordering guarantees; VisibilityTimeout prevents reprocessing during processing time.
Q7. What is the best approach for reliably uploading a large 5 GB file to S3?
A) Upload with a single PUT request B) Use the Multipart Upload API C) Use S3 Transfer Acceleration D) Generate a Pre-signed URL
Answer: B
Explanation: While a single S3 PUT supports up to 5 GB, Multipart Upload is recommended for files over 100 MB. It splits the file into parts for parallel upload, and only failed parts need to be retried on failure. S3 Transfer Acceleration improves speed via Edge Locations but is separate from upload reliability.
Q8. Which DynamoDB read operation does DAX (DynamoDB Accelerator) NOT cache?
A) GetItem B) Query C) Scan D) TransactGetItems
Answer: D
Explanation: DAX caches eventually consistent reads (GetItem, Query, Scan). TransactGetItems uses strongly consistent reads as part of a transaction, so DAX bypasses its cache and passes requests directly to DynamoDB. Strongly consistent reads (ConsistentRead=True) also bypass the DAX cache.
Q9. Why should a database connection be initialized outside the Lambda handler function?
A) To improve security B) To optimize performance through execution context reuse C) To reduce memory usage D) To prevent timeouts
Answer: B
Explanation: Lambda execution environments can be reused (warm starts). Code initialized outside the handler (database connections, SDK clients) is not re-executed when the container is reused, improving performance. This is called Execution Context Reuse.
Q10. Which statement correctly describes a difference between API Gateway WebSocket API and REST API?
A) WebSocket API does not support serverless B) WebSocket API supports bidirectional communication between client and server C) REST API is better suited for real-time notifications D) WebSocket API supports caching
Answer: B
Explanation: WebSocket API maintains a persistent connection for bidirectional real-time communication. It is suitable for chat applications, real-time dashboards, and gaming. REST API follows a request-response pattern. WebSocket API also supports Lambda as a backend.
Q11. Which statement correctly differentiates GSI from LSI in DynamoDB?
A) GSI cannot be added after table creation; LSI can B) LSI can only be added at table creation time; GSI can be added later C) GSI must use the same partition key as the table D) LSI limits the total table size to 10 GB
Answer: B
Explanation: LSIs (Local Secondary Indexes) can only be defined at table creation and cannot be added or removed afterwards. GSIs (Global Secondary Indexes) can be added or removed at any time after table creation. LSIs share the same partition key as the base table but use a different sort key.
Q12. What is the primary use case for an S3 Pre-signed URL?
A) Making an S3 bucket publicly accessible B) Temporarily granting access to a specific S3 object without authentication C) Bypassing S3 bucket policies D) Automatically encrypting S3 objects
Answer: B
Explanation: A Pre-signed URL allows time-limited access to a specific S3 object without requiring AWS credentials. Use cases include temporarily sharing a file download link or allowing clients to upload files directly to S3 (PUT) without making the bucket public.
Q13. What problem can occur if the SQS VisibilityTimeout is set too short?
A) Messages move to the Dead-Letter Queue B) The same message can be delivered to multiple consumers C) Messages are permanently deleted D) Queue capacity is exceeded
Answer: B
Explanation: VisibilityTimeout is the period during which a message is hidden from other consumers after being received. If set too short, the timeout may expire before the first consumer finishes processing, making the message visible again to other consumers and potentially causing duplicate processing. Set it longer than the expected processing time.
Q14. What happens when you set a Lambda function's Reserved Concurrency to 0?
A) Unlimited concurrency is allowed B) Function invocations are completely throttled C) Cold starts are prevented D) Auto-scaling is activated
Answer: B
Explanation: Setting Reserved Concurrency to 0 completely throttles the function — all invocations return a throttling error. This can be used to temporarily disable a function or to preserve concurrency for other functions. To re-enable the function, either delete the reserved concurrency setting or set it to a value greater than 0.
Q15. What is a key difference between Kinesis Data Firehose and Kinesis Data Streams?
A) Firehose requires manual shard management B) Firehose auto-scales and delivers data directly to destinations C) Firehose is better suited for real-time processing D) Firehose requires a consumer application
Answer: B
Explanation: Kinesis Data Firehose is a fully managed service with automatic scaling. It delivers data directly to S3, Redshift, OpenSearch Service, and Splunk. Data Streams requires manual shard management and consumer applications. Firehose buffers data (minimum 60 seconds or 1 MB), making it near-real-time rather than strictly real-time.
Domain 2: Security
Q16. Which statement correctly describes the difference between Cognito User Pools and Identity Pools?
A) User Pools grant AWS service access; Identity Pools handle user authentication B) User Pools provide user authentication and a user directory; Identity Pools provide AWS credentials C) Identity Pools do not support social login D) User Pools and Identity Pools provide the same functionality
Answer: B
Explanation: Cognito User Pools provide user registration, login, MFA, and a user directory, issuing JWT tokens (ID Token, Access Token, Refresh Token). Identity Pools exchange authenticated identities (from User Pools, Google, Facebook, etc.) for temporary AWS credentials (IAM Role), allowing direct access to AWS services.
Q17. In KMS Envelope Encryption, how is the Data Key used?
A) The data key is stored in KMS and encrypted with the CMK B) The data key encrypts the actual data; the data key itself is encrypted with the CMK and stored alongside the data C) The CMK encrypts data directly D) The data key is always stored in plaintext
Answer: B
Explanation: In envelope encryption: (1) KMS generates a Data Encryption Key (DEK), (2) the DEK encrypts the actual data, (3) the DEK is encrypted with the CMK. The encrypted DEK is stored with the encrypted data. The CMK never leaves KMS. This approach efficiently encrypts large amounts of data.
Q18. What is the difference between an IAM Resource-based Policy and an Identity-based Policy?
A) Resource-based policies can only be attached to EC2 B) Identity-based policies specify a Principal; resource-based policies are attached to IAM entities C) Resource-based policies specify a Principal; identity-based policies are attached to IAM entities D) Both policy types are identical
Answer: C
Explanation: Resource-based policies (S3 bucket policy, Lambda resource policy) are attached directly to a resource and explicitly specify a Principal (who can access). Identity-based policies (IAM User/Role/Group policies) are attached to IAM entities and define what actions can be performed without specifying a Principal. Cross-account access requires a resource-based policy or STS AssumeRole.
Q19. Which statement correctly describes the difference between AWS Secrets Manager and SSM Parameter Store?
A) Parameter Store supports automatic rotation; Secrets Manager does not B) Secrets Manager supports automatic secret rotation and cross-account sharing, with an additional cost C) Both provide identical functionality D) Parameter Store does not support encryption
Answer: B
Explanation: Secrets Manager supports automatic rotation of database credentials and other secrets, cross-account access, and secret replication, with a per-secret monthly charge. Parameter Store offers free (Standard) or low-cost (Advanced) tiers but does not have built-in automatic rotation (custom Lambda rotation is possible). Use Secrets Manager when automatic rotation is important, such as for database credentials.
Q20. What is the role of ExternalId when using STS AssumeRole?
A) Sets the maximum session duration for the role B) Prevents the Confused Deputy attack C) Activates MFA authentication D) Allows cross-region access
Answer: B
Explanation: ExternalId prevents the Confused Deputy problem. When a third-party service assumes a customer's role, a malicious customer B could try to use customer A's ARN to access customer A's data from their own environment. ExternalId is set as a condition in the trust policy, preventing role assumption without the correct ExternalId.
Q21. What is the recommended approach for encrypting Lambda function environment variables?
A) Base64-encode the environment variables B) Encrypt environment variables with a KMS CMK and decrypt at runtime C) Hardcode environment variables directly in the code D) Store them in S3 and read at runtime
Answer: B
Explanation: Lambda environment variables are encrypted by default with an AWS-managed key. For stronger security, use a customer-managed CMK. Sensitive values (API keys, passwords) should be encrypted with KMS and decrypted using the SDK at runtime, or stored in Secrets Manager/Parameter Store and retrieved dynamically at runtime.
Q22. Which claims are included in a Cognito JWT ID Token?
A) AWS IAM policies B) Username, email, and user group information C) AWS temporary credentials D) S3 bucket access permissions
Answer: B
Explanation: The Cognito User Pool ID Token (JWT) contains claims such as the username (sub), email, phone number, Cognito user groups (cognito:groups), and custom attributes. The Access Token contains OAuth 2.0 scopes for API access. Temporary AWS credentials are obtained by exchanging the ID Token at the Identity Pool.
Q23. Which S3 server-side encryption option requires the customer to provide the encryption key?
A) SSE-S3 B) SSE-KMS C) SSE-C D) CSE (Client-Side Encryption)
Answer: C
Explanation: SSE-C (Server-Side Encryption with Customer-Provided Keys) requires the customer to provide the encryption key in each HTTPS request. AWS uses the key only for encryption/decryption and does not store it. SSE-S3 uses AWS-managed keys; SSE-KMS uses KMS-managed keys. CSE encrypts data before uploading on the client side.
Q24. What are the two types of Lambda Authorizers in API Gateway?
A) Header authorizer, Body authorizer B) TOKEN authorizer, REQUEST authorizer C) JWT authorizer, API Key authorizer D) IAM authorizer, Cognito authorizer
Answer: B
Explanation: Lambda Authorizers have two types. TOKEN type extracts a Bearer token (JWT, OAuth) from the Authorization header for validation. REQUEST type uses the full request context — headers, query parameters, stage variables — for authorization. Both types return an IAM policy.
Q25. Why is KMS Data Key Caching used?
A) To reduce the number of KMS API calls and associated costs B) To increase encryption strength C) To enable automatic key rotation D) To create a CMK
Answer: A
Explanation: Requesting a new data key from KMS for every encryption operation increases API calls, costs, and latency. Data Key Caching reuses locally cached data keys to reduce KMS calls. This feature is provided by the AWS Encryption SDK. However, reusing a key for longer periods may increase security risk.
Domain 3: Deployment
Q26. What is the primary benefit of Blue/Green deployment in AWS CodeDeploy?
A) Server costs are halved B) Immediate rollback is possible if the deployment fails C) Build time is reduced D) A test environment is not required
Answer: B
Explanation: Blue/Green deployment creates a new identical environment (Green) and deploys the new version there. Traffic is switched to Green, and if problems occur, traffic can be instantly switched back to Blue. This enables zero-downtime deployment and fast rollback. However, running two environments simultaneously temporarily increases costs.
Q27. In an AWS SAM template, what CloudFormation resources does AWS::Serverless::Function transform into?
A) AWS::Lambda::Function only B) AWS::Lambda::Function, AWS::IAM::Role, AWS::Lambda::EventSourceMapping C) AWS::Lambda::Function, AWS::EC2::Instance D) AWS::Serverless::Function is not transformed
Answer: B
Explanation: SAM templates are transformed via a CloudFormation macro. AWS::Serverless::Function expands into multiple CloudFormation resources including a Lambda function (AWS::Lambda::Function), an execution role (AWS::IAM::Role), event source mappings (AWS::Lambda::EventSourceMapping), and event permissions (AWS::Lambda::Permission). Deployed with sam build && sam deploy.
Q28. What is the key characteristic of Elastic Beanstalk's Rolling with Additional Batch deployment policy?
A) Updates all instances at once for a fast deployment B) Maintains existing capacity by launching an additional batch before performing a rolling update C) Creates a new environment and swaps DNS D) Updates instances one at a time sequentially
Answer: B
Explanation: Rolling with Additional Batch launches an extra batch of instances first to maintain full capacity during the rolling update. Full service capacity is preserved throughout the deployment. Plain Rolling temporarily reduces capacity. It is suitable when availability is critical and the temporary cost increase is acceptable.
Q29. What is the key difference between ECS Fargate and EC2 Launch Type?
A) Fargate is a fixed cost; EC2 is usage-based B) Fargate requires no server management; EC2 Launch Type requires managing EC2 instances directly C) EC2 Launch Type is serverless D) Fargate does not support Windows containers
Answer: B
Explanation: Fargate is a serverless container execution environment — no need to provision or manage EC2 instances. You pay based on vCPU and memory usage. EC2 Launch Type requires you to manage the EC2 instances running ECS, but offers more flexibility for GPU workloads, specialized instance types, and cost optimization.
Q30. Why would you add a Manual Approval step in CodePipeline?
A) To speed up deployments B) To require human review and approval before production deployment C) To skip automated tests D) To reduce costs
Answer: B
Explanation: A Manual Approval step requires approval from designated reviewers before the pipeline proceeds to the next stage. It acts as a gate where QA teams or managers review changes before production deployment. SNS notifications can alert reviewers, who can approve or reject via the console, CLI, or API.
Q31. What is the correct phase order in a CodeBuild buildspec.yml?
A) install → pre_build → build → post_build B) build → test → deploy → clean C) pre_build → build → post_build → install D) setup → build → verify → deploy
Answer: A
Explanation: The buildspec.yml phases are: install (install packages, set runtime) → pre_build (login, download dependencies) → build (actual build commands) → post_build (package, push to ECR, notifications). Each phase is optional; if a phase fails, subsequent phases are not executed.
Q32. What does enabling image security scanning in ECR (Elastic Container Registry) provide?
A) Automatic image deletion B) Scanning of known CVE vulnerabilities in container images and reporting C) Automatic image updates D) Image encryption
Answer: B
Explanation: ECR image scanning (Enhanced Scanning with Inspector or Basic Scanning) scans OS packages and programming language packages in container images for CVEs. You can configure automatic scanning on push or manual scanning, and findings are reported by severity level.
Q33. In CodeDeploy's appspec.yml, what does the ApplicationStop lifecycle hook event do?
A) Starts the new application version B) Gracefully stops the currently running application C) Rolls back the deployment D) Restarts the server
Answer: B
Explanation: CodeDeploy lifecycle event order: ApplicationStop → DownloadBundle → BeforeInstall → Install → AfterInstall → ApplicationStart → ValidateService. ApplicationStop runs scripts that gracefully shut down the currently running application. The scripts are defined in the previous deployment's appspec.yml.
Q34. What is the role of the .ebextensions directory in Elastic Beanstalk?
A) Only configures environment variables B) Customizes AWS resource provisioning and EC2 instance configuration C) Stores application source code D) Manages SSL certificates
Answer: B
Explanation: .config files (YAML/JSON) in the .ebextensions directory allow customization of EC2 instance configuration, file creation, package installation, command execution, provisioning of AWS resources (RDS, SQS, etc.), and environment variable settings. CloudFormation syntax can be used to define additional resources.
Q35. How can you implement branch protection in AWS CodeCommit?
A) Enable branch protection directly in CodeCommit settings B) Restrict direct pushes to specific branches using IAM policies C) Control pushes with CodePipeline D) Use S3 bucket policies
Answer: B
Explanation: CodeCommit does not have native branch protection like GitHub. You can restrict direct pushes to main/master branches using IAM policy conditions (StringNotEquals, codecommit:References). To enforce a Pull Request-based workflow, remove direct push permissions using IAM.
Domain 4: Troubleshooting and Optimization
Q36. When X-Ray tracing is enabled on a Lambda function, what is the difference between a Segment and a Subsegment?
A) Segments provide more granular information than subsegments B) A Segment represents the entire Lambda function invocation; a Subsegment represents specific operations within it C) Subsegments only track external service calls D) Both concepts are the same
Answer: B
Explanation: In X-Ray, a Segment is the top-level unit of a trace for a single service or request — representing the entire Lambda function invocation. A Subsegment represents individual operations within the segment (DynamoDB queries, HTTP requests, etc.). AWS SDK calls are automatically captured as subsegments, and custom subsegments can also be added.
Q37. What causes a DynamoDB ProvisionedThroughputExceededException and how is it resolved?
A) The table size exceeded its limit — delete data B) Read/write throughput exceeded provisioned RCU/WCU — enable Auto Scaling or increase capacity C) Internet connectivity issue — retry D) Missing IAM permissions — update the policy
Answer: B
Explanation: ProvisionedThroughputExceededException occurs when request throughput exceeds provisioned RCU or WCU. Solutions: (1) Enable Auto Scaling for automatic capacity adjustment, (2) Switch to On-Demand capacity mode, (3) Add DAX to reduce read load, (4) Retry with Exponential Backoff. If caused by a hot partition, reconsider the partition key design.
Q38. How do you monitor CloudWatch Logs in real-time for a specific pattern and receive alerts?
A) Create a CloudWatch Dashboard B) Create a Metric Filter and configure a CloudWatch Alarm C) Export logs to S3 D) Enable CloudTrail
Answer: B
Explanation: CloudWatch Logs Metric Filters filter specific patterns from log events and create custom metrics. For example, filtering "ERROR" creates an error count metric. Attaching a CloudWatch Alarm to this metric sends SNS notifications when a threshold is exceeded.
Q39. What happens when a Lambda function's concurrent execution count reaches the account limit?
A) Lambda automatically scales down B) New requests receive a Throttle error C) Lambda switches to EC2 instances D) Requests are automatically stored in an SQS queue
Answer: B
Explanation: When the account's total concurrent executions limit (default 1,000) is reached, additional Lambda invocations receive throttle errors (HTTP 429). For synchronous invocations, the error is returned directly to the client. For asynchronous invocations, Lambda automatically retries. The limit can be increased via a Service Quota increase request.
Q40. What is the difference between X-Ray Annotations and Metadata?
A) Annotations are indexed and searchable; metadata is not indexed B) Metadata is indexed and searchable; annotations are not indexed C) Both concepts are identical D) Annotations support only numbers; metadata supports all types
Answer: A
Explanation: X-Ray Annotations are key-value pairs (strings, numbers, booleans) that are indexed and can be used to search and filter traces. Metadata can store any JSON-serializable value including objects and arrays, but is not indexed so cannot be used for filtering. Use Metadata for debugging information and Annotations for filterable information.
Q41. What is the default retry behavior for an asynchronous Lambda invocation?
A) No retries B) Up to 2 retries (3 total attempts), then moves to DLQ on failure C) Infinite retries D) 1 retry then terminates regardless of success
Answer: B
Explanation: When a Lambda asynchronous invocation fails, Lambda automatically retries up to 2 times (3 total attempts). Retry intervals increase progressively. If all 3 attempts fail, the event is sent to the configured Dead-Letter Queue (SQS or SNS). Configuring a Lambda Destination routes success/failure events to other AWS services.
Q42. When would you use high-resolution custom metrics in CloudWatch?
A) When you want to retain metrics for longer B) When you need granular monitoring at sub-minute intervals (1-59 seconds) C) When you want to reduce costs D) When aggregating metrics across multiple regions
Answer: B
Explanation: Standard resolution metrics are published in 1-minute intervals. High-resolution metrics support up to 1-second granularity for more detailed monitoring. However, high-resolution metrics cost more than standard metrics. Use them for scenarios requiring second-level precision, such as financial transactions or gaming events.
Q43. Which is a common use case for DynamoDB Streams?
A) Backing up a DynamoDB table B) Triggering Lambda via data change events to propagate changes to other systems C) Improving DynamoDB read performance D) Creating global tables
Answer: B
Explanation: DynamoDB Streams records item-level changes (INSERT, MODIFY, REMOVE) in order. Using Lambda event source mapping to process stream records enables: propagating changes to other databases, sending email notifications, updating search indexes, and generating audit logs. Stream records are retained for 24 hours.
Q44. What is a common cause of a 502 Bad Gateway error in API Gateway?
A) Malformed client request B) Lambda function or backend returned a malformed response or timed out C) Insufficient IAM permissions D) API Gateway cache is full
Answer: B
Explanation: API Gateway 502 Bad Gateway is a backend integration error. Common causes: (1) Lambda function returns a response in an unexpected format (missing statusCode, headers, body), (2) Lambda function throws an unhandled exception, (3) Lambda timeout (API Gateway timeout: 29 seconds). 401/403 are auth errors, 400 is a bad request, 500 is an internal server error.
Q45. What factors affect Lambda cold start duration?
A) Only invocation frequency B) Runtime type, deployment package size, VPC configuration, and initialization code execution time C) Only AWS region D) Only the number of Lambda Layers
Answer: B
Explanation: Factors affecting Lambda cold start: (1) Runtime type (Java/C# slower than Python/Node.js), (2) Deployment package size (larger packages take longer to download), (3) VPC configuration (extra latency for ENI creation), (4) Initialization code (code outside handler runs once), (5) Lambda Layers. To minimize cold starts: smaller packages, Provisioned Concurrency, lightweight runtimes.
Q46. Under what condition does an SQS message move to the Dead-Letter Queue (DLQ)?
A) When the message size exceeds 256 KB B) When the message has failed processing maxReceiveCount times C) When the queue capacity is full D) Every time the VisibilityTimeout expires
Answer: B
Explanation: The SQS DLQ automatically receives messages from the source queue that have been received (but not deleted) more than maxReceiveCount times. For example, with maxReceiveCount=3, a message moves to the DLQ after 3 failed processing attempts. Analyze DLQ messages to identify failure causes or move them to a reprocessing queue.
Q47. What is the problem with this Lambda function code?
import boto3
def handler(event, context):
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('MyTable')
response = table.scan()
return response['Items']
A) The boto3 import is incorrect B) The DynamoDB client is initialized inside the handler and cannot be reused C) The scan() method cannot be used in Lambda D) The return format is incorrect
Answer: B
Explanation: The DynamoDB resource object is initialized inside the handler function, so it is recreated on every invocation. This does not take advantage of execution context reuse. Initializing it outside the handler (at global scope) reuses the existing connection on warm executions, improving performance. Also, Scan reads the entire table and is expensive — consider replacing with Query.
Q48. Which CloudWatch Logs Insights query finds ERROR logs from a Lambda function?
A) SELECT * WHERE level = 'ERROR' B) fields @timestamp, @message | filter @message like /ERROR/ | sort @timestamp desc C) GET errors FROM lambda_logs D) SEARCH 'ERROR' IN CloudWatch
Answer: B
Explanation: CloudWatch Logs Insights uses its own query language. The fields command selects fields to display, filter filters for a specific pattern, and sort orders results. Use like /ERROR/ or like /Exception/ to find error logs. Use stats count(*) by bin(5m) to aggregate error counts over time.
Q49. What is the primary purpose of Usage Plans and API Keys in API Gateway?
A) Strengthening API security B) Limiting request counts and rates to prevent abuse and enable monetization C) API version management D) Enabling caching
Answer: B
Explanation: Usage Plans set throttling (requests per second: RPS, burst size) and quota (total requests per day/week/month) per API key. Issuing API keys and associating them with usage plans allows applying different limits per customer. Useful for API monetization, partner API provisioning, and abuse prevention.
Q50. What is the maximum timeout setting for a Lambda function?
A) 5 minutes B) 10 minutes C) 15 minutes D) 30 minutes
Answer: C
Explanation: The maximum execution timeout for a Lambda function is 15 minutes (900 seconds). The default is 3 seconds. For tasks exceeding 15 minutes, use Step Functions (state machines), ECS tasks, or EC2 instances. When a timeout occurs, Lambda forcibly terminates the function and retries for asynchronous invocations.
Q51. Why does the Single-Table Design pattern in DynamoDB use overloaded partition keys and sort keys?
A) To reduce DynamoDB costs B) To store multiple entity types in a single table and support efficient queries without joins C) To improve data encryption D) To simplify backups
Answer: B
Explanation: DynamoDB does not support join operations. Storing related entities in a single table with overloaded partition and sort keys allows retrieval of related data with a single GetItem or Query. Example: PK=USER#123, SK=USER#123 (user info), SK=ORDER#456 (order info). This pattern is popularized by Rick Houlihan's design approach.
Q52. Which correctly describes the SNS fan-out pattern?
A) SNS delivers a message to a single SQS queue B) A message published to an SNS topic is simultaneously delivered to multiple SQS queues, Lambda functions, and HTTP endpoints C) SQS triggers multiple Lambda functions simultaneously D) A single Lambda publishes to multiple SNS topics
Answer: B
Explanation: In the SNS fan-out pattern, publishing one message to an SNS topic delivers it simultaneously to all subscribed endpoints (SQS queues, Lambda functions, HTTP/HTTPS, email, SMS). For example, an order completion event can simultaneously trigger email notifications, inventory updates, and shipping processing.
Q53. What is the characteristic of an Elastic Beanstalk Worker environment?
A) A web server handling internet traffic B) Polls an SQS queue and processes background tasks C) An environment specialized for database processing D) Runs only Fargate containers
Answer: B
Explanation: Elastic Beanstalk Worker environments include a built-in SQS daemon (sqsd) that polls the SQS queue and delivers messages to the application via HTTP POST requests. They work with Web Server Tier environments to process asynchronous background tasks (image processing, email sending, data processing, etc.).
Q54. Which is an example of a resource replacement occurring during a CloudFormation stack update?
A) Changing an EC2 instance's tags B) Upgrading an RDS instance's DB engine version C) Changing an S3 bucket name D) Changing a Lambda function's memory setting
Answer: C
Explanation: An S3 bucket name is an immutable property — changing it causes the existing bucket to be deleted and a new bucket with the new name to be created (replacement). Changing EC2 tags or Lambda memory are in-place updates. CloudFormation documents the update type for each property as 'Update requires: Replacement', 'Update requires: No interruption', or 'Update requires: Some interruptions'.
Q55. When S3 Event Notifications trigger Lambda, what invocation type is used?
A) Synchronous invocation B) Asynchronous invocation C) Poll-based invocation D) Streaming invocation
Answer: B
Explanation: When S3 Event Notifications trigger Lambda, asynchronous (Event) invocation is used. S3 publishes the event to Lambda and does not wait for a response. Lambda automatically retries on failure, and DLQ or Lambda Destination configurations are available. SNS, SES, and CloudWatch Events also use asynchronous invocation.
Q56. Which correctly describes DynamoDB TransactWriteItems?
A) Applies only to a single partition B) Supports atomic ACID transactions for up to 100 items C) Executes asynchronously only D) Used only for read-only operations
Answer: B
Explanation: TransactWriteItems performs atomic write operations across multiple tables for up to 100 items (or 4 MB). All operations succeed or all fail (ACID). You can combine Put, Update, Delete, and ConditionCheck operations. TransactGetItems supports read transactions. Transactional operations consume 2x the read/write capacity of standard operations.
Q57. What is the maximum size of all Lambda function environment variables combined?
A) 4 KB B) 8 KB C) 16 KB D) 32 KB
Answer: A
Explanation: The total size of all Lambda environment variables is limited to 4 KB. Values exceeding this limit should be stored in SSM Parameter Store or Secrets Manager and retrieved at runtime via API. Environment variables are separate from the function deployment package, allowing configuration updates without code changes.
Q58. What is the secure way to pass environment variables to a CodeBuild build environment?
A) Hardcode them directly in buildspec.yml B) Use Parameter Store or Secrets Manager references C) Store them in the source code repository D) Read from a plaintext file in an S3 bucket
Answer: B
Explanation: Sensitive environment variables (API keys, passwords) in CodeBuild should not be written directly in buildspec.yml. Instead, reference SSM Parameter Store SecureString parameters or Secrets Manager secrets. In buildspec.yml, use the parameter-store or secrets-manager fields to reference them — they are automatically decrypted and set as environment variables at build time.
Q59. What is the minimum number of days that must elapse before an S3 object can transition to Glacier via a Lifecycle Policy?
A) 1 day B) 30 days C) 60 days D) 90 days
Answer: B
Explanation: The minimum period for transitioning from S3 Standard directly to S3 Glacier Flexible Retrieval is 30 days. From S3 Standard-IA to Glacier is also 30 days. For Glacier Instant Retrieval, the minimum transition period is 90 days. Misconfigured Lifecycle Policies can lead to unexpected costs.
Q60. What is a use case for API Gateway Stage Variables?
A) Storing user authentication credentials B) Referencing different Lambda function ARNs or endpoints per environment (dev/staging/prod) C) Automatically incrementing the API version D) Storing cache settings
Answer: B
Explanation: Stage Variables are key-value pairs that can hold different values per API Gateway stage. For example, set a lambdaAlias variable to "dev" in the dev stage and "prod" in the prod stage, then reference it in the Lambda integration URI with stageVariables.lambdaAlias. This supports multiple environments with a single API definition.
Q61. Why use Lambda Versions and Aliases when updating a Lambda function?
A) To reduce costs B) To enable traffic splitting (Canary deployments) and provide stable ARN references C) To increase execution speed D) To activate logging
Answer: B
Explanation: Lambda Versions are immutable snapshots of deployed code and configuration. Aliases are named pointers to specific versions (or $LATEST). Attaching alias ARNs to API Gateway or event sources means only the alias needs updating when deploying a new version. Aliases also support routing configurations to split traffic between two versions (e.g., v1=90%, v2=10%) for Canary deployments.
Q62. In which scenario would you use a Conditional Write in DynamoDB?
A) For data encryption B) To implement optimistic locking or to insert an item only if it does not already exist C) To improve read performance D) To enable automatic indexing
Answer: B
Explanation: DynamoDB Conditional Writes perform write operations only when a specified condition is true. Examples: attribute_not_exists(pk) prevents duplicate inserts; checking a version attribute enables optimistic locking. A ConditionalCheckFailedException is thrown when the condition fails. WCUs consumed are the same regardless of whether the condition succeeds.
Q63. What information can you see on an AWS X-Ray Service Map?
A) AWS cost information B) Service connections, response times, error rates, and request counts C) IAM permission information D) Network bandwidth usage
Answer: B
Explanation: The X-Ray Service Map visualizes the topology of your application. Each node represents a service (Lambda, DynamoDB, API Gateway, etc.) and displays average response time (latency), requests per minute, error rate (4xx), and fault rate (5xx). Arrows between nodes show call relationships. It helps visually identify performance bottlenecks and error-prone services.
Q64. Which statement correctly describes Lambda's /tmp directory?
A) Not shared between function invocations and cannot be used as persistent storage B) Provides up to 10 GB of temporary storage; data may persist when the same container is reused C) All Lambda functions share the same /tmp directory D) The /tmp directory is not encrypted
Answer: B
Explanation: Lambda's /tmp directory provides up to 10 GB of temporary storage (default 512 MB, configurable). Data stored in /tmp may persist when the same execution environment (container) is reused (warm execution). This can be leveraged for caching, but sensitive data must be cleaned up for security. It is not shared with other Lambda instances.
Q65. Which services use Lambda Event Source Mapping?
A) S3, SNS, API Gateway B) SQS, Kinesis Data Streams, DynamoDB Streams, MSK, MQ C) CloudWatch Events, EventBridge, SNS D) CodeCommit, CodePipeline, CodeDeploy
Answer: B
Explanation: Event Source Mapping is used for stream/queue-based services that Lambda actively polls: SQS, Kinesis Data Streams, DynamoDB Streams, Apache Kafka (MSK), and Amazon MQ. The Lambda service polls these sources directly and processes messages in batches. In contrast, S3, SNS, API Gateway, and EventBridge directly invoke Lambda (push model).
Exam Strategy
- Focus on core services: Lambda, DynamoDB, API Gateway, SQS, and Cognito account for 50%+ of questions
- Hands-on practice: Build real experience using AWS Free Tier
- Official docs: Study each service's developer guide and API reference
- Whitepapers: AWS Security Best Practices and Serverless Architecture whitepapers are essential
- Exam tips: Watch for keywords like "most efficient", "cost-effective", and "minimum operational overhead"