AWS EC2 Interview Questions and Answers

Latest AWS EC2 Interview Questions and Answers

In this post, AWS EC2 Interview Questions will be answered for Experienced and Freshers. We’re trying to share our experience and learn how to help you make progress in your career.

AWS EC2 Interviews Questions:

Q1. What is EC2?

Q2. What are the features of Amazon EC2?

Q3. What are the Benefits of Amazon EC2?

Q4. What Are The Security Best Practices For Amazon Ec2 ?

Q5. Explain Storage For Amazon Ec2 Instance ?

Q6. Is Amazon EC2 IaaS or PAAS?

Q7. What is an instance in Amazon EC2?

Q8. How instances are categorized in AWS EC2?

Q9. What is On-Demand Instances in AWS EC2?

Q10. What is Reserved Instances (RI) in AWS EC2?

Q11. What are the categories of Reserved Instances in AWS?

Q12. What is Spot instances in AWS EC2?

Q13. Mention some pros and cons of using Amazon EC2?

Q14. List types of EC2 instances available in AWS?

Q15. Why EC2 instance tags are used?

Q16. Why EC2 is Important?

Q17. Explain the Basic Structure of AWS Ec2 Service ?

Q18. What is AMI in AWS EC2?

Q19. Can we create our own AMI if yes how?

Q20. What are regions and availability zones in AWS EC2?

Q21. What Is Security Group In Amazon Ec2 ?

Q22. Explain Stopping, Starting, And Terminating An Amazon Ec2 Instance ?

Q23. What happens when an EC2 Instance is rebooted?

Q24. What Is Amazon Ec2 Root Device Volume ?

Q25. Explain Elastic Block Storage? 

Q26. What is S3?What is it used for?

Q27. How To Persist Root Device Volume In Amazon Ec2 Instance ?

Q28. What Are The Features Of Security Group In Amazon Ec2 ?

Q29. How To Create Security Group In Amazon Ec2 ?

Q30. How To Launch An Amazon Ec2 Instance ?

Q31. How To Add A Ebs Volume To Your Amazon Ec2 Instance ?

Q32. How To Clean Up Your Amazon Ec2 Instance And Volume ?

Q33. What Is Amazon Machine Image And What Is The Relation Between Instance And Ami ?

Q34. What is EC2 User Data?

Q35. What is EC2 Connect?

Q36. What are EC2 purchasing options?

Q37. What is EBS – Delete on Termination attribute? 

Q38. What is EC2 Instance Store?

Q39. What is Elastic File System (EFS)?

Q40. What is EC2 Image Builder?

Q41. What Is The Size Limit For Amazon Ec2 Instance Store-backed Amis And Amazon Ebs-backed Amis ?

Q42. How To Migrate An Instance To Another Availability Zone ?

Q43. What Is Shared Ami ?

Q44. How You Will Change The Root Ebs Device Of My Amazon Ec2 Instance ?

Q45. What Is The Difference Between A Spot Instance And A Demand Instance On Ec2 ?

Q46. What is Spot Fleet?

Q48. What is Elastic Network Interface (ENI)?

Q49. What is EC2 Hibernate?

Q50. What is EC2 connect? 

Q51. Explain EC2 metadata? 

Q52. What are EBS volume types?  

Q53. What is Elastic Load Balancer(ELB)?

Q54. What are ELB types? 

Q55. Explain Classic Load Balancer (CLB).

Q56. Explain Application Load Balancer (ALB)

Q57. Explain Network Load Balancer (NLB)

Q58. Explain Gatway Load Balancer. 

Q59. What Are The Main Features Of Classic Load Balancer In Ec2 ?

Q60. What Are The Main Features Of Application Load Balancer (alb) In Amazon Ec2 ?

Q61. What Is A Placement Group In Ec2 ?

Q62. Can you mention some advantages and disadvantages of utilising Amazon EC2?

Q63. What is the difference between a public IP address and an EIP address?

Q64. What is and ELB?

Q65. You have an EC2 instance that has an unencrypted volume. You want to create another Encrypted volume from this unencrypted volume. How can you achieve this?

Q66. What is auto-scaling?  How does it work?

Q67. What are the Best Practices for Security in Amazon EC2?

Q68. List some connection issues that can be faced while connecting to an EC2 instance?

Q69. Name the cloud watch merits available for EC2 instances?

Q70. What is the way to recover a lost EC2 instance?

Q71.  What is the medium to recover EC2 instance by configuring CloudWatch

Q72. When your instance show retired state?

Q73.  Scenario: My EC2 instance IP address change automatically while instance stop and start. What is the reason for that and explain solution?

Q74. What is cold HDD and Throughput-optimized HDD?

Q75. What is Amazon EBS-Optimized instances?

Q76. How to connect EBS volume to multiple instance?

Q77. What is Status Checks in AWS Ec2?

Q78. Maximum number of EC2 which can be created in VPC.

Q79. Benefits of Auto Scaling in AWS

Q80. Explain Auto Scaling Groups – Scaling Policies.

 

Q1. What is EC2?

Amazon EC2 (Elastic Compute Cloud) is a web service interface that provides resizable compute capacity in the AWS cloud. It is designed for developers to have complete control over web-scaling and computing resources.

EC2 instances can be resized and the number of instances scaled up or down as per our requirement. These instances can be launched in one or more geographical locations or regions, and Availability Zones (AZs). Each region comprises several AZs at distinct locations, connected by low latency networks in the same region.

 

Q2. What are the features of Amazon EC2?

Bare Metal instances– Amazon EC2 bare metal instances provide your applications with direct access to the processor and memory of the underlying server.Bare metal instances are built on the Nitro system, a collection of AWS-built hardware offload and hardware protection components that come together to securely provide high performance networking and storage resources to EC2 instances.

Pause and Resume Your Instances– You will not be charged for instance usage while your instance is hibernated. Storage is charged at standard EBS rates. For more information about hibernation, and supported instance types and operating systems.

High I/O Instances– High I/O I3 and I3en instances are backed by Non-Volatile Memory Express (NVMe) based SSDs, and are ideally suited for customers running very high performance NoSQL databases, transactional systems, and ElasticSearch workloads. High I/O instances also offer sequential disk throughput up to 16 GB/s, which is ideal for analytics workloads.

Flexible Storage Options– Amazon EBS provides persistent, highly available, consistent, low-latency block storage volumes for use with Amazon EC2 instances. Each Amazon EBS volume is automatically replicated within its Availability Zone to protect you from component failure, offering high availability and durability. It is designed for application managers who need to tune workloads for capacity, performance and cost.

Elastic IP Addresses– Elastic IP addresses are static IP addresses designed for dynamic cloud computing. An Elastic IP address is associated with your account not a particular instance, and you control that address until you choose to explicitly release it.

Enhanced Networking– This feature uses a new network virtualization stack that provides higher I/O performance and lower CPU utilization compared to traditional implementations. In order to take advantage of Enhanced Networking, you should launch an HVM AMI in VPC, and install the appropriate driver.

 

Q3. What are the Benefits of Amazon EC2?

 

  1. Reliability: For each Amazon EC2 region, Amazon EC2 guarantees 99.9% availability. The services are extremely reliable, so instance replacement is simple and fast.
  2. Security: Amazon uses Amazon VPC to provide the compute resources with stable networking and security. The compute instances are situated in a virtual private cloud (VPC) with a specific IP range. This feature allows the user to choose which instances are visible on the internet and which are kept private.
  3. Flexibility: You can select from a range of instance types, software packages, instance storages, and operating systems on EC2. EC2 helps one to configure the memory, CPU, and boot partition sizes to suit the operating system and application.
  4. Cost Saving: EC2 is cost-effective because it enables consumers to configure plans to suit their specific needs. This will allow the consumer to save money and make the most of their resources. The benefits of Amazon’s scale are passed on to the consumer because EC2 charges a very low fee in relation to the services they offer.
  5. Complete Computing Solution: Amazon RDS, S3, Dynamo DB, and Amazon SQS all work perfectly with EC2. This is a full-featured computing, processing, and storage solution.
  6. Elastic Web-Scale Computing:Within minutes, businesses can easily increase or decrease capacity. They can set up thousands of server instances at the same time. Furthermore, all server instances are operated by web service APIs, which can scale the servers up and down based on the needs.
  7. Completely controlled: Each instance can be granted root access, allowing users to interact with it as though it were any other computer. The user may use web service APIs to stop the instance while keeping the data on the boot partition and restart it.

 

Q4. What Are The Security Best Practices For Amazon Ec2 ?

For secure Amazon EC2 best practices, follow the following steps:

 

  • Use AWS identity and access management to control access to your AWS resources
  • Restrict access by allowing only trusted hosts or networks to access ports on your instance
  • Review the rules in your security groups regularly
  • Only open up permissions that your require
  • Disable password-based login, for instance, launched from your AMI Complete Amazon Web Services Tutorials

 

Q5. Explain Storage For Amazon Ec2 Instance ?

Amazon EC2 provides many data storage options for your instances. Each option has a unique combination of performance and durability. These storages can be used independently or in combination to suit your requirements.

 

There are mainly four types of storages provided by AWS:

 

  1. Amazon EBS: Its durable, block-level storage volumes can attached in running Amazon EC2 instance. The Amazon EBS volume persists independently from the running life of an Amazon EC2 instance. After an EBS volume is attached to an instance, you can use it like any other physical hard drive. Amazon EBS encryption feature supports encryption feature.
  2. Amazon EC2 Instance Store: Storage disk that is attached to the host computer is referred to as instance store. The instance storage provides temporary block-level storage for Amazon EC2 instances. The data on an instance store volume persists only (sap training) during the life of the associated Amazon EC2 instance; if you stop or terminate an instance, any data on instance store volumes is lost.
  3. Amazon S3: Amazon S3 provides access to reliable and inexpensive data storage infrastructure. It is designed to make web-scale computing easier by enabling you to store and retrieve any amount of data, at any time, from within Amazon EC2 or anywhere on the web.
  4. Adding Storage: Every time you launch an instance from an AMI, a root storage device is created for that instance. The root storage device contains all the information necessary to boot the instance. You can specify storage volumes in addition to the root device volume when you create an AMI or launch an instance using block device mapping.

 

Q6. Is Amazon EC2 IaaS or PAAS?

AWS Elastic Compute Service or EC2 is IaaS(Infrastructure as a Service). This is due to the fact that Amazon manages networking, storage, server, and virtualization, while the user is responsible for managing the Operating System, middleware, runtime, data and application.

 

Q7. What is an instance in Amazon EC2?

An instance is a virtual server that runs applications on Amazon’s EC2. An instance is a small part of a larger computer with its own hard drive, network connection, operating system, and so on. On a single physical machine, you may have several small computers, which are referred to as Instances.

 

This instance is operated by Amazon EBS (meaning that the root volume is an EBS volume). You can either pick your own Availability Zone or let Amazon EC2 choose one for you. When you launch your instance, you can secure it by defining a key pair and security group. When you connect to your instance, you should provide the private key of the key pair that you defined while launching your instance.

 

Q8. How are instances categorised in AWS EC2?

Instances are classified into three categories.

 

  1. On-Demand Instances
  2. Reserved Instances (RI)
  3. Spot instances

 

Q9. What is On-Demand Instances in AWS EC2?

In case of On-Demand, there are no long-term contracts. They bill you per hour for the compute capacity you use. Companies may scale up or down the capacity of their application based on demand, and they only pay for the hourly rate of the instance they select.

 

Q10. What is Reserved Instances (RI) in AWS EC2?

There is the ability to adjust operating system types and tenancy agreements in Reserved Instances. For EC2 instances, RI offers an optional capacity reservation. When the attributes of an EC2 instance’s usage match those of an active RI, AWS Billing applies discounted RI rates. If an Availability Zone (AZ) is defined, EC2 reserves capacity that matches the attributes of RI.

 

Q11. What are the categories of Reserved Instances in AWS?

Reserved Instances are divided into three groups.

 

  1. Standard RIs: These RIs are ready to be used on a steady stage. They have up to a 75% discount on On-Demand instances.
  2. Convertible RIs: These RIs allow you to adjust RI’s attributes as long as you create RI of equal or greater value in exchange. Convertible RIs are also suitable for steady-state applications. They have discounts of up to 54% on On-Demand instances.
  3. Scheduled RIs: These RIs allow you to match your capacity reservation to a recurring, predictable schedule that only takes a fraction of a day, week, or month to complete. Scheduled RIs can be activated at any time within the user’s allocated time frame.

 

Q12. What is Spot instances in AWS EC2?

With the support of Spot Instances, one can increase the application’s compute capacity and throughput for the same budget, as well as allow new types of cloud computing applications by lowering the cost of the same. These instances allow you to bid on spare AWS EC2 computing capacity and, as a result, are often cheaper than On-Demand pricing.

 

Q13. Mention some pros and cons of using Amazon EC2?

Some Pros and Cons of using Amazon EC2 is as follows.

Pros :

  • It has the ability to expand resources for the deployment of your cloud according to demand makes it extremely likable.
  • Cloud hosting offers excellent backup capabilities, so it’s a breeze to go back to the previous version.
  • The cloud infrastructure prevents us from maintaining local hardware resources.

Cons:

  • The entire configuration and spin-up process require comprehensive technical knowledge.
  • It has a little lack of training documentation and support. We tried to use Lambda expressions in the execution of program flow and found no great resources on this subject.

 

Q14. List types of EC2 instances available in AWS?

The types of EC2 instances available in AWS are listed below:

  1. General-Purpose instances.
  2. Compute Optimized instances.
  3. Memory Optimized instances.
  4. Accelerated Computing instances.
  5. Storage Optimized instances

 

Q15. Why are EC2 instance tags used?

EC2 instance tags are used for the following purposes:

  • It helps you to manage your instances, images, and other Amazon EC2 resources.
  • It allows you to assign your own metadata to each resource in the form of tags.
  • It enables you to categorize your AWS resources in different ways such as by purpose, owner, or environment.

 

Q16. Why EC2 is Important?

  • No need of any hardware.
  • Scalable up and down.
  • Pay for what you use.
  • Full control on machine.
  • Secure
  • Accessible from anywhere in the world via internet enabled device.

 

Q17. Explain the Basic Structure of AWS Ec2 Service ?

  1. Instances– Instances are servers hosted in the AWS cloud using the EC2 services.
  2. AMI – AMI provides you the templates with an operating system and application pre-configured to reduce the chances of errors.
  3. EBS– A block-level storage device that you can attach to a single EC2 instance, EBS volume is a durable way to increase the disk space.
  4. Security Group– A security group provides a way to block the traffic of a particular machine from other network-connected computers for the security of the EC2 instance.
  5. IAM– Identity and Access Management, or IAM role, is used for managing access of AWS.
  6. VPC– AWS’ Virtual Private Cloud (VPC) allows you to set up a virtual network that AWS resources can then join.
  7. Load Balancers– Load Balancing distributes the incoming application or network traffic across multiple targets, such as Amazon EC2 instances, containers, and IP addresses, in multiple Availability Zones.
  8. Cloud Watch– The Amazon CloudWatch tool monitors all of your AWS resources and apps, collecting data and tracking variables in real time.

Q18. What is AMI in AWS EC2?

The Amazon Machine Image is a special type of virtual appliance used to create a virtual machine within the Amazon Elastic Compute Cloud. The AMI is the unit of deployment for services delivered through EC2.

 

Q19.Can we create our own AMI if yes how?

Yes we can create our own AMI, you can Launch an instance from a public AMI and save it to use for your own project as a custom AMI. 

 

Q20. What are regions and availability zones in AWS EC2?

Amazon EC2 is deployed at several locations throughout the world, each of which includes regions and Availability Zones. The regions are actually different geographical areas. There are many individual places in each region called Availability Zones.

 

Q21. What is the Security Group In Amazon Ec2 ?

Security Groups is a firewall on our EC2 instances and contains only allow groups. Security groups are locked down to regions or VPC.

 

Q22. Explain Stopping, Starting, And Terminating An Amazon Ec2 Instance ?

 

Stopping and Starting an instance: When an instance is stopped, the instance performs a normal shutdown and then transitions to a stopped state. All of its Amazon EBS volumes remain attached, and you can start the instance again at a later time. You are not charged for additional instance hours while the instance is in a stopped state.

 

Terminating an instance: When an instance is terminated, the instance performs a normal shutdown, then the attached Amazon EBS volumes are deleted unless the volume’s deleteOnTermination attribute is set to false. The instance itself is also deleted, and you can’t start the instance again at a later time. 

 

Q23. What happens when an EC2 Instance is rebooted?

A reboot is like restarting a computer. The hard disk isn‘t affected. You don‘t get the image‘s original state back, but the hard disk’s contents revert to the original.

A reboot is like restarting a computer. The hard disk isn‘t affected. You don‘t get the image‘s original state back, but the hard disk’s contents revert to the original.

 

Q24. What Is Amazon Ec2 Root Device Volume ?

When you launch an instance, the Root Device Volume contains the image used to boot the instance.

You can launch an instance from one of two types of AMIs:

  • Instance store-backed AMI
  • EBS based storage

 

Q25. Explain Elastic Block Storage?

Amazon Elastic Block Store (EBS) is an easy to use, high-performance, block-storage service designed for use with Amazon Elastic Compute Cloud (EC2) for both throughput and transaction intensive workloads at any scale. A broad range of workloads, such as relational and non-relational databases, enterprise applications, containerized applications, big data analytics engines, file systems, and media workflows are widely deployed on Amazon EBS.

 

Q26. What is S3?What is it used for?

Amazon Simple Storage Service is storage for the Internet. It is designed to make web-scale computing easier for developers. Amazon S3 has a simple web services interface that you can use to store and retrieve any amount of data, at any time, from anywhere on the web.

It is used for:

industry-leading scalability, data availability, security, and performance.

 

Q27. How To Persist Root Device Volume In Amazon Ec2 Instance ?

By default, the root device volume for an AMI backed by Amazon EBS is deleted when the instance terminates. To change the default behaviour, set the DeleteOnTermination attribute to false using a block device mapping.

 

To change the root device volume of an instance to persist at launch using the console

  • Open the Amazon EC2 console.
  • From the Amazon EC2 console dashboard, click Launch Instance.
  • On the Choose an Amazon Machine Image (AMI) page, choose the AMI to use and click Select.
  • Follow the wizard to complete the Choose an Instance Type and Configure Instance Details pages.
  • On the Add Storage page, deselect the Delete On Termination check box for the root volume.
  • Complete the remaining wizard pages, and then click Launch.
  • Changing the Root Volume of an Instance to Persist Using the AWS CLI
  • Use the run-instances command to preserve the root volume by including a block device mapping that sets its DeleteOnTermination attribute for to false.

 

Q28. What Are The Features Of Security Group In Amazon Ec2 ?

Following are the features of the Security Group in Amazon EC2:

We can add rules to a security group that enable us to connect to our instance from our IP address using SSH.

We can also add rules that allow inbound and outbound HTTP and HTTPS access from anywhere.

 

Q29. How To Create A Security Group In Amazon Ec2 ?

We can create Security Group in Amazon EC2 using the Amazon EC2 console. To launch instances in multiple regions, we’ll need to create a Security Group in each region.

Following are the steps to create Security Group in Amazon EC2:

  • Open the Amazon EC2 console.
  • From the left navigation bar, select a region for the security group.
  • Click Security Groups in the navigation pane.
  • Click Create Security Group.
  • Enter a name for the new security group and a description.
  • In the VPC list, select your VPC.
  • On the Inbound tab, click Add Rule for each new rule, and then click Create

 

Q30. How To Launch An Amazon Ec2 Instance ?

We can launch Linux/Windows Amazon EC2 instance using AWS Management Console.

Following are the steps to create Amazon EC2 instance:

  • Open the Amazon EC2 console.
  • From the console dashboard, choose Launch Instance.
  • Choose an Amazon Machine Image (AMI).
  • Choose an Instance Type.
  • Click on Review and Launch to let the wizard complete the other configuration setting.
  • On the Review Instance Launch page, under Security Groups select a Security Group.
  • Click on Launch on the Review Instance Launch.
  • Select an Existing ket pair when it prompte for key pair.
  • Click on View Instance to return on the console to see instance is launching.

 

Q31. How To Add A Ebs Volume To Your Amazon Ec2 Instance ?

We can attach an EBS volume to one of our instances that is in the same Availability Zone as the Volume.

Following are the steps to attach an EBS volumn to an instance using console:

  • Open the Amazon EC2 console.
  • In the left navigation pane, choose Volumes.
  • Select a volume and choose Attach Volume.
  • Select the instance to which you want to attach the volume.
  • Click on Attach.
  • Now connect to your instance and make the volume available.

 

Q32. How To Clean Up Your Amazon Ec2 Instance And Volume ?

After we are finished with the instance we created, we can clean up by terminating the instance.

Following are the steps to terminate the EC2 instance:

In the navigation pane, choose Instances. In the list of instances, select the instance.

Choose Actions, then Instance State, and then choose Terminate.

Choose Yes,Terminate when prompted for confirmation.

 

Q33. What Is Amazon Machine Image And What Is The Relation Between Instance And Ami ?

Amazon Web Services provides several ways to access Amazon EC2, like web-based interface, AWS Command Line Interface (CLI) and Amazon Tools for Windows Powershell. First, you need to sign up for an AWS account and you can access Amazon EC2.

Amazon EC2 provides a Query API. These requests are HTTP or HTTPS requests that use the HTTP verbs GET or POST and a Query parameter named Action.

 

Q34. What is EC2 User Data?

The EC2 User Data Script runs with the root user to bootstrap our instances. bootstrapping means launching commands when a machine starts. That script is only run once at the instance first start.

 

Q35. What is EC2 Connect?

EC2 connect is used to connect to your EC2 instance with browser. Port 22 needs to be open to access EC2 instance via EC2 connect

 

Q36. What are EC2 purchasing options?

1)On-Demand Instances – short workload, predictable pricing, pay by second. It has the highest cost but no upfront payment.

2)Reserved (1 & 3 years): Up to 72% discount compared to On-demand. You reserve a specific instance attributes (Instance Type, Region, Tenancy, OS)

Reservation Period – 1 year (+discount) or 3 years (+++discount). Payment Options – No Upfront (+), Partial Upfront (++), All Upfront (+++).

Reserved Instance’s Scope – Regional or Zonal. You can buy and sell in the Reserved Instance Marketplace

  1. Reserved Instances – long workloads
  2. Convertible Reserved Instances – long workloads with flexible instances. 

3)Savings Plans (1 & 3 years) –commitment to an amount of usage, long workload. Commit to a certain type of usage ($10/hour for 1 or 3 years). Usage beyond EC2 Savings Plans is billed at the On-Demand price.

Locked to a specific instance family & AWS region. Flexible across: Instance Size (e.g., m5.xlarge, m5.2xlarge), OS (e.g., Linux, Windows), Tenancy (Host, Dedicated, Default)

4)Spot Instances – short workloads, cheap, can lose instances (less reliable). Upto 90% discount. The MOST cost-efficient instances in AWS. Not suitable for critical jobs or databases,

5)Dedicated Hosts – book an entire physical server, control instance placement

6)Dedicated Instances – no other customers will share your hardware. The most expensive option, allows you address compliance requirements and use your existing server bound software licenses. Useful for software that have complicated licensing model or for companies that have strong regulatory or compliance needs.

Purchasing Options: On-demand – pay per second for active Dedicated Host and Reserved – 1 or 3 years (No Upfront, Partial Upfront, All Upfront)

7)Capacity Reservations – reserve capacity in a specific AZ for any duration. Combine with Regional Reserved Instances and Savings Plans to benefit from billing discounts.

You’re charged at On-Demand rate whether you run instances or not. Suitable for short-term, uninterrupted workloads that needs to be in a specific AZ.

    

 Q37. What is EBS – Delete on Termination attribute?

 EBS – Delete on Termination attribute: If enabled, default EBS volume is lost and any other attached EBS volume is not deleted. 

 

 Q38. What is EC2 Instance Store?

 EC2 Instance Store: If you need a high-performance hardware disk, use EC2 Instance Store. EC2 Instance Store has Better I/O performance and lose their storage if they’re stopped (ephemeral). Good for buffer / cache / scratch data / temporary content.

 

 Q39. What is Elastic File System (EFS)?

 Elastic File System (EFS):  Managed NFS (network file system) that can be mounted on 100s of EC2. EFS works with Linux EC2 instances in multi-AZ. 

EFS is highly available, scalable, expensive (3x gp2), pay per use, no capacity planning. 

 

Q40. What is EC2 Image Builder?

EC2 Image Builders automatically build, test and distribute AMIs. Free service (only pay for the 

underlying resources)

 

Q41. What Is The Size Limit For Amazon Ec2 Instance Store-backed Amis And Amazon Ebs-backed Ami’s ?

All AMIs are categorized as either backed by Amazon EBS or backed by instance store.

Backed by Amazon EBS – means that the root device for an instance launched from the AMI is an Amazon EBS volume created from an Amazon EBS snapshot.

Backed by instance store – means that the root device for an instance launched from the AMI is an instance store volume created from a template stored in Amazon S3.

Root device size limit for –

Amazon EBS – Backed is 16 TiB

Amazon Instance Store-Backed is 10 GiB

 

Q42. How To Migrate An Instance To Another Availability Zone ?

You can migrate your EC2 instance from one Availability Zone to another.

Following are the steps to migrate an Instance to another Availability Zone:

  • Create an AMI from the running instance
  • Launch an instance from the AMI that you just created, specify the new Availability Zone
  • You can use the same instance type as the original instance, or select a new instance type
  • If the original instance has an associated Elastic IP address, then associate it with the new instance
  • If the original instance is a Reserved Instance, change the Availability Zone for your reservation

 

Q43. What Is Shared Ami ?

A shared AMI is an AMI that a developer created and made available for other developers to use.

One of the easiest ways to get started with Amazon EC2 is to use a shared AMI that has the components you need and then add custom content. You can also create your own AMIs and share them with others.

Use a shared AMI at your own risk. Amazon can’t vouch for the integrity or security of AMIs shared by other Amazon EC2 users. AWS recommends that you get an AMI from a trusted source.

 

Q44. How You Will Change The Root Ebs Device Of My Amazon Ec2 Instance ?

Stop the instance.

Detach the root EBS volume.

Attach the alternate EBS volume (as the root e.g. /dev/sda1)

Start the instance.

This presupposes that your alternate EBS volume is bootable, of course – it has to contain the bootable OS image.

 

Q45. What Is The Difference Between A Spot Instance And A Demand Instance On Ec2 ?

On-Demand” instances allow the user to use the compute by hour without requiring long term commitment. There are no guarantees that the user will always be able to launch specific instance types in an availability zone, though AWS tries it’s best to meet the needs. This service is preferable for POCs and they do not suffer an interruption of the service(by AWS) like Spot instances.

 

Spot” instances are a bid_for_low_price version of On-Demand instances, but could be shut down by AWS anytime the Spot instance price goes higher than bid price. Spot price fluctuates based on the supply and demand of the capacity. It’s essentially the leftover capacity of AWS to be used. There is no difference in the performance compared to On-Demand instances and is usually cheaper than On-demand instances as there is no guarantee provided over the availability. The user can choose a start time and end time for the instances or can make a persistent request(no end time specified) for this service. This service is preferable for computing needs which are not tied to any deadlines, computing needs are large and the interruption of service is acceptable.

 

Q46. What is Spot Fleet?

Spot fleet: set of spot instances + (optional) on demand instances. Allows us to automatically request spot instances with lowest price. 

 

Q47. What are EC2 Placement Groups and types? 

Placement Groups in AWS determines how instances are placed on underlying hardware

AWS now provides three types of placement groups

Cluster – clusters instances into a low-latency group in a single AZ

Partition– spreads instances across logical partitions, ensuring that instances in one partition do not share underlying hardware with instances in other partitions

Spread– spreads instances across underlying hardware

 

Q48. What is Elastic Network Interface (ENI)?

Elastic Network Interface (ENI) is a logical component in VPC that represent virtual network card. ENI are bound to specific AZ. ENI consists of primary private IP, one or more secondary IP, one public IPV4, one elastic IP per IPV4, one or more security groups and a mac address. 

 

Q49. What is EC2 Hibernate?

With EC2 hibernate -The in-memory RAM is preserved. – The instance boot is faster. – Under the hood the RAM state is written in EBS. – The root volume must be enough. An instance can not be hibernated for more than 60 days. 

 

Q50. What is EC2 connect? 

Let connect you EC2 with browser. Need port 22 open and work only for Amazon Linux.

 

Q51. Explain EC2 metadata? 

EC2 metadata lets you find details about EC2. 

metadata= information about EC2. 

It allows EC2 instances to learn about themselves without using any IAM roles.

 

Q52. What are EBS volume types?

EBS Volume Type: 

  1. General Purpose SSD: gp2/gp3 (SSD), cost effective storage, low latency, 

1GiB- 16TiB. 

    Gp2: small gp2 volume can brust to 3000 IOPS. Size of volume and IOPS are limited. Max is 16000 IOPS. 

    Gp3: Base line of 3000 IOPS & throughput of 125 MB/s. can increase IOPS upto 16000 and throughput upto 1000MB/s independently.

  1. Provisioned IOPS SSD: io1/io2. Critical business application with sustained IOPS or application that needs more than 16000 IOPS.  Great for database workload. It supports EBS-multi attach. Io1/io2 & io2 Block express. 

    Io1/io2 (4 GB – 16 TB): max provisioned IOPS=64000 for nitro instances and 32000 for other. Can increase IOPS independently from storage size.  Io2 has more durability and more IOPS per GB with same price as io1. 

    Io2 Block Express: (4 GB – 64 TB) – sub millisecond latency and max IOPS= 256000

  1. Hard Drive Disk (HDD): can not be boot volume and 125GB to 16 GB only. 

    Throughput Optimized(st1) – Big data, data warehouse, log processing etc. max throughput – 500 MB and 500 IOPS

    Cold HDD (sc1): for data that is infrequently used. Max throughput=250 MB, max IOPS=250 MB, scenarios where lowest cost is important.

    

    

Q53. What is Elastic Load Balancer(ELB)?

Elastic Load Balancer distributes incoming application or network traffic across multiple targets, such as EC2 instances, containers (ECS), Lambda functions, and IP addresses, in multiple Availability Zones.

  • Seamlessly handle failures of downstream instances
  • Do regular health checks to your instances
  • Provide SSL termination (HTTPS) for your websites
  • Enforce stickiness with cookies
  • High availability across zones
  • Separate public traffic from private traffic
  • Deleting ELB won’t delete the instances registered to it.
  • Cross Zone Load Balancing – when enabled, each load balancer node distributes traffic across the registered targets in all enabled AZs.
  • Supports SSL Offloading which is a feature that allows the ELB to bypass the SSL termination by removing the SSL-based encryption from the incoming traffic.

    

 Q54. What are ELB types? 

 AWS has 4 kinds of managed Load Balancers

  1. Classic Load Balancer
  2. Application Load Balancer
  3. Network Load Balancer
  4. Gateway Load Balancer 

 

Q55. Explain Classic Load Balancer (CLB).

Classic Load Balancer  supports HTTP, HTTPS, TCP

Supports TCP (layer 4) and  HTTP-HTTPS (layer 7)

AWS recommends using Application or Network load balancers instead.

 

Q56. Explain Application Load Balancer (ALB)

It Supports HTTP, HTTPS, WebSocket

ALB is layer 7 (HTTP). Supports redirects from HTTP to HTTPS.

ALB are a great fit for micro services & container-based application. For example: Docker & Amazon ECS.

Routing tables to different target groups:

  • Routing based on path in URL (example.com/users & example.com/posts)
  • Routing based on hostname in URL (one.example.com & other.example.com)
  • Routing based on Query String, Headers

 

Q57. Explain Network Load Balancer (NLB)

It supports TCP, TLS (secure TCP) & UDP

Network load balancers (Layer 4) allow to:

Forward TCP & UDP traffic to your instances

Handle millions of request per seconds

Less latency ~100 ms (vs 400 ms for ALB)

NLB has one static IP per AZ, and supports assigning Elastic IP (helpful for whitelisting specific IP)

NLB are used for extreme performance, TCP or UDP traffic

Not included in AWS free tier.

 

Q58. Explain Gateway Load Balancer. 

Operates at layer 3 – IP packets. Deploy, scale and manages a fleet of 3rd party network appliance in AWS. Uses GENEVE protocol on 7081 port. Target groups are EC2 Instances and IP addresses. 

 

Q59. What Are The Main Features Of Classic Load Balancer In Ec2 ?

Some of the main features of Classic Load Balancer (CLB) in Amazon EC2 are as follows:

  1. Health Check: Based on the result of Health Check, Classic Load Balancer can decide to route the traffic. If any instance has unhealthy results, CLB will not route the traffic to that instance.
  2. Security: We can create security groups for CLB in Virtual Private Cloud (VPC). With these features, it is easy to implement secure load balancing within a network.
  3. High Availability: With CLB, we can distribute traffic among EC2 instances in single or multiple Availability Zones. This helps in providing a very high scale of availability for the incoming traffic.
  4. Sticky Sessions: CLB also supports sticky session by using cookies. The sticky sessions make sure that the traffic from a user is always routed to the same instance so that user gets seamless experience.
  5. IPv6: CLB also support Internet Protocol version 6.
  6. Operational Monitoring: We can also perform operational monitoring CLB and collect statistics on request count, latency etc. These metrics can be monitored in CloudWatch.

 

Q60. What Are The Main Features Of Application Load Balancer (alb) In Amazon Ec2 ?

Main features of Application Load Balancer (ALB) are as follows:

  1. Content-Based Routing: In ALB, we can make use of content in the request to decide the routing of a request to a specific service.
  2. HTTP/2: ALB supports the new version of HTTP protocol. In this protocol, we can send multiple requests on the same connection. It also supports TLS and header compression.
  3. WebSockets: ALB supports WebSockets in EC2. With WebSockets, a server can exchange real-time messages with the end-users.
  4. Layer-7 Load Balancing: ALB can also load balance HTTP/HTTPS application with layer-7 specific features.
  5. Delete Protection: ALB also provides the Delete Protection option by which we can prevent it from getting deleted by mistake.
  6. Containerized Application Support: We can use ALB to load balance multiple containers across multiple ports on the same EC2 instance.

 

Q61. What Is A Placement Group In Ec2 ?

AWS provides an option of creating a Placement Group in EC2 to logically group the instances within as single Availability Zone.

We get the benefits of low network latency and high network throughput by using a Placement Group.

Placement Group is a free option as of now. When we stop an instance, it will run in same Placement Group in restart at a later point of time. 

The biggest limitation of Placement Group is that we cannot add Instances from multiple availability zones to one Placement Group

 

Q62. Can you mention some advantages and disadvantages of utilising Amazon EC2?

The following are some of the benefits and drawbacks of utilising Amazon EC2.

Pros:

  • It is incredibly appealing because it has the flexibility to scale up resources for cloud deployment based on demand.
  • Because cloud hosting provides exceptional backup capabilities, reverting to a previous version is a simple; additionally, the cloud infrastructure eliminates the need for us to maintain local hardware resources.

Cons:

  • The entire configuration and spin-up process necessitates a high level of technical expertise.
  • There is a slight deficiency in training documents and support. We attempted to employ Lambda expressions in programme flow execution but discovered few materials on the issue.

 

Q63. What is the difference between a public IP address and an EIP address?

It’s a standard public IP address that’s connected with an EC2 instance. The instances can host resources on the internet using this address. When an instance is stopped, the Public Address associated with it is released, and when the instance is restarted, a new Public Address is issued, which updates the host record on DNS Server.

EIP stands for Elastic IP Address, which is a static Public Address associated with an EC2 instance. Even if a server is stopped and restarted, the EIP will not change. In a similar way to Public Address, this address allows an instance to host resources on the public internet.

Q64. What is an ELB?

ELB stands for Elastic Load balancing. ELB automatically distributes the incoming application traffic or network traffic across multiple targets like EC2, containers, IP addresses.

 

Q65. You have an EC2 instance that has an unencrypted volume. You want to create another Encrypted volume from this unencrypted volume. How can you achieve this?

Create a snapshot of the unencrypted volume (applying encryption parameters), copy the. Snapshot and create a volume from the copied snapshot

 

Q66. What is auto-scaling?  How does it work?

Autoscaling is a feature of AWS which allows you to configure and automatically provision and spinup new instances without the need for your intervention.  You do this by setting thresholds and metrics to monitor.  When those thresholds are crossed a new instance of your choosing will be spun up, configured, and rolled into the load balancer pool.  Voila you’ve scaled horizontally without any operator intervention!

Vertical Scalability: Increasing in EC2 instance like from t2.micro to m5.large (scale up or down) 

Horizontal Scalability: Adding more similar type of Instance (scale in/out)

 

Q67. What are the Best Practices for Security in Amazon EC2?

  • Restrict access and allow only trusted hosts or networks to use the instance ports, using EC2 Security groups.
  • Use AWS Identity and access management (IAM roles) for access control.
  • Disable password-based login.
  • Do not open S3 storage buckets for public access unless needed.

 

Q68. List some connection issues that can be faced while connecting to an EC2 instance?

The connection issues which you might face while connecting to the EC2 instance are 

  • Host key missing
  • Connection timeout 
  • User key unrecognized
  • Server refusing key

 

Q69. Name the cloud watch merits available for EC2 instances?

In general, the cloud watch metrics available are 

  • CPU credit balance
  • CPU utilization
  • CPU credit balance
  • Disk writes
  • Disk reads
  • Networking 
  • Network out

 

Q70. What is the way to recover a lost EC2 instance?

The root volume of the instance has to be detached

  • By modifying the configuration file
  • By restarting the original instance
  • By attaching importance to a temporary instance

 

Q71.  What is the medium to recover EC2 instance by configuring CloudWatch

Following are the medium to retrieve EC2 samples:

  • By creating an alarm using Amazon CloudWatch
  • Then go to the Define alarm action tab 
  • Finally, choose to recover this instance option

 

Q72. When does your instance show retired state?

Retired state only available in Reserved instances. Once the reserved instance reserving time (1 yr/3 yr) ends it shows Retired state.

 

Q73.  Scenario: My EC2 instance IP address change automatically while instance stop and start. What is the reason for that and explain solution?

AWS assigned Public IP automatically but it’s change dynamically while stop and start. In that case we need to assign Elastic IP for that instance, once assigned it doesn’t change automatically.

 

Q74. What is cold HDD and Throughput-optimized HDD?

Cold HDD: Cold HDD volumes are designed for less frequently accessed workloads. These volumes are significantly less expensive than throughput-optimized HDD volumes.

EBS Volume size: 500 GB to 16 TB Maximum IOPS: 200 IOPS Maximum throughput: 250 MB

Throughput-Optimized HDD: Throughput-optimized HDD volumes are low cost HDD volumes designed for frequent access, throughput-intensive workloads such as big data, data warehouse.

EBS Volume size: 500 GB to 16 TB Maximum IOPS: 500 IOPS Maximum throughput: 500 MB

 

Q75. What are Amazon EBS-Optimized instances?

Amazon EBS optimized instances to ensure that the Amazon EC2 instance is prepared to take advantage of the I/O of the Amazon EBS Volume. An amazon EBS-optimized instance uses an optimized configuration stack and provide additional dedicated capacity for Amazon EBS I/When you select Amazon EBS-optimized for an instance you pay an additional hourly charge for that instance.

 

Q76. How to connect EBS volume to multiple instances?

We can’t able to connect EBS volume to multiple instance, but we can able to connect multiple EBS Volume to single instance

 

Q77. What is Status Checks in AWS Ec2?

  • System Status Checks – System Status checks will look into problems with instance which needs AWS help to resolve the issue. When we see system status check failure, you can wait for AWS to resolve the issue, or do it by our self.
  • Network connectivity
  • System power
  • Software issues Data Centre’s
  • Hardware issues
  • Instance Status Checks – Instance Status checks will look into issues which need our involvement to fix the issue. if status check fails, we can reboot that particular instance.
  • Failed system status checks
  • Memory Full
  • Corrupted file system
  • Kernel issues

Q78. Maximum number of EC2 which can be created in VPC.

Maximum 20 instances can be created in a VPC. we can create 20 reserve instances and request for spot instance as per demand.

 

Q79. Benefits of Auto Scaling in AWS

Auto Scaling your application leads to the following benefits:

  • Better fault tolerance
  • High availability of resources
  • Better cost management
  • High reliability of resources
  • The high flexibility of resources

 

Q80. Explain Auto Scaling Groups – Scaling Policies.

Auto Scaling Groups – Scaling Policies are : 

1) Target Tracking Scaling

Most simple and easy to set-up

Example: I want the average ASG CPU to stay at around 40%

2) Simple / Step Scaling:

This scaling plan lets the user define parameters that control the scaling procedure such as CPU utilization, memory, etc.

When a CloudWatch alarm is triggered (example CPU > 70%), then add 2 units

When a CloudWatch alarm is triggered (example CPU < 30%), then remove 1.

3) Scheduled Actions:

This scaling plan comes in handy in situations where the user can predict when the traffic on the application is going to increase. In such cases, the user can schedule the time when AWS auto scaling should be executed.

Anticipate a scaling based on known usage patterns.

Final Words

It is really important to be up to date. We keep updating AWS EC2 interview questions if any new questions are being asked. 

 

Hope, we’ve covered most of the frequently asked AWS EC2 interview questions asked during many interviews of the companies that are using AWS services. You can get placed even in Amazon itself if you’re competent enough with necessary skills and a valid AWS certification in hand. We will try to regularly update this guide so as to make you competent enough in this highly sought after career. If you come across any doubts, feel free to check our extensive collection of AWS resources.

Related Posts:

Amazon Web Service – AWS Tutorial

What is Amazon EC2? – Amazon Elastic Compute Cloud

What is Elastic Load Balancer (ELB) in AWS?

What is Auto Scaling in AWS ?

AWS EC2 Cheat Sheet

https://aws.amazon.com/ec2/faqs/