AWS Difference Between Interview Questions: Compute, Storage and Database Comparisons with Tables (Lambda vs EC2, S3 vs EBS, RDS vs DynamoDB) (50 Questions)
This page has 50 AWS comparison interview questions on compute, storage and databases. Every answer has a short table and a "when to pick which" line, because that is exactly how a good interview answer to "what is the difference between X and Y?" should sound.
1. An everyday example: choosing a vehicle
Why do interviewers love "difference between" questions?
They show whether you understand what each service is for, not just its name. A good answer compares on a few clear points and ends with a decision for a real situation.
Choosing between AWS services is like choosing a vehicle. A scooter (Lambda) is perfect for short trips, a car you own (EC2) goes anywhere but needs maintenance, and a taxi (Fargate) takes you there without owning anything. None is "best"; each wins for a certain trip.
How to use this page
- For each pair, learn the table's three or four rows and the final "pick" line.
- In interviews, start with one sentence on what each service is, then compare, then decide.
- Prices and limits change; the tables describe how services work, not exact numbers.
2. Fresher level questions
Start here if you are a fresher or have less than two years of experience. Try to answer each question aloud first. Then open it and compare.
Q1. Lambda or EC2: how do they differ for running application code, and when do you pick each? Fresher
| Point | Lambda | EC2 |
|---|---|---|
| What you manage | Only code and settings | OS, patching, scaling, runtime |
| Run time | Up to 30 minutes per on-demand Event Function invocation | Runs as long as you want |
| Scaling | Automatic per request | Auto Scaling groups you configure |
| Billing | Per request and per ms of duration | Per second while running |
Pick Lambda for event-driven, spiky or short tasks (API backends, file processing, schedules). Pick EC2 for long-running processes, special OS or hardware needs, or steady high load where always-on servers are cheaper.
Q2. Amazon S3 or Amazon EBS: what is the real difference, and where does each fit? Fresher
| Point | S3 | EBS |
|---|---|---|
| Type | Object storage over HTTPS API | Block storage, a disk for one instance |
| Access | From anywhere with permission | Attached to an EC2 instance in one AZ |
| Scale | Practically unlimited | Fixed size you provision (can grow) |
| Use | Files, backups, data lakes, static assets | OS disks, databases, apps needing a file system |
Pick S3 for files that many systems read or that must last cheaply. Pick EBS when an application needs a local disk with low latency, such as a database on EC2.
Q3. Should a simple company website run on S3 static hosting or on an EC2 web server? Fresher
| Point | S3 (with CloudFront) | EC2 web server |
|---|---|---|
| Content | Static only: HTML, CSS, JS, images | Static and server-side code (PHP, Node, Java) |
| Operations | No servers to patch | You patch, monitor and scale |
| Availability | Very high by default | Depends on your design (multi-AZ, load balancer) |
| Cost at low traffic | Very low | An instance runs all the time |
Pick S3 plus CloudFront for brochure sites, documentation and single-page apps calling APIs. Pick EC2 (or containers) when pages are generated on the server or need a CMS like WordPress.
Q4. Amazon S3 or Amazon EFS for files that several servers need: how do you decide? Fresher
| Point | S3 | EFS |
|---|---|---|
| Interface | API calls (GET, PUT) or SDK | Normal file system (NFS mount) |
| File changes | Replace whole objects | Edit part of a file, lock files |
| Latency | Higher per request | Lower, file-system style |
| Cost per GB | Lower | Higher |
Pick S3 when the application can use the S3 API (uploads, media, exports). Pick EFS when existing software expects a shared POSIX directory and cannot be changed.
Q5. Amazon RDS or DynamoDB: how do you explain the choice to a fresher-level interviewer? Fresher
| Point | RDS | DynamoDB |
|---|---|---|
| Model | Relational tables, SQL, joins | Key-value and document items, no joins |
| Scaling | Bigger instance, read replicas | Automatic, very large scale |
| Schema | Fixed columns | Flexible attributes per item |
| Queries | Any SQL query | By key or index, designed in advance |
Pick RDS when data is relational and queries change often (ERP, banking, reports). Pick DynamoDB for known access patterns at high scale with predictable low latency (carts, sessions, IoT, gaming).
Q6. For a MySQL application, what changes in daily operations if you move from RDS for MySQL to Aurora MySQL? Fresher
| Point | RDS (MySQL/PostgreSQL) | Aurora |
|---|---|---|
| Storage | EBS per instance | Shared cluster volume, six copies across three AZs |
| Replicas | Up to a smaller number, with replication lag | Up to 15 low-lag readers on the same storage |
| Failover | Typically one to two minutes (Multi-AZ instance) | Usually faster, to a reader |
| Cost | Lower for small workloads | Higher instance price, pay for I/O or I/O-Optimized |
Pick RDS for small or cost-sensitive databases, and engines Aurora does not support. Pick Aurora for busy production databases that need fast failover, many readers or global replication.
Q7. Golden AMI versus launch template: what belongs in each when you build an Auto Scaling group? Fresher
| Point | AMI | Launch template |
|---|---|---|
| What it is | The disk image: OS, software, block device mapping | The full launch settings |
| Contains | Root volume snapshot and settings | AMI ID, instance type, key, security groups, user data, IAM profile, tags |
| Versions | New AMI for each change | Numbered versions of one template |
| Used by | Any launch | Auto Scaling groups, EC2 Fleet, console and CLI launches |
Pick both together: bake software into the AMI, and describe how to launch it in a launch template that the Auto Scaling group uses.
Q8. Stop, hibernate or terminate an EC2 instance: what is the difference? Fresher
| Action | RAM contents | EBS root volume | Billing for instance |
|---|---|---|---|
| Stop | Lost | Kept | Stops (EBS still billed) |
| Hibernate | Saved to the root EBS volume and restored | Kept | Stops (EBS still billed) |
| Terminate | Lost | Deleted by default | Stops for good |
Pick stop for servers you need again later. Pick hibernate for apps with long warm-up times (large in-memory caches) where supported. Pick terminate for anything you can rebuild from an AMI or code. Instance store data is lost in all three.
Q9. Burstable T instances or fixed-performance M instances: which should a small web app use? Fresher
| Point | T family (t3, t4g) | M family (m6i, m7g) |
|---|---|---|
| CPU | Baseline plus burst credits | Full CPU all the time |
| Good for | Low average CPU with short spikes | Steady CPU use |
| Risk | Slows to baseline when credits run out (standard mode) or extra charges (unlimited mode) | Paying for CPU you do not use |
Pick T for dev, test and small sites with idle time. Pick M (or C for compute-heavy) when CPU stays high; watch CPUCreditBalance to know when you have outgrown T.
Q10. Virtual machines, containers and functions on AWS: how do you compare them? Fresher
| Point | EC2 (VMs) | ECS/EKS (containers) | Lambda (functions) |
|---|---|---|---|
| Unit | Whole server | Packaged app with its dependencies | One function |
| Start time | Minutes | Seconds | Milliseconds to seconds |
| Control | Most | Medium | Least |
| Ops work | Most | Medium | Least |
Pick VMs for legacy or special software, containers for long-running services and microservices with consistent packaging, and functions for event-driven glue and spiky APIs.
Q11. Object, block and file storage: what is the difference, with AWS examples? Fresher
| Type | How it is used | AWS service |
|---|---|---|
| Object | Whole objects by key over an API | S3 |
| Block | Raw disk blocks, formatted with a file system by one server | EBS, instance store |
| File | Shared folders and files over NFS or SMB | EFS, FSx |
Pick object storage for scale and cheap durability, block for databases and boot disks, and file storage when many servers or users need the same directory tree.
Q12. FSx for Windows File Server or EFS: which one for a Windows application? Fresher
| Point | FSx for Windows | EFS |
|---|---|---|
| Protocol | SMB | NFS (Linux) |
| Identity | Active Directory, NTFS permissions | POSIX users, IAM, access points |
| Clients | Windows (and Linux with SMB) | Linux |
Pick FSx for Windows for any Windows workload or user shares. EFS does not support Windows clients, so it is the choice only for Linux.
Q13. S3 Glacier Instant Retrieval, Flexible Retrieval or Deep Archive: how do you choose? Fresher
| Point | Instant Retrieval | Flexible Retrieval | Deep Archive |
|---|---|---|---|
| First byte | Milliseconds | Minutes to hours (restore) | Hours (restore) |
| Storage cost | Low | Lower | Lowest |
| Typical access | About once a quarter | Once or twice a year | Rarely, compliance |
| Minimum storage | 90 days | 90 days | 180 days |
Pick Instant Retrieval when rare reads must still be immediate, Flexible for backups you might restore in hours, and Deep Archive for records kept for years.
Q14. Horizontal or vertical scaling for an EC2 application: what are the trade-offs? Fresher
| Point | Vertical (bigger instance) | Horizontal (more instances) |
|---|---|---|
| How | Change instance type | Auto Scaling group behind a load balancer |
| Downtime | Usually a stop and start | None, instances added and removed |
| Limit | Largest instance size | Practically none |
| Requirement | None | App must be stateless or share state |
Pick vertical for quick relief or databases that cannot scale out easily. Pick horizontal for web and API tiers, because it also gives high availability across AZs.
Q15. Aurora or Redshift: why not use one for everything? Fresher
| Point | Aurora | Redshift |
|---|---|---|
| Workload | OLTP: many small reads and writes | OLAP: large scans and aggregations |
| Storage format | Row-based | Columnar, compressed |
| Typical query | Get or update one order | Sales by region by month for 5 years |
| Concurrency | Thousands of short transactions | Fewer, heavier queries |
Pick Aurora for the application's live data and Redshift for reporting and analytics, with data moved between them (for example zero-ETL integration).
Q16. DynamoDB or ElastiCache: are they interchangeable for fast lookups? Fresher
| Point | DynamoDB | ElastiCache (Valkey/Redis OSS) |
|---|---|---|
| Role | Durable primary database | In-memory cache or data structure store |
| Latency | Single-digit milliseconds | Sub-millisecond |
| Durability | Data stored across AZs | Memory first; persistence options vary |
| Data types | Items with attributes | Strings, hashes, sorted sets, streams |
Pick DynamoDB when the data must be the source of truth. Pick ElastiCache to cache reads from another database, store sessions, or use structures like leaderboards and rate counters.
Q17. Lambda container images or .zip packages: which should you use? Fresher
| Point | .zip package | Container image |
|---|---|---|
| Size limit | Smaller (deployment package limits) | Up to 10 GB |
| Tooling | Simple upload or S3 | Docker build, push to ECR |
| Layers | Supported | Not used (build everything into the image) |
| Best for | Small functions, quick edits | Large dependencies (ML libraries), existing container pipelines |
Pick .zip for most small functions. Pick container images when dependencies are large or the team already builds and scans containers.
3. Mid level questions
These questions check how you use the service in real projects. Interviewers expect the why, the how and one real example.
Q18. Lambda or Fargate for a backend service: how do you decide? Mid level
| Point | Lambda | Fargate |
|---|---|---|
| Unit | Function per event | Long-running container tasks |
| Max duration | Up to 30 minutes for on-demand Event Functions | No limit |
| Scaling | Per request, to zero | Tasks via service auto scaling, minimum usually one |
| Connections | Short-lived; database connection pooling needs RDS Proxy | Normal connection pools |
| Cost pattern | Cheap when idle, expensive at constant high load | Steady cost, efficient for steady load |
Pick Lambda for spiky, event-driven work and low traffic. Pick Fargate for steady APIs, WebSockets, long jobs or apps already in containers.
Q19. ECS or EKS: which container platform would you choose for a new team? Mid level
| Point | ECS | EKS |
|---|---|---|
| API | AWS-specific, simple | Kubernetes, portable |
| Learning curve | Low | High |
| Ecosystem | AWS integrations | Huge Kubernetes ecosystem (Helm, operators) |
| Cost | No control plane fee | Control plane fee per cluster |
| Upgrades | Managed by AWS | You plan Kubernetes version upgrades |
Pick ECS for small or AWS-only teams who want to ship quickly. Pick EKS when the company already uses Kubernetes, needs multi-cloud portability, or relies on Kubernetes tools.
Q20. Elastic Beanstalk or ECS on Fargate for deploying a web app? Mid level
| Point | Elastic Beanstalk | ECS on Fargate |
|---|---|---|
| Model | Platform that creates EC2, load balancer and scaling for you | Containers you define in task definitions |
| Control | Limited; custom config through extensions | High: networking, sidecars, deployment strategies |
| Packaging | Upload code for a supported platform (or Docker) | Container images |
| Fit | Simple apps, small teams | Microservices and modern pipelines |
Pick Beanstalk to get a classic app online quickly with little AWS knowledge. Pick ECS on Fargate for containerised services you will grow. (App Runner is closed to new customers, so do not plan new work on it.)
Q21. Cluster, spread or partition placement groups: which one when? Mid level
| Type | How instances are placed | Use |
|---|---|---|
| Cluster | Close together in one AZ | Low latency, high throughput HPC |
| Spread | Each on separate hardware racks (limited count per AZ) | Small number of critical instances |
| Partition | Groups (partitions) on separate racks | Large distributed systems like Kafka, HDFS, Cassandra |
Pick cluster for tightly coupled compute, spread for a few servers that must not fail together, and partition for big clusters that understand rack awareness.
Q22. EC2 Image Builder or Packer for building golden AMIs: how do they compare? Mid level
| Point | EC2 Image Builder | Packer |
|---|---|---|
| Type | Managed AWS service | Open-source tool you run (in CI) |
| Pipelines | Built-in schedules, components, tests, distribution to Regions and accounts | You script the pipeline in your CI system |
| Multi-cloud | AWS only (plus container images) | Many clouds and formats |
| Patching | Can rebuild automatically when base images update | You trigger rebuilds |
Pick Image Builder for AWS-only teams that want managed, scheduled, tested images. Pick Packer when you already use it or build images for several platforms from one template.
Q23. Graviton (Arm) or x86 instances: how do you decide for an existing app? Mid level
| Point | Graviton (Arm) | x86 (Intel/AMD) |
|---|---|---|
| Price-performance | Usually better for many workloads | Baseline |
| Compatibility | Needs Arm builds of code and dependencies | Runs everything built for x86 |
| Good fits | Java, Node, Python, Go, containers, managed databases | Windows, binary-only vendor software, specific instruction sets |
Pick Graviton for new services and interpreted or easily recompiled apps (build multi-arch images). Stay on x86 for software without Arm support, and test performance before switching.
Q24. EBS, EFS or FSx: which storage do you give a workload? Mid level
| Point | EBS | EFS | FSx |
|---|---|---|---|
| Access | One instance (Multi-Attach rare) | Many Linux clients | Many clients; Windows, Lustre, ONTAP, OpenZFS |
| Protocol | Block device | NFS | SMB, Lustre, NFS, iSCSI |
| Scope | One AZ | Regional (or One Zone) | Single-AZ or Multi-AZ |
| Best for | Databases, boot disks | Shared Linux content | Windows shares, HPC, enterprise NAS features |
Pick EBS for one server's fast disk, EFS for simple shared Linux storage, and FSx when you need a specific file system's features.
Q25. EFS or FSx for Lustre for a machine learning training job? Mid level
| Point | EFS | FSx for Lustre |
|---|---|---|
| Throughput | Good, scales with Elastic mode | Very high, built for parallel access |
| S3 integration | Copy data in yourself | Linked to S3 buckets, lazy load and export |
| Lifetime | Long-lived shared storage | Scratch for jobs, or persistent |
| Cost model | Pay per GB and throughput | Pay per provisioned capacity |
Pick EFS for shared home directories, notebooks and smaller datasets. Pick FSx for Lustre when many GPU instances read a large dataset and storage speed limits training.
Q26. S3 Standard or Intelligent-Tiering for a new bucket with unknown access patterns? Mid level
| Point | Standard | Intelligent-Tiering |
|---|---|---|
| Cost when data is hot | Lowest for frequent access | Similar, plus a small monitoring fee per object |
| Cost when data turns cold | Same as hot | Drops automatically to lower tiers |
| Retrieval fees | None | None for the automatic tiers |
| Small objects | Normal | Objects under 128 KB are not monitored or moved |
Pick Intelligent-Tiering when you cannot predict access and objects are larger than 128 KB. Pick Standard for short-lived or always-hot data, and lifecycle rules when the pattern is known.
Q27. S3 Express One Zone or S3 Standard: when is the faster class worth it? Mid level
| Point | S3 Standard | S3 Express One Zone |
|---|---|---|
| Latency | Tens of milliseconds | Single-digit milliseconds |
| Resilience | Multiple AZs | One AZ |
| Bucket type | General purpose | Directory bucket |
| Storage cost | Lower | Higher per GB, lower request cost |
Pick Express One Zone for very request-heavy, latency-sensitive work next to compute in the same AZ (ML training, analytics scratch). Keep the durable copy in S3 Standard.
Q28. DynamoDB or DocumentDB for JSON data? Mid level
| Point | DynamoDB | DocumentDB |
|---|---|---|
| API | DynamoDB API, PartiQL | MongoDB-compatible API |
| Queries | Key and index based | Rich queries, aggregation pipelines, ad-hoc filters |
| Scaling | Serverless, practically unlimited | Instance-based cluster (elastic clusters for sharding) |
| Ops | Almost none | Choose instances, manage capacity |
Pick DynamoDB for known access patterns at very high scale. Pick DocumentDB when the app uses MongoDB drivers or needs flexible queries on documents.
Q29. ElastiCache or MemoryDB: what is the difference? Mid level
| Point | ElastiCache | MemoryDB |
|---|---|---|
| Main role | Cache in front of a database | Durable in-memory primary database |
| Durability | Data can be lost on failures (replication helps) | Multi-AZ transaction log, data survives failures |
| Write latency | Lowest | Slightly higher because of durable commit |
| API | Valkey, Redis OSS, Memcached | Valkey and Redis OSS compatible |
Pick ElastiCache to speed up reads from another database. Pick MemoryDB when the in-memory store itself is the source of truth and data must not be lost.
Q30. Neptune or a relational database for relationship-heavy data? Mid level
| Point | Relational (RDS/Aurora) | Neptune |
|---|---|---|
| Model | Tables and joins | Graph: nodes and edges |
| Deep relationships | Many joins or recursive queries, slow at depth | Fast traversals across many hops |
| Query languages | SQL | Gremlin, openCypher, SPARQL |
Pick a relational database when relationships are simple and fixed. Pick Neptune for fraud rings, social networks, recommendations and knowledge graphs where you ask "friends of friends of friends" style questions.
Q31. OpenSearch or DynamoDB for a product search box? Mid level
| Point | DynamoDB | OpenSearch |
|---|---|---|
| Lookups | Exact key and prefix on sort key | Full-text, fuzzy, relevance ranking |
| Filters | Planned in key design | Any field, facets, aggregations |
| Role | Source of truth | Search index fed from the source |
Pick DynamoDB (or RDS) to store products, and stream changes into OpenSearch for search, typo tolerance and filters. Do not use DynamoDB scans for search.
Q32. Aurora Serverless v2 or provisioned Aurora instances: when does each make sense? Mid level
| Point | Serverless v2 | Provisioned |
|---|---|---|
| Capacity | Scales in fine steps (ACUs) between a minimum and maximum | Fixed instance size until you change it |
| Best for | Variable or unpredictable load, dev and test, many small databases | Steady, predictable load |
| Cost at steady high load | Usually higher | Usually lower, and can use reserved pricing |
| Mixing | Can be readers or writer in the same cluster as provisioned | Same |
Pick Serverless v2 when load changes a lot or is unknown. Pick provisioned for steady production loads, and mix both (provisioned writer, serverless readers) when useful.
Q33. RDS Proxy or connection pooling inside the application? Mid level
| Point | App-side pool | RDS Proxy |
|---|---|---|
| Where | In each app process | Managed service between app and database |
| Works with Lambda | Poorly: many short-lived processes | Well: shares connections across invocations |
| Failover | App must reconnect | Proxy keeps client connections, reconnects faster |
| Extra | Free | Extra cost; IAM auth and Secrets Manager integration |
Pick app-side pools for long-running services with a stable number of instances. Add RDS Proxy for Lambda, many small app instances, or when you want faster, smoother failovers.
Q34. AWS Batch or Lambda for background jobs? Mid level
| Point | Lambda | AWS Batch |
|---|---|---|
| Duration | Up to 30 minutes for on-demand Event Functions | Hours or days |
| Resources | Up to 10 GB memory, limited CPU | Any EC2 or Fargate size, GPUs |
| Scheduling | Per event | Job queues, priorities, dependencies, arrays |
| Cost | Per request and duration | Pay for EC2/Fargate used (Spot supported) |
Pick Lambda for short, event-driven jobs. Pick Batch for large or long compute jobs (simulations, genomics, video rendering, big batch processing).
Q47. RDS Multi-AZ DB cluster or Aurora: both have readable standbys, so how do they differ? Mid level
| Point | RDS Multi-AZ DB cluster | Aurora cluster |
|---|---|---|
| Engines | RDS for MySQL and PostgreSQL | Aurora MySQL and PostgreSQL |
| Topology | One writer and two readable standbys in three AZs | One writer and up to 15 readers |
| Storage | Local storage per instance, semi-synchronous replication | Shared cluster volume across three AZs |
| Scale of reads | Two readers | Many readers, auto scaling |
Pick a Multi-AZ DB cluster when you want faster failover and two readers on standard RDS engines. Pick Aurora when you need more readers, global databases or Aurora-only features.
4. Senior level and scenario questions
These questions check design thinking and troubleshooting. Think aloud. Say what you check first, what you change, and how you prevent it next time.
Q35. Aurora Global Database or cross-Region read replicas for a multi-Region RDS design? Senior
| Point | Cross-Region read replica (RDS) | Aurora Global Database |
|---|---|---|
| Replication | Engine-native, can lag more under load | Storage-level, typically about a second or less |
| Secondary Regions | Per replica | Several secondary Regions |
| Recovery | Promote replica (becomes standalone) | Managed switchover and failover, endpoints preserved with global writer endpoint |
| Writes in secondary | No | Write forwarding option |
Pick cross-Region replicas for simple DR or reads on RDS engines. Pick Aurora Global Database for low RPO and RTO across Regions and global read traffic.
Q36. Aurora DSQL, DynamoDB global tables or Aurora Global Database for a multi-Region active-active app? Senior
| Point | DynamoDB global tables | Aurora DSQL | Aurora Global Database |
|---|---|---|---|
| Model | Key-value, NoSQL | Distributed SQL (PostgreSQL-compatible) | Relational, one writer Region |
| Writes in many Regions | Yes | Yes | No (forwarding to primary) |
| Consistency | Last writer wins by default; a strong consistency option exists | Strong consistency across Regions | Strong in primary, lagging readers elsewhere |
| Maturity | Long proven | Newer; check feature gaps | Proven |
Pick DynamoDB global tables for NoSQL active-active. Consider DSQL for relational active-active after checking current feature support. Pick Aurora Global Database for one-writer DR and global reads.
Q37. Read replicas or a cache to scale reads for a busy product catalogue? Senior
| Point | Read replicas | Cache (ElastiCache) |
|---|---|---|
| Freshness | Seconds or less behind | As fresh as your TTL and invalidation |
| Query support | Any SQL | Only cached keys |
| Latency | Database latency | Sub-millisecond |
| Effort | Route reads in code or proxy | Cache logic and invalidation |
Pick replicas when reads are varied and need full SQL. Pick a cache for repeated hot keys (product pages, prices). Busy systems often use both: cache first, replica on miss.
Q38. RDS or RDS Custom for an enterprise database: how do you decide? Senior
| Point | RDS | RDS Custom (Oracle, SQL Server) |
|---|---|---|
| OS and database access | None | You can access the OS and customise the database |
| Automation | Full: patching, backups, failover | Shared: AWS automates, you can pause automation |
| Use | Standard apps | Apps needing custom agents, patches or settings that RDS blocks |
| Risk | Low | Higher: your changes can break automation |
Pick RDS whenever the app can live with it. Pick RDS Custom only for packaged apps (such as some ERP systems) that need privileged access, before considering self-managed EC2.
Q39. For a 2-minute video encoding task triggered by uploads, Lambda, Fargate or AWS Batch? Senior
| Point | Lambda | Fargate task | AWS Batch |
|---|---|---|---|
| Fits duration | Yes (two minutes fits the on-demand timeout) | Yes | Yes |
| Heavy CPU/GPU | Limited | Moderate | Best (GPU, large instances, Spot) |
| Start-up | Fast | Tens of seconds | Queue plus instance start |
| Burst of 10,000 uploads | Scales quickly, watch concurrency | Many tasks, watch quotas | Queues work, controls cost |
Pick Lambda for light encodes and moderate volume. Pick Batch (or Fargate via a queue) for heavy encodes, GPU needs or very large bursts where cost control matters. AWS Elemental MediaConvert is also an option for standard video formats.
Q40. A game needs a real-time leaderboard for 5 million players. DynamoDB, ElastiCache or RDS? Senior
| Point | DynamoDB | ElastiCache sorted sets | RDS |
|---|---|---|---|
| Top 100 query | Needs a special index design; sorting all players is hard | Built in (ZREVRANGE), very fast | ORDER BY with index, heavy at high write rate |
| Score updates per second | Very high | Very high | Limited by one writer |
| Durability | Durable | Needs replication or a durable copy | Durable |
Pick ElastiCache (or MemoryDB for durability) sorted sets for the live leaderboard, and keep scores durable in DynamoDB. RDS fits small games or periodic batch rankings.
Q41. Containers need persistent storage on EKS. EBS, EFS or FSx? Senior
| Point | EBS (CSI driver) | EFS (CSI driver) | FSx (CSI drivers) |
|---|---|---|---|
| Access mode | ReadWriteOnce, one node | ReadWriteMany across nodes and AZs | ReadWriteMany |
| AZ scope | Pod must run in the volume's AZ | Any AZ | Depends on deployment |
| Best for | Databases, StatefulSets | Shared content, uploads | HPC (Lustre), NetApp features (ONTAP) |
Pick EBS for StatefulSets like databases with zone-aware scheduling, EFS for shared files across pods, and FSx for performance or enterprise NAS needs.
Q42. Should a SaaS product use one DynamoDB table for all tenants or one table per tenant? Senior
| Point | Pooled table | Table per tenant |
|---|---|---|
| Isolation | Logical (tenant ID in key, IAM leading-key conditions) | Strong, per-table permissions |
| Operations | One table to manage | Thousands of tables to create, monitor and back up |
| Noisy neighbours | Possible; design keys and capacity well | Isolated capacity |
| Per-tenant restore or delete | Harder | Easy |
Pick pooled for many small tenants. Pick table per tenant (or a separate account) for large, regulated tenants who need strict isolation, often in a mixed model.
Q43. S3 replication or AWS Backup for protecting S3 data? Senior
| Point | S3 replication | AWS Backup for S3 |
|---|---|---|
| Purpose | Live copy in another bucket or Region | Point-in-time recovery and long-term copies |
| Deletes and bad writes | Can replicate them too | Restore to before the mistake |
| Recovery speed | Copy already there | Restore job needed |
| Immutability | Object Lock on destination | Vault Lock |
Pick replication for availability, latency and compliance copies. Pick AWS Backup to recover from corruption, ransomware and accidental changes. Critical data often uses both.
Q44. For a 5 TB PostgreSQL database growing fast, Aurora PostgreSQL or RDS PostgreSQL? Senior
| Point | RDS PostgreSQL | Aurora PostgreSQL |
|---|---|---|
| Storage growth | Provision and grow EBS (with autoscaling) | Grows automatically up to a high limit |
| Read scaling | Replicas each copy data | Readers share storage, faster to add |
| Failover | Multi-AZ instance or cluster deployment | Fast failover to a reader |
| I/O cost | Included in storage type pricing | Pay per I/O or choose I/O-Optimized |
| Extensions and versions | Wide support | Most common ones; check specific needs |
Pick Aurora for large, busy, growing databases needing fast failover and many readers. Pick RDS for steady workloads where lower cost and full extension parity matter.
Q45. For a startup's first production stack, EC2, ECS on Fargate or Lambda? Senior
| Point | EC2 | ECS on Fargate | Lambda |
|---|---|---|---|
| Time to first deploy | Medium | Medium | Fast |
| Ongoing ops | Highest | Low | Lowest |
| Cost at low traffic | Paying for idle servers | One or two small tasks | Near zero |
| Cost at high steady traffic | Lowest with Savings Plans | Moderate | Can become highest |
| Hiring and skills | Common | Containers widespread | Serverless patterns |
Pick Lambda (with API Gateway and DynamoDB or Aurora Serverless) for early, spiky products. Move busy, steady parts to Fargate or EC2 later when the cost curve says so.
Q46. Analytics on S3 data: Athena, Redshift Serverless or EMR? Senior
| Point | Athena | Redshift Serverless | EMR |
|---|---|---|---|
| Model | Serverless SQL over S3 | Serverless data warehouse | Managed Spark, Hive, Presto clusters (or serverless) |
| Best for | Ad-hoc queries, logs | Dashboards, many repeated BI queries | Heavy custom processing, ML pipelines |
| Data location | Stays in S3 | Loaded or queried via Spectrum | S3 |
| Cost | Per data scanned | Per compute used | Per instance or job resources |
Pick Athena for occasional queries, Redshift for steady BI with many users, and EMR for complex transformations in code.
Q48. Lifting a Windows .NET Framework app to AWS: EC2, ECS with Windows containers or Elastic Beanstalk? Senior
| Point | EC2 (Windows) | ECS Windows containers | Elastic Beanstalk (.NET on Windows) |
|---|---|---|---|
| Changes to app | None | Containerise (Windows images are large) | Package as a deployment bundle |
| Ops work | Patching, scaling yourself | Cluster and image updates | Platform managed |
| Density and speed | One app per server usually | Several apps per host | One app per environment |
| Path to modernise | Slow | Good step towards .NET on Linux later | Limited |
Pick EC2 for the fastest move with least risk. Pick ECS Windows containers when many small apps should share hosts and you plan to modernise. Beanstalk fits a single app and a small team.
Q49. Storing IoT sensor readings: DynamoDB, a time-series database or S3 with Athena? Senior
| Point | DynamoDB | Time-series database (Timestream for InfluxDB) | S3 + Athena |
|---|---|---|---|
| Write pattern | Very high write rates with good key design | Built for time-stamped writes | Batched files (Firehose) |
| Queries | Latest values per device | Time windows, downsampling, rollups | Large historical analysis |
| Retention cost | Higher for years of data (TTL helps) | Medium | Lowest |
Common design: recent values in DynamoDB or a time-series database for dashboards, and all raw history in S3 for analytics. Check current availability of AWS time-series options, because Timestream for LiveAnalytics is no longer open to new customers.
Q50. CI build runners: EC2 Spot Auto Scaling group, CodeBuild or Fargate Spot? Senior
| Point | EC2 Spot ASG runners | CodeBuild | Fargate Spot tasks |
|---|---|---|---|
| Ops work | Highest: AMIs, scaling, cleanup | Lowest: managed builds | Low |
| Docker builds | Easy (Docker on the host) | Supported (privileged mode) | Harder (no Docker daemon in Fargate) |
| Cost | Lowest at high volume | Pay per build minute | Low, interruptions possible |
| Interruptions | Spot reclaims; retry jobs | None | Spot reclaims |
Pick CodeBuild for most teams. Pick a Spot ASG (or managed runner fleets) for very high build volume where cost matters and you can handle interruptions. Fargate Spot fits lightweight, non-Docker jobs.
5. Frequently asked questions
How long should a comparison answer be in an interview?
About one minute: one line each on what they are, three or four differences, and when you would pick each, ideally with an example from your own work.
What if the interviewer asks about a pair that is not on this page?
Use the same frame: what problem each solves, how you manage it, how it scales, how you pay, and its limits. Then pick one for a concrete use case.
Are these comparisons asked for freshers too?
Yes. Freshers usually get EC2 vs Lambda, S3 vs EBS and RDS vs DynamoDB. Senior candidates get trade-offs such as Aurora Global Database vs cross-Region replicas.
6. Quick revision
- Lambda: short, event-driven code. Fargate: containers without servers. EC2: full control.
- S3: objects over HTTP. EBS: one instance's disk. EFS/FSx: shared file systems.
- RDS: managed classic engines. Aurora: cloud-native storage, faster failover. DynamoDB: key-value at any scale.
- Aurora: transactions. Redshift: analytics.
7. Related chapters
- 1000 AWS Interview Questions and Answers for Freshers and Experienced (Complete Set)
- AWS Database Interview Questions and Answers: RDS, Aurora, DynamoDB and ElastiCache (50 Questions)
- AWS S3 and Storage Interview Questions and Answers (50 Questions on S3, EFS, FSx and Backup)
- What Is Amazon S3? S3 vs EBS vs EFS, Storage Classes and Pricing Explained
This page is one part of the complete AWS interview question set. Open the full list here: All 2052 AWS interview questions.