| | | |
I.1 | ✅ | Improve performance of S3 upload | Multipart upload. How about Transfer Acceleration? |
I.2 | ✅ | Caching: Lazy-load & Write-through | |
I.3 | ✅ | Lambda: Different parameter depends on environment | Environment variable (# Stage variable) |
I.5 | ✅ | API Gateway: same API Gateway for multiple environments | Stage variable |
I.6 | ✅ | CloudWatch Alarm: When to alarm? | Period / Evaluation Periods / Data points to Alarm |
I.7 | ✅ | SAM: Nested application | AWS::Serverless::Application |
I.8 | ✅ | Lambda deploy: Graduate increase traffic to new version | Lambda supports traffic shifting for aliases (by setting traffic weight ). (That’s why SAM have canary , linear deployment strategy ) |
I.9 | ✅ | API Gateway: Map data for microservice (in container) | Use HTTP integration (Not AWS or _PROXY ) |
I.10 | ✅ | Database scale globally, handle frequent schema changes | DynamoDB (not Aurora) |
I.11 | ✅ | API Gateway - TTL 300s. How client can invalidate cache? | Send request with Cache-Control: max-age=0 header |
I.13 | ✅ | Session data store on DynamoDB. Delete session of logged out users? | Use DynamoDB TTL (when will an item is eligible for expiration - in epoch time) |
I.15 | ✅ | Serve content based on location | - CloudFront can add header about viewer location’s location (based on the viewer’s IP address). |
I.16 | ✅ | What to do after update Cfn template of a Lambda function? | 1. aws cloudformation package : Uploads local artifacts to S3, update Cfn template to reference these artifacts |
I.17 | ✅ | Multi-thread key-value cache store | Elasticache for Memcached |
I.19 | ✅ | Process long-running tasks | Elastic Beanstalk worker environment (an HTTP request handler that EB invokes with an SQS queue) |
I.20 | ✅ | ECS: Where to config port for container? | Task definition |
I.22 | ✅ | Can Lambda handle 10 requests/s (each request take 50s) | 500 concurrent execution (Lambda can handles without doing anything. The default limit is 1.000) |
I.23 | ✅ | DynamoDB table attributes: UserID (PK) - GameTitle (SK) - TopScore. Get max TopScore of each game? | Create a Global Secondary Index: GameTitle (PK) - TopScore (SK). Query 1 item for each game in descending order. |
I.24 | ✅ | Kinesis Data Streams: How many worker is optimal to process a number of shards? | 1:1 ratio |
I.25 | ✅ | AWS CLI timeout when list bucket with 10.000 objects | Add pagination parameter when use AWS CLI |
I.26 | ✅ | Permission to Create/Delete GitCommit repos | codecommit:CreateRepository & codecommit:DeleteRepository |
I.27 | ✅ | DynamoDB Streams: Send a copy of old item to S3 | StreamViewType : OLD_IMAGE |
II.1 | ✅ | RDS + Lambda + Translate text with Amazon Translate. Improve performance, reduce load to RDS? | Use Lambda execution environment /tmp as cache store |
II.2 | ✅ | DynamoDB: Employee info. Which attribute use as primary key? | employee_id |
II.3 | ✅ | Run a Lambda function every 30min? | Use EventBridge Schedule Rule to create scheduled events -> target the Lambda function |
II.4 | ✅ | ECS integrate with API Gateway. Which integration make no intervention? | HTTP_PROXY |
II.5 | ✅ | Which API to call to get permission (from a IAM Role) to interact with S3 API | AWS STS AssumeRole API (or AssumeRoleWithWebIdentity , AssumeRoleWithSAML ) (optionally pass an SessionPolicy ) |
II.6 | ✅ | Asynchronous invoke Lambda function with Invoke API | Pass parameter InvocationType - Event |
II.11 | ✅ | DynamoDB: Write heavy - ProvisionedThroughputExceededException . Why? | RCU/WCU of GSI is separate from base table |
II.12 | ✅ | CodeCommit: Permission to fetch , clone , push | codecommit:GitPull , codecommit:GitPush |
II.13 | ✅ | Elastic Beanstalk: Deploy new version with CLI | Package app as zip /war file. Deploy with eb deploy (EB CLI is a different package. It’s not packaged with AWS CLI, not aws eb ) |
II.14 | ✅ | Internal app: elastic, cost-effective | DynamoDB, EC2 Spot Fleet |
II.15 | ✅ | Build an CI/CD to deploy to both EC2 & on-premise. Which service? | CodeDeploy |
II.16 | ✅ | DynamoDB: 10 RCU, each item 4KB. How much read request/s the table can handle? | 10 RCU: 10 Strong Consistency Read - 20 Eventually Consistency Read |
II.17 | ✅ | Prototype microservices on ECS. Which task placement minimize cost? | Binpack, random, spread |
II.18 | ✅ | Temporary AWS credential for both authenticated/unauthenticated. Which service? | Cognito Identity Pool (Federated Identity) |
II.20 | ✅ | SQS: Duplicated messages. How to fix? | For SQS, when call SendMessage API, add MessageDeduplicationId param |
II.21 | ✅ | DynamoDB: Protect from overwritten? | Implement optimistic locking with version number (ensure update the right version item) |
II.22 | ✅ | Lambda: Asynchronous invoke, exponential back-off, then send un-processed messages to another service. | Lambda supports Dead Letter Queue (just as SQS DLQ) |
II.23 | ✅ | Collect visitor click to ads. Which service? | DynamoDB: Use UpdateItem to implement atomic counter (Approximately ~ Add 1 to previous value) |
II.24 | ✅ | DynamoDB: Read 100 items. Which API? | BatchGetItem (instead of GetItem ) then BatchWriteItem |
II.25 | ✅ | DynamoDB: Store recent updated item automatically | 1. DynamoDB Streams + Lambda (not recommend) |
II.26 | ✅ | DynamoDB: Session data. Reduce storage without using provision throughput | Use DynamoDB TTL |
II.27 | ✅ | Kinesis Data Streams: How to handle data flow (Scaling)? | 1. Split shards to increase stream capacity; 2. Merge shards to decrease stream capacity. |
II.28 | ✅ | Kinesis Data Streams: Consumer process every other day & store to S3. S3 only has half of the data? | Kinesis Data Streams default retention period is 24h (up to 365 days) |
II.29 | ✅ | An AWS account has 2 Lambda function. 1 works optimal, 1 is throttled. Why? | The reserve concurrency execution of function 1 is higher |
II.30 | ✅ | Lambda: Process events from S3 Events. 10 events/s, each event takes 3s. How much concurrency? | Concurrency: number of in-flight request AWS Lambda function is handling at the same time. |
II.32 | ✅ | Protect AWS APIs call with MFA | MFA-enabled IAM users must call GetSessionToken and submit an MFA code that is associated with their MFA device. |
II.34 | ✅ | Website hosted on S3 bucket_A , make GET request to S3 bucket_B . API calls are blocked by browsers? | Enable CORS on bucket_B |
II.35 | ✅ | Migrate repos from Github to CodeCommit | 1. Create repos on CodeCommit; 2. Clone repos from Github; 3. Push to CodeCommit repos |
II.36 | ✅ | Lambda: Increase CPU? | By increase memory |
II.37 | ✅ | ECS: Integrate with X-Ray. How to provide more granular timing information? | Use sub-segment |
II.38 | ✅ | Version control system. Which service? | CodeCommit |
II.39 | ✅ | API Gateway: Non-proxy integration with Lambda. How to ensure consumer include a query string? | Use method request |
III.1 | ✅ | Replace spreadsheet-based tracking system. DynamoDB. | EDA: DynamoDB Streams + Lambda + SNS |
III.2 | ✅ | Collect real-time user data | Kinesis Data Streams |
III.4 | ✅ | CodeCommit, CodeBuild, CodeDeploy, CodePipeline. A central dashboard? | CodeStar |
III.5 | ✅ | Cfn: Reuse value from a stack? | Outputs/Export & Fn::ImportValue |
III.6 | ✅ | Hundreds of thousands of reads/writes per second. Which database? | DynamoDB |
III.7 | ✅ | DynamoDB: Bidding system. | DynamoDB Streams + Lambda + Conditional Write |
III.8 | ✅ | DynamoDB: Query a single table | LSI (when create the table) |
III.9 | ✅ | DynamoDB: Throttled. Hot partition. Fix minimal effort? | Refactor to evenly distribute between partitions; Retries with exponential backoff |
III.10 | ✅ | CodeCommit: Setup? | 1. Git credential - HTTPS (username/password); 2. SSH connection (SSH key-pair) |
III.11 | ✅ | DynamoDB: 1.5KB. Write 100 items/s. WCU 100 but throttled. Fix? | Increase WCU to 200. |
III.13 | ✅ | SQS: Duplicate message | SQS FIFO + SendMessage with DeduplicationID |
III.15 | ✅ | ECS: Place task between AZs? | Spread |
III.17 | ✅ | Sync user data without your backend. | Cognito Sync (delegated use AppSync) |
III.21 | ✅ | SQS: Config Dead Letter Queue | Just provide ARN of the queue to DeadLetterConfig |
III.22 | ✅ | Elastic Beanstalk: Web app process large number of items from DynamoDB. Overload. Easiest fix? | Use Batch operations for Get , Put , Delete |
III.23 | ✅ | DynamoDB: Send welcome mail for new user. How? | DynamoDB Streams + Lambda + SNS |
III.24 | ✅ | DynamoDB: Table - FighterID (PK) - FilterTitle (SK). Query by other attributes? | Create a GSI |
III.25 | ✅ | DynamoDB: + Elasticache. Write data if cache miss. Improve? | Add write-through + TTL |
III.26 | ✅ | Kinesis Data Streams: 100 shards, Lambda (10 seconds/request, 50 items/seconds) | Maximum of 100 Lambda concurrency = number of shards |
III.27 | ✅ | Cfn: How to automate the process of getting latest AMI? | Use System Managers Parameter Store |
III.28 | ✅ | SQS: Process tool long & messages appear twice | Increase visibility timeout |
III.29 | ✅ | CloudFront: Slow to login & 504 | Authentication@Edge + Origin fail over |
III.30 | ✅ | Lambda: Increase CPU? | By increasing memory |
III.31 | ✅ | API Gateway: Implement APIs form current Swagger spec. | Just import the OpenAPI/Swagger file. |
III.32 | ✅ | Microservice using Docker + Fine-grain control | ECS |
III.33 | ✅ | Quickly deploy Node app (provisioning, load balancing, ASG…) | Elastic Beanstalk |
III.34 | ✅ | Amplify: config? | amplify.yaml |
III.35 | ✅ | S3: Cross-Region Replication. Fail. Why? | Maybe Object Versioning is not enable |
III.36 | ✅ | S3: Upload Terabytes of data from over the worlds. Slow. Improve speed? | S3 Transfer Acceleration |
III.37 | ✅ | API Gateway: Reuse same function for different stage (different DynamoDB table) | Stage variable + mapping template |
IV.1 | ✅ | Automatically watermark images uploaded to S3 | Use S3 Event Notification s3:ObjectCreate:Put . Send the event to Lambda function (destination) (# S3 Object Lambda) |
IV.2 | ✅ | Lambda function: access RDS in private subnet | Connect to the VPC |
IV.3 | ✅ | API Gateway + Lambda: Map incoming request to integration request & vice versa | AWS custom (Lambda custom) |
IV.4 | ✅ | Which cache strategy ensured cached data is always up-to-date & stale data are automatically deleted? | Write-through + With TTL |
IV.5 | ✅ | DynamoDD: How to prevent data overwritten? | Optimistic locking + Conditional writes (check version number) |
IV.6 | ✅ | Database credential: How to encrypted & auto-rotate? | Use Secrets Manager + Enable Automatic Rotation |
IV.7 | ✅ | S3: Use SQL to filter & retrieve only a subset data of an object? | S3 Select (supports CSV, JSON, Apache Parquet & compressed CSV, JSON) |
IV.9 | ✅ | DynamoDB - GSI: How much throughput to provision? | GSI WCU >= Base table WCU |
IV.10 | ✅ | DynamoDB: 2KB items - 10 writes/s - 20 eventually consistent reads/s. How much RCU/WCU? | 2KB ➡️ 1 strongly consistent read = 1 RCU ➡️ 1 eventually = 0.5 RCU ➡️ 20 eventually = 10 RCU |
IV.11 | ✅ | 1 item = 17KB. 320 strongly consistent read/s. How much RCU? | 17KB/item ➡️ 5RCU/strongly consistent read ➡️ 320 strongly read = 320 x 5 = 1600 RCU |
IV.12 | ✅ | HTML, JS, image, video. How to server with lowest latency around the world? | S3 + CloudFront |
IV.13 | ✅ | AI-based app built with Lambda. How to modify the way invocation event are read form Lambda runtime API? | Use Lambda custom runtime |
IV.14 | ✅ | Migrate monolith on-premise app to Lambda. Best practice? | 1. Take advantage of execution runtime ; 2. Use environment variable… |
IV.16 | ✅ | Online game - Sync app pref + state of player + Allow multiple player to share state | App Sync (Cognito Sync not support shared data) |
IV.17 | ✅ | AWS CLI in EC2 instance. How to easily switch role? | 1. Create a new CLI profile with credential; 2. Run aws CLI with --profile |
IV.18 | ✅ | DynamoDB: Ensure item is updated only some attribute meets some condition | Conditional writes |
IV.19 | ✅ | DynamoDB: Debug throughput of both base table & GSI when update item? | Call UpdateItem with ReturnConsumedCapacity set to None / Total / Indexes |
IV.20 | ✅ | DynamoDB Streams: How to integrate with Lambda? | 1. Create an EventSourceMapping to poll the DynamoDB stream, read & process records |
IV.21 | ✅ | Serverless app: Which service can manage configuration & deploy the whole stack + simple? | AWS SAM (Serverless Application Model) |
IV.22 | ✅ | DynamoDB: Table: ArticleName (PK) - Category (SK). Query ArticleName using another Sort Key + Strongly consistent read | Create a new table with Local Secondary Index (LSI). Migrate the existing data to new table (LSI cannot be created after the DynamoTB is created) |
IV.23 | ✅ | S3: Ensure all objects are encrypted with AE256 | Use bucket policy to deny any Create request doesn’t have x-amz-server-side-encryption: AE256 header |
IV.24 | ✅ | EC2: Shell script to get instance public/private IP | Use Instance Metadata Service endpoint 169.254.169.254/latest/meta-data |
IV.25 | ✅ | Lambda: Account concurrency limit 2000; 10 functions: 1 function 400, 1 function 200. The rest, the third? | The rest: 1400; the third: 1300. |
IV.26 | ✅ | Coordinate multiple services into serverless workflow. Which service? | AWS Step Functions |
IV.27 | ✅ | API Gateway: Enable caching. How to invalidate 1 key? | Send the request with Cache-Control: max-age=0 |
IV.28 | ✅ | Lambda: Connection refused. Why? | Maybe the invoke URL is wrong (http without s ) |
IV.29 | ✅ | Lambda: Improve performance? | Increase memory will increase CPU too. |
IV.30 | ✅ | Lambda: A function initialize DB connection every time it executes. How to optimize? | Move the DB connection to shared execution context (outside handler) |
IV.31 | ✅ | Lambda: Can the function built with Rust? | Yes. Use custom runtime |
IV.32 | ✅ | Lambda: A function fetch 20MB static data every time it executes. How to optimize? | Place the initialize outside Lambda handler; saved external file to /tmp |
IV.34 | ✅ | Online game. How to add feature to cross-sync profile data between device? | Use Cognito Sync (or App Sync) |
IV.35 | ✅ | DynamoDB: Which attribute to use as partition key? | The partition should uniquely identify each item |
IV.36 | ✅ | CodePipeline: Push build details into a DynamoDB? | Use EventBridge & Lambda |
V.2 | ✅ | API Gateway & Lambda: New version. Smooth migration | Update Lambda function -> Deploy new version. Specify new ARN in API Gateway integration. Redeploy to new stage. |
V.3 | ✅ | Elastic Beanstalk: Path of config file | /.ebextensions/xxx.config |
V.4 | ✅ | Lambda: Ephemeral storage | /tmp |
V.5 | ✅ | Lambda: How to use Ruby? | Ruby’s natively support |
V.6 | ✅ | CloudFront: Update image immediately | Use file name versioning |
V.7 | ✅ | Cognito: Authentication with JWT | 1. Create User Pools |
V.9 | ✅ | S3: Lowest cost | Glacier Deep Archive |
V.10 | ✅ | EC2: Run Apache web server | Use user-data to install and start Apache web server |
V.11 | ✅ | App host in 1 region. Re-create on other regions using AMI & CloudFormation. How? | Use Cfn Mapping & FindInMap |
V.12 | ✅ | Serverless app. Application code & infrastructure code in Python. How? | Use CDK and Python |
V.13 | ✅ | Step Functions: Handle error? Aggregate data in different states? | Use Catch & ResultPath |
V.15 | ✅ | DynamoDB: Control access to individual items & attributes? | Fine-grain access control with |
V.16 | ✅ | Cognito: UI for login page missing brand logo | Cognito allows customization for: logo, CSS. |
V.17 | ✅ | SQS queue: messages larger than 256KB. | Use Amazon S3, (for Java) Extended Client Library |
V.20 | ✅ | API Gateway: Integrate a XML-based SOAP API. How? | Use HTTP Integration: |
V.21 | ✅ | Serverless: Send newsletter at 7-day interval. How? | Use EventBridge Schedule Rule to create events at 7-day interval, sends the events to Lambda function target |
V.23 | ✅ | DynamoDB: Group multiple actions to multiple items to a one-or-nothing operation? | Use TransactionWriteItems |
V.24 | ✅ | DynamoDB: When an item added to Customer table, dynamically update Payment table. How do it in real time? | Enable DynamoDB Streams for Customer table, trigger a Lambda function to update Payment table |
V.25 | ✅ | ALB: Obtain all value of identical query parameter key. | Enable multi-value headers |
V.26 | ✅ | ECS: 2 containers share logs. How? | Define these 2 containers in 1 task definition, use EFS as a volume |