Best AWS EC2 Interview Questions and Answers 2022 - ThinkCloudly (2023)

AWSEC2 or Amazon Elastic Compute Cloud is a web service that provides resizable computing capacity in the cloud. EC2 allows access to Amazon's own high-performance computing infrastructure and allows you to run large-scale applications from various platforms such as Windows, Linux, Unix, and Java environments. Most organizations use this platform because it has several built-in features such asElectronic business systemvolumes, security groups, IAM roles, and more.

We've collected some of the most frequently asked questions in AWS EC2 interviews and compiled a list of common interview questions and answers to help you better understand Amazon Web Services (AWS) and questions asked in AWS EC2 interviews.

This guide has been written by experienced software engineers who have worked in the industry and have interviewed hundreds of times in their careers, so it will not only help you ace your next interview, but learn about it along the way. New to AWS EC2!

1. What is AWS EC2?

AWS EC2 is a service provided by Amazon that helps customers host computing services in their IT environments ascloud computing. Amazon EC2 eliminates all the manual setup typically involved in running a virtual server. It gives you full control over your computing resources, which you can scale as needed.

You might find this interesting:How to create EC2.

2. What is the full form of EC2?

Amazon Elastic Compute Cloud

3. What is an instance in EC2?

Instances are virtual servers that run applications on AWS EC2. An instance might represent a small part of a machine, with a separate hard drive or operating system, etc. From one physical machine you may have multiple small computers (virtual machine) are called instances.

(Video) Top 6 AWS Security Interview Questions and Answers You Need to Know

4. Why do we use EC2?

Amazon EC2 allows you to create as many virtual servers as you need, manage security and networking, and provision storage in real time. Amazon EC2 allows you to scale workloads up or down as needed to meet changing business needs. This way, you can manage unexpected surges without sacrificing availability.

5. What does Spot Instance in AWS EC2 mean?

AWS Spot Instances allow you to take advantage of unused EC2 capacity on the AWS Cloud. You can get Spot Instances for up to 90% off the On-Demand price. Spot Instances can be used for a variety of stateless, fault-tolerant, or flexible applications such as big data, containerized workloads, and more.

6. What are Reserved Instances in AWS EC2?

Reserved Instances are provided by Amazon Web Services (AWS) for customers to use for a variety of custom purposes. Amazon offers EC2 Reserved Instances at an hourly rate, along with optional Capacity Reservations for these instances.

7. Explain the advantages of AWS EC2.

  • reliability:Every Amazon EC2 region in the Amazon Web Services network has an SLA of 99.9% availability. Thus, instance replacement is simple and fast.
  • Safety:Amazon fulfills Amazonproprietary networkProvide stable network and security. The compute instance is located atvirtual private cloud(proprietary network) logically partitioned by specific IP ranges.
  • flexibility:Choosing an EC2 instance can involve different factors such as type, software package, instance store, and operating system. You can configure memory, CPU, and boot partition size to suit the operating system and applications.
  • save costs:EC2 is cost-effective because it enables consumers to configure plans to meet their needs. This will allow them to save money and maximize their resources. The power and size of Amazon's EC2 instances are much lower in cost compared to other cloud providers, which saves so much money.

8. What are the categories of AWS Reserved Instances?

  • Standard RIs

They are ready to use on a stable stage. They have a 75% discount on On-Demand Instances.

  • Convertible RI

If you create another RI of equal or greater value in exchange, you can adjust the properties of the RI. You can also use convertible RI for steady-state calculations. For On-Demand instances, they offer discounts of up to 54%.

  • book RI

By using recurring, predictable RIs, you can schedule capacity reservations to complete over days, weeks, or months. You can activate a scheduled RI at any time within the allotted timeframe.

9. Why is EC2 important?

  1. No hardware is required.
  2. Can be extended up and down.
  3. Pay for what you use.
  4. Take full control of the machine.
  5. safe
  6. Accessible from anywhere in the world through Internet-enabled devices.

10. What is AWS EC2 instance classification?

  • on-demand instance
  • Spot instance
  • Reserved Instances (RIs)

11. Is Amazon EC2 IaaS or PaaS?

EC2 is Infrastructure as a Service (Infrastructure as a Service)

(Video) Cloud Computing Interview Questions and Answers

12. ExplainBasic structure of AWS Ec2 service?

  • Example-Instances are servers hosted in the AWS cloud using the EC2 service.
  • AMI——AMIs provide you with templates with operating systems and pre-configured applications to reduce the chance of error.
  • EBS-An EBS volume is a block-level storage device that can be attached to a single EC2 instance as a persistent way to increase disk space.
  • security group-Security groups provide a way to keep EC2 instances secure by preventing traffic from specific machines from other network-connected computers.
  • I am-Identity and Access Management, or IAM roles, are used to manage access to AWS.
  • VPC-AWS' Virtual Private Cloud (VPC) allows you to set up a virtual network that AWS resources can then join.
  • load balancer -Load balancing distributes incoming application or network traffic to multiple targets, such as Amazon EC2 instances, containers, and IP addresses, in multiple Availability Zones.
  • cloud look-thisAmazon Cloud WatchTools monitor all your AWS resources and applications, collecting data and tracking variables in real time.

13. What is an AMI in AWS EC2?

An Amazon Machine Image is a special type of virtual appliance used to create virtual machines in Amazon Elastic Compute Cloud. An AMI is a unit of deployment for services delivered through EC2.

14. What are Regions and Availability Zones in AWS EC2?

Amazon EC2 is deployed in multiple locations around the world, and each location includes regions and availability zones. These regions are actually different geographic regions. Each region has many separate places called Availability Zones.

15. What is a security group in Amazon Ec2?

When added to an instance, a security group acts as a firewall, controlling traffic to and from that instance.

16. Explain best practices for Amazon Ec2?

To get the most benefit and satisfaction from and within Amazon EC2:

  • Security and Networking Best Practices
  • storage
  • resource management
  • backup and restore

17. What is the use of the key pair?

Using a key pair, users can securely log in to their instances. public keyCryptographyUsed to secure information such as login credentials.

(Video) AWS Cloud Formation Interview Question

18. If so, can we create our own AMI?

Yes, we can create our own AMIs, and you can launch instances from the public AMI and save them as custom AMIs for use in your own projects.

19. Can you change the private IP address on EC2 in an AWS VPC while it is running?

The primary private IP address cannot be changed, but the secondary private address can be moved between interfaces or instances at any time.

20.What happens after an EC2 instance restarts?

Arebootjust likerebootAcomputer.The hard disk isNo effect. you do notTongetpictureOriginal statestep back,butharddiskcontentrecoverarrivethisThe original.

Arebootjust likerebootAcomputer.The hard disk isNo effect. you do notTongetpictureOriginal statestep back,butharddiskcontentrecoverarrivethisThe original.

final thoughts

These are some of the most typical AWS EC2 questions and answers; they are here to prepare you before the intervieww.Please continue to follow ourotherblogSecondAbout AWS interview questions and answersseries

Earning an AWS certification could lead to a lucrative career, learn everything you need to know about AWS and become aAWS cloud practitioner.check out our job guideAmazon coursesstart.

(Video) Top 10 AWS S3 Interview Question 2022

Want to go deep into the cloud. Refer to our more blogs:

Top 15AWS Security Interview Questionsand the answers you need to know

most commonAWS S3 interview questionsand answers - 2022

top 50Azure interview questionsand answers - 2022

12 Tips for Passing the ExamAWS Cloud Practitioner Exam

top 10Great IT Job Interview Tips

Browse our YouTubecloud computing video


What is EC2 in AWS interview questions and answers? ›

EC2 is short for Elastic Compute Cloud, and it provides scalable computing capacity. Using Amazon EC2 eliminates the need to invest in hardware, leading to faster development and deployment of applications.

What type of Amazon EC2 instance would be a best practice for selection? ›

Storage Optimized instance type. The storage optimized AWS EC2 instance type provides the best storage capabilities for Amazon instances.

How do I prepare for an AWS cloud interview? ›

How to Prepare for AWS Interview Questions
  1. Research the company. ...
  2. Prepare to talk about specific accomplishments. ...
  3. Train yourself to handle adversity. ...
  4. Keep in mind that interviewers are writing everything down. ...
  5. Don't skip fundamental questions. ...
  6. Be Honest and Tell them if you don't Know. ...
  7. Get as detailed as you can.

Can S3 be used with EC2 instances and if yes how? ›

You can set up Amazon S3 buckets as a backup destination for Amazon EC2 data. Amazon S3 buckets might be used to exchange data between EC2 instances or between the cloud and local infrastructure.

What are the 3 types of EC2? ›

Here are different types of EC2 Instances:
  • General Purpose Instances.
  • Compute Optimized Instances.
  • Memory-Optimized Instances.
  • Accelerated Computing Instances.
  • Storage Optimized Instances.

What are the three types of EC2 instances? ›

They are On-Demand Instances, Reserved Instances, Spot Instances, and Savings Plans. Amazon also offers the additional option of Amazon EC2 Dedicated Hosts.

What is 1 vCPU in AWS? ›

An AWS vCPU is a single hyperthread of a two-thread Intel Xeon core for M5, M4, C5, C4, R4, and R4 instances. A simple way to think about this is that an AWS vCPU is equal to half a physical core.

What is the clock speed of EC2? ›

Amazon EC2 instances feature 1st Gen AMD EPYC™ 7000 series processors with an all core clock speed of 2.5GHz and 2nd Gen 7002 series processors with an all core clock speed of 3.3GHz.

How to determine EC2 instance size? ›

Right Size Using Performance Data

Analyze performance data to right size your EC2 instances. Identify idle instances and ones that are underutilized. Key metrics to look for are CPU usage and memory usage. Identify instances with a maximum CPU usage and memory usage of less than 40% over a four-week period.

How many subnets can you have per VPC? ›

How many subnets can I create per VPC? Currently you can create 200 subnets per VPC. If you would like to create more, please submit a case at the support center.

What level of control you have on your EC2? ›

Users have complete control over the visibility of their AWS account. In AWS EC2, the security systems allow create groups and place running instances into it as per the requirement. You can specify the groups with which other groups may communicate, as well as the groups with which IP subnets on the Internet may talk.

How many buckets can be created in S3? ›

S3 bucket limitation and pricing

Each AWS account can create 100 buckets, and users can request a service limit increase to obtain more. The AWS account that creates a bucket owns it, and ownership isn't transferable. An S3 user can delete a bucket, but another AWS user can claim that globally unique name.

Can I mount an S3 bucket to an EC2 instance? ›

The S3 File Gateway uses the VPC gateway endpoint to connect privately to the S3 service and your S3 bucket mounted to your EC2 instance.

How do I pull files from S3 to EC2? ›

Copying files from the S3 bucket to the EC2 instance
  1. SSH into the EC2 instance.
  2. Run aws sts get-caller-identity to confirm that the EC2 instance has the correct role attached and AWS CLI is working properly.
  3. Run aws s3 <S3_Object_URI> <Local_File_Path> to copy files from S3 bucket to the EC2 instance.
May 24, 2022

Can an EC2 instance run multiple containers? ›

You can use an Amazon ECS task definition to specify multiple containers. All the containers that you specify are deployed along the same compute capacity. Don't use this feature to add multiple application containers to the same task definition because this prevents copies of each application scaling separately.

What type of cloud is EC2? ›

Amazon Elastic Compute Cloud (Amazon EC2) is a web-based service that allows businesses to run application programs in the Amazon Web Services (AWS) public cloud.

What are the types of load balancer in EC2? ›

  • Application Load Balancer. ...
  • Network Load Balancer. ...
  • Application Load Balancer and Network Load Balancer considerations.

What is the difference between Lambda and EC2 instance? ›

Lambda is ideal for short-term tasks. EC2, in contrast, is intended for long-term, steady-state operations, such as running websites and applications or supporting resilient high-performance computing. Even so, both platforms can work together.

What is the maximum number of instances in EC2? ›

EC2 Instances

By default, AWS has a limit of 20 instances per region. This includes all instances set up on your AWS account.

What is the difference between T2 and T3 EC2 instances? ›

Amazon EC2 T3 instances are also burstable and deliver a balance of compute, RAM, storage, and networking power. But unlike T2, a T3 instance has Unlimited Burstable mode enabled automatically. The comparison table below describes other ways in which T3 instances differ from T2 instances.

What are T2 instances? ›

T2 instances are Burstable Performance Instances that provide a baseline level of CPU performance with the ability to burst above the baseline. The baseline performance and ability to burst are governed by CPU Credits. T2 instances accumulate CPU Credits when they are idle, and consume CPU Credits when they are active.

How many threads are in a core? ›

CPU Threads

A single server CPU core can have 2 threads. If a CPU has 8 cores with two threads per core, it will have 16 threads to perform tasks. Multithreading allows a CPU to execute multiple threads of code and run concurrent tasks of a process at the same time.

How many cores does a 16 vCPU have? ›

The number of vCPUs to license is 16. Two VMs are deployed on a server that has two processors. Each processor has 8 physical cores which gives 16 cores in total.

What is the maximum vCPU per VM? ›

The maximum number of virtual CPU sockets that a virtual machine can have is 128.

What is the maximum timeout for EC2? ›

By default ELB has a default connection timeout of 60 seconds. This is probably what's causing you grief. You can increase this to up to 4000 seconds, however one must ask why your application takes more than 60 seconds to respond to a web request in the first place.

Is EC2 faster than Lambda? ›

A delay between sending a request and application execution is up to 100 milliseconds for AWS Lambda, unlike applications running on EC2 instances that don't have such delay. 100ms is not a long time, but for some types of applications, this time can be critical.

Is EC2 charged per hour? ›

EC2 usage is billed in one-second increments, with a minimum of 60 seconds. Similarly, provisioned storage for Amazon Elastic Block Store (Amazon EBS) volumes is billed per-second increments, with a 60-second minimum.

How many users can EC2 handle? ›

In its steady state, the site must handle 1,000 concurrent visitors at any given time. Visitors spend on average 30 seconds on each page before they click on a different link or leave the site.

What is the default disk size for EC2? ›

An Amazon EC2 Windows instance created from an Amazon Machine Image (AMI) has a default 30 GB gp2 (General Purpose SSD) Amazon EBS root volume. To expand the disk space of a Windows instance, follow these steps.

How do I check CPU utilization on EC2 instance? ›

Check the CPU utilization on the OS
  1. Open the Amazon EC2 console, and then choose Instances from the navigation pane.
  2. On the Monitoring tab, note the CPU utilization. ...
  3. Connect to your instance using Remote Desktop Protocol (RDP).
  4. Open Task Manager, and then note the CPU utilization on the OS.

What is the maximum IP address on a VPC? ›

You can't have more than 255 gateway endpoints per VPC. This is the combined quota for the maximum number of interface endpoints and Gateway Load Balancer endpoints in a VPC.

Can two VPC have same CIDR? ›

You cannot create a VPC peering connection between VPCs that have matching or overlapping IPv4 CIDR blocks. You cannot create a VPC peering connection between VPCs that have matching or overlapping IPv6 CIDR blocks.

How many CIDR are in a VPC? ›

VPC IP address range

Dual stack – The VPC has both an IPv4 CIDR block and an IPv6 CIDR block.

How do I stop EC2 billing? ›

Expand the Elastic Compute Cloud line item in the Bills page to see your EC2 usage by resource. Then, open the Amazon EC2 console and terminate or delete any resources that you don't need. Stopped instances don't incur charges, but Elastic IP addresses or EBS volumes attached to those instances do.

What zone is my EC2 instance? ›

Open the Amazon Elastic Cloud Compute (Amazon EC2) console. From the navigation bar, view the options in the Region selector. On the navigation pane, choose EC2 Dashboard. In the Service Health section, view the list of AZs under Availability Zone Status.

How do I increase CPU in AWS EC2? ›

You can change instance types to do the following:
  1. Increase or decrease the number of CPU cores.
  2. Increase or decrease the amount of RAM.
  3. Enable Amazon Elastic Block Store (Amazon EBS) optimization.
  4. Enable enhanced networking.
  5. Change GPU cores.

Which is the maximum S3 object size? ›

Individual Amazon S3 objects can range in size from a minimum of 0 bytes to a maximum of 5 TB. The largest object that can be uploaded in a single PUT is 5 GB.

Can we rename S3 bucket name? ›

Your answer

Yes, There's no option to rename bucket functionality for S3 because there are technically no folders in S3 so we have to handle every file within the bucket. Create a new bucket, copy the contents from the new bucket and delete the old bucket. You can do all these steps in AWS CLI.

How many S3 buckets can a user have per account by default? ›

By default, the maximum number of buckets that can be created per account is 100. For additional buckets, one can submit a request for a service limit increase. Users get 99.99% durability.

How do you attach a load balancer to EC2? ›

Open the Amazon EC2 console at .
  1. On the navigation pane, under Load Balancing, choose Load Balancers.
  2. Select your load balancer.
  3. In the bottom pane, select the Instances tab.
  4. Choose Edit Instances.
  5. Select the instance to register with your load balancer.
  6. Choose Save.

How do I push EC2 logs to S3? ›

Exporting log data to S3 buckets that are encrypted by AWS KMS is supported.
  1. Step 1: Create an S3 bucket. ...
  2. Step 2: Set up access permissions. ...
  3. Step 3: Set permissions on an S3 bucket. ...
  4. Step 5: Create an export task. ...
  5. Step 6: Describe export tasks. ...
  6. Step 7: Cancel an export task.

How to copy S3 object to EC2? ›

Steps to copy files from S3 bucket to EC2 instance (Download)
  1. Create an IAM role with S3 write access or admin access.
  2. Map the IAM role to an EC2 instance.
  3. Install AWS CLI in EC2 instance.
  4. Run the AWS s3 cp command to copy the files from S3 to EC2.
Jan 19, 2022

How do I move files from local to EC2? ›

Open a new command prompt and run the following command replacing the fields as needed: scp -P 2222 Source-File-Path user-fqdn @localhost: To copy the entire directory instead of a file, use scp -r before the path. This recursively copies all of the directory's contents to the destination EC2 instance.

How do I push files to EC2? ›

1 Answer
  1. You can use SCP or WinSCP to transfer files or folders to your EC2 instance.
  2. For SCP, you need to run the following command on your cmd of your local machine:
  3. scp -i path/to/pem path/to/file username@PublicDNS/home/username.
  4. For WinSCP, download and install WinSCP tool and follow the below-mentioned steps:

What is the difference between stopping and terminating an EC2 instance? ›

Stop Instance

The key difference between stopping and terminating an instance is that the attached bootable EBS volume will not be deleted. The data on your EBS volume will remain after stopping while all information on the local (ephemeral) hard drive will be lost as usual.

How many EBS can be attached to one EC2? ›

EC2 Instances limit: Users can currently attach a maximum of 16 instances per EBS volume.

How many ports does an EC2 instance have? ›

An EC2 instance is a Windows or Linux computer. It has all the TCP ports, from 0 to 65535, just like any other computer.

How many types of EC2 instances can be created? ›

Here are different types of EC2 Instances: General Purpose Instances. Compute Optimized Instances. Memory-Optimized Instances.

What is EC2 in AWS in simple terms? ›

Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. Amazon EC2's simple web service interface allows you to obtain and configure capacity with minimal friction.

What is an EC2 instance in AWS? ›

An Amazon EC2 instance is a virtual server in Amazon's Elastic Compute Cloud (EC2) for running applications on the Amazon Web Services (AWS) infrastructure.

What is the role of EC2 in AWS? ›

EC2 Instance Role provides the Instance access to a set of IAM Credentials and – if the associated IAM Policies permit – access to AWS services.

What exactly EC2 does? ›

Amazon EC2 provides scalable computing capacity in the AWS cloud. Leveraging it enables organizations to develop and deploy applications faster, without needing to invest in hardware upfront. Users can launch virtual servers, configure security and networking, and manage cookies from an intuitive dashboard.

Is EC2 a PAAS or IaaS? ›

A good example of IaaS is AWS EC2. EC2 delivers scalable infrastructure for companies that want to host cloud-based applications.

What is the difference between Lambda and EC2? ›

Lambda is ideal for short-term tasks. EC2, in contrast, is intended for long-term, steady-state operations, such as running websites and applications or supporting resilient high-performance computing. Even so, both platforms can work together.

Is EC2 just a VM? ›

Amazon Elastic Compute Cloud (EC2) is the Amazon Web Service you use to create and run virtual machines in the cloud (we call these virtual machines 'instances').

How many EC2 instance types are there? ›

Amazon EC2 provides a total of 8 family of instance types which are classified according to their use cases. Instance types comprise varying combinations of CPU, memory, storage and networking capacity to give the client a flexibility to choose the appropriate mix of resources for your applications.

How many EC2 instances can I run? ›

Q: How many instances can I run on EC2? You are limited to running On-Demand Instances per your vCPU-based On-Demand Instance limit, purchasing 20 Reserved Instances, and requesting Spot Instances per your dynamic Spot limit per AWS Region.

What is the difference between ECS and EC2? ›

The largest difference for EC2 is that it deploys isolated VM instances with auto scaling support, and ECS deploys scalable clusters of managed Docker containers. Enterprises can use ECS to scale web applications, perform batch processing, and run services in a hybrid environment to deliver better services to users.

Can an EC2 instance have multiple roles? ›

You can attach only one role to ec2 instance. Refer this amazon document: IAM Roles for Amazon EC2.

Why EBS is used with EC2? ›

Amazon EBS allows you to create storage volumes and attach them to Amazon EC2 instances. Once attached, you can create a file system on top of these volumes, run a database, or use them in any other way you would use block storage.

Why is EC2 called EC2? ›

The EC in EC2 stands for Elastic Compute, and that name was chosen deliberately.

What is EC2 in DevOps? ›

AWS DevOps Architecture

EC2 stands for Elastic Compute Cloud, which lets users configure virtual machines and the underlying resources they leverage from a central console.

Is EC2 used for deployment? ›

When you create an EC2 deployment, you define the engine type, version, and configuration to deploy to the Amazon VPC specified in the environment. You also specify the number of engine instances to deploy. Each engine instance runs on a dedicated EC2 instance.

Why not to use EC2? ›

The systems supporting EC2 are incredibly complex and operate at a massive scale. Stuff happens. If you can't afford some measure of cross-availability-zone redundancy (at minimum) and your application has stability requirements, EC2 is probably not for you.


1. AWS Architecture - Interview Preparation | Webinar Recording | Thinkcloudly
2. Most common AWS S3 interview questions 2022
(christina allen)
3. AWS Route 53 interview Questions
(christina allen)
4. AWS v/s Azure | Webinar Recording | Thinkcloudly
5. 6. aws interview live recorded |
6. AWS Solution optimization | Webinar Recording | Free Sessions | Thinkcloudly


Top Articles
Latest Posts
Article information

Author: Fr. Dewey Fisher

Last Updated: 01/06/2023

Views: 5269

Rating: 4.1 / 5 (62 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Fr. Dewey Fisher

Birthday: 1993-03-26

Address: 917 Hyun Views, Rogahnmouth, KY 91013-8827

Phone: +5938540192553

Job: Administration Developer

Hobby: Embroidery, Horseback riding, Juggling, Urban exploration, Skiing, Cycling, Handball

Introduction: My name is Fr. Dewey Fisher, I am a powerful, open, faithful, combative, spotless, faithful, fair person who loves writing and wants to share my knowledge and understanding with you.