Validation Quiz - MODULE 2
This 30-question quiz allows you to validate your knowledge of Amazon EC2 before moving on to the practical lab.
Question 1
What does EC2 stand for?
A) Elastic Cloud Computing
B) Elastic Compute Cloud
C) Enterprise Cloud Computing
D) Extended Compute Cluster
See the answer
Answer: B
EC2 stands for Elastic Compute Cloud. It is AWS's main computing service that allows launching instances (virtual machines) with resizable capacity. The term "Elastic" refers to the ability to scale resources up or down as needed.
Question 2
What is an EC2 instance?
A) A Docker container
B) A virtual machine in the AWS cloud
C) A dedicated physical server
D) A database service
See the answer
Answer: B
An EC2 instance is a virtual machine running on AWS's physical servers. It provides resizable computing capacity and allows running operating systems and applications as on a physical server, but with the flexibility of the cloud.
Question 3
Which EC2 instance family is optimized for memory-intensive workloads?
A) C Family (Compute Optimized)
B) R Family (Memory Optimized)
C) T Family (Burstable)
D) G Family (Accelerated Computing)
See the answer
Answer: B
The R Family (Memory Optimized) is designed for workloads that process large datasets in memory, such as in-memory databases, distributed caches, and real-time analytics. Types include R5, R6i, R6g, X1, X2idn.
Question 4
Which EC2 instance family offers a balance of compute, memory, and network resources?
A) C Family
B) R Family
C) M Family (General Purpose)
D) I Family
See the answer
Answer: C
The M Family (General Purpose) offers a balance of compute, memory, and network resources. It is suitable for a wide variety of workloads such as web servers, development environments, and enterprise applications. Types include M5, M6i, M6g.
Question 5
What does the "g" in an instance type like m6g.large stand for?
A) GPU
B) Generation
C) Graviton Processor (ARM)
D) Global
See the answer
Answer: C
The "g" indicates that the instance uses AWS Graviton processors based on ARM architecture. These processors are designed by AWS and offer a better price/performance ratio for many workloads. For example, m6g uses Graviton2, m7g uses Graviton3.
Question 6
How is the instance name "c5.2xlarge" broken down?
A) Family-Generation.Size
B) Region-Type.Version
C) Category-Version.Memory
D) Service-Zone.CPU
See the answer
Answer: A
The format is Family-Generation.Size. In c5.2xlarge: "c" is the family (Compute Optimized), "5" is the generation, "2xlarge" is the size. Sizes range from nano, micro, small, medium, large, xlarge, 2xlarge up to 24xlarge or more.
Question 7
What is a T3 instance with CPU credits?
A) A dedicated instance
B) A burstable instance that accumulates credits when CPU usage is low
C) A spot instance
D) A reserved instance
See the answer
Answer: B
T3 instances are burstable instances that provide a baseline level of CPU performance with the ability to burst above that level. They accumulate CPU credits when usage is below the baseline threshold and consume them during activity peaks.
Question 8
What is the difference between an AWS region and an availability zone?
A) No difference
B) A region contains multiple geographically separated availability zones
C) An availability zone contains multiple regions
D) Regions are for storage, AZs for compute
See the answer
Answer: B
An AWS region is a geographic area (e.g., us-east-1, eu-west-1) that contains at least 3 availability zones (AZ). Each AZ consists of one or more data centers with independent infrastructure. AZs within the same region are connected by a low-latency network.
Question 9
How is an availability zone identifier written?
A) region-number (e.g., us-east-1)
B) region-letter (e.g., us-east-1a)
C) az-number (e.g., az-1)
D) zone-region (e.g., zone-us-east)
See the answer
Answer: B
An AZ identifier consists of the region name followed by a letter. For example: us-east-1a, us-east-1b, eu-west-1c. AWS randomly maps letters to physical AZs for each account to distribute the load.
Question 10
Why deploy instances in multiple availability zones?
A) To reduce costs
B) For high availability and fault tolerance
C) To increase performance
D) It's mandatory
See the answer
Answer: B
Deploying in multiple AZs ensures high availability. If one AZ experiences a failure (natural disaster, power outage), instances in other AZs continue to operate. It's a fundamental best practice for critical applications.
Question 11
What is an AMI (Amazon Machine Image)?
A) An image file format
B) A template containing the operating system and software to launch an instance
C) A type of storage
D) A monitoring service
See the answer
Answer: B
An AMI is a template that contains the software configuration needed to launch an instance: operating system, application server, applications. It also includes storage configuration (root device). You can use AWS, community, or create your own AMIs.
Question 12
What are the root device types for an AMI?
A) SSD and HDD only
B) EBS-backed and Instance Store-backed
C) S3 and Glacier
D) Local and Remote
See the answer
Answer: B
AMIs have two root device types: EBS-backed (the root volume is a persistent EBS volume) and Instance Store-backed (the root volume is ephemeral storage on the host). EBS-backed is recommended as data persists after stopping and starting is faster.
Question 13
Can an AMI created in the us-east-1 region be used directly in eu-west-1?
A) Yes, AMIs are global
B) No, you must copy the AMI to the other region
C) Yes, but with additional fees
D) No, it's impossible
See the answer
Answer: B
AMIs are regional. To use an AMI in another region, you must copy it using the "Copy AMI" feature. This creates a new independent AMI in the destination region with a new AMI ID.
Question 14
What is a Security Group in AWS?
A) An IAM user group
B) A virtual firewall at the instance level that controls inbound and outbound traffic
C) A group of EC2 instances
D) An encryption service
See the answer
Answer: B
A Security Group acts as a virtual firewall for EC2 instances. It controls inbound and outbound traffic at the instance level. Rules specify the protocol, port, and allowed source/destination.
Question 15
What is the default behavior of a Security Group?
A) All traffic is allowed
B) All inbound traffic is blocked, all outbound traffic is allowed
C) All traffic is blocked
D) Only SSH is allowed
See the answer
Answer: B
By default, a Security Group blocks all inbound traffic and allows all outbound traffic. You must explicitly add inbound rules to allow necessary incoming traffic (SSH, HTTP, etc.). Security Groups are stateful: if inbound traffic is allowed, the outbound response is automatically allowed.
Question 16
What does "stateful" mean for a Security Group?
A) Rules are stored permanently
B) If inbound traffic is allowed, the outbound response traffic is automatically allowed
C) Rules change according to the instance state
D) Security Groups keep a history
See the answer
Answer: B
Stateful means the Security Group tracks the state of connections. If you allow an incoming request on port 80, the outbound response is automatically allowed, even without an explicit outbound rule. This simplifies configuration compared to stateless firewalls.
Question 17
How many Security Groups can be attached to an EC2 instance?
A) Only 1
B) Up to 5 by default (modifiable)
C) Unlimited
D) Maximum 2
See the answer
Answer: B
By default, you can attach up to 5 Security Groups to a network interface (and thus to an instance). This limit can be increased by requesting a quota increase. All rules from all attached Security Groups are evaluated together.
Question 18
Can you modify a Security Group attached to a running instance?
A) No, you must stop the instance
B) Yes, changes take effect immediately
C) Yes, but after a restart
D) No, you must create a new instance
See the answer
Answer: B
Changes made to a Security Group take effect immediately on all instances using it. There is no need to stop or restart the instances. This is a very useful feature for quickly adjusting security.
Question 19
What is a key pair in EC2?
A) A login/password pair
B) A pair of cryptographic keys (public/private) for SSH authentication
C) Two linked instances
D) An Access Key/Secret Key pair
See the answer
Answer: B
An EC2 key pair is a pair of asymmetric cryptographic keys. The public key is stored in the instance, the private key is downloaded by the user. This pair allows secure SSH authentication without a password. The private key (.pem) must be kept secure.
Question 20
What happens if you lose your EC2 private key?
A) AWS can send you a copy
B) You can no longer connect via SSH with that key pair
C) The key is automatically regenerated
D) The instance is automatically deleted
See the answer
Answer: B
AWS does not store private keys and cannot recover them. If you lose your private key, you can no longer connect via SSH with that key pair. Solutions: use EC2 Instance Connect, Systems Manager Session Manager, or create an AMI and relaunch with a new key pair.
Question 21
Which port is used by default for SSH?
A) 80
B) 443
C) 22
D) 3389
See the answer
Answer: C
Port 22 is the standard port for SSH (Secure Shell). To connect via SSH to a Linux instance, you must allow port 22 in the Security Group. Port 3389 is for RDP (Windows), 80 for HTTP, 443 for HTTPS.
Question 22
Which port is used by default for RDP (Remote Desktop Protocol)?
A) 22
B) 80
C) 443
D) 3389
See the answer
Answer: D
Port 3389 is the standard port for RDP, used to remotely connect to Windows instances. To allow RDP connection, you must open port 3389 in the Security Group of the Windows instance.
Question 23
Which command allows you to connect via SSH to an EC2 instance?
A) ssh instance-id
B) ssh -i key.pem ec2-user@public-ip
C) connect ec2 instance
D) aws ec2 ssh instance-id
See the answer
Answer: B
The syntax is ssh -i path/to/key.pem user@ip-address. The -i parameter specifies the private key. The default user depends on the AMI: ec2-user (Amazon Linux), ubuntu (Ubuntu), admin (Debian), centos (CentOS).
Question 24
What permission should the private key file (.pem) have on Linux/Mac?
A) 777
B) 644
C) 400 or 600
D) 755
See the answer
Answer: C
The private key file must have restrictive permissions: 400 (read-only for the owner) or 600 (read/write for the owner). SSH will refuse to work if the key is accessible by other users. Use chmod 400 key.pem to set the permissions.
Question 25
What are the possible states of an EC2 instance?
A) On, Off
B) pending, running, stopping, stopped, shutting-down, terminated
C) Active, Inactive
D) Started, Paused, Ended
See the answer
Answer: B
The states of an EC2 instance are: pending (starting up), running (operational), stopping (shutting down), stopped (halted), shutting-down (terminating), terminated (permanently terminated). Each state transition has implications on billing and data.
Question 26
What is the difference between "Stop" and "Terminate" for an EC2 instance?
A) No difference
B) Stop temporarily halts (EBS data retained), Terminate permanently deletes the instance
C) Stop is for Linux, Terminate for Windows
D) Terminate is temporary, Stop is permanent
See the answer
Answer: B
Stop halts the instance but retains the EBS volumes and configuration. The instance can be restarted later. Terminate permanently deletes the instance and its EBS volumes (unless "Delete on Termination" is disabled). A terminated instance cannot be recovered.
Question 27
Are you billed for an EC2 instance in the "stopped" state?
A) Yes, at the same rate
B) No, no charges
C) No for compute, but yes for EBS storage
D) Yes, at a reduced rate
See the answer
Answer: C
A stopped instance is not billed for compute (CPU/memory), but the attached EBS volumes continue to incur charges. Elastic IP addresses not attached to a running instance are also billed. This is important for cost optimization.
Question 28
What is EC2 Instance Connect?
A) A VPN for EC2
B) A method of SSH connection via browser without managing keys
C) A monitoring service
D) A load balancer
See the answer
Answer: B
EC2 Instance Connect allows SSH connection to an instance via the AWS console or AWS CLI without needing to manage SSH keys. AWS generates a temporary one-time-use key. It's convenient and secure, but requires the EC2 Instance Connect agent to be installed on the instance.
Question 29
Which AWS CLI command lists EC2 instances?
A) aws ec2 list-instances
B) aws ec2 describe-instances
C) aws ec2 get-instances
D) aws ec2 show-instances
See the answer
Answer: B
The command aws ec2 describe-instances returns detailed information about EC2 instances. You can filter with --filters or --instance-ids. The result includes state, type, IP addresses, Security Groups, etc.
Question 30
What is peculiar about the public IP address of an EC2 instance?
A) It is permanent
B) It changes if the instance is stopped and then restarted
C) It is always the same as the private IP
D) It does not exist
See the answer
Answer: B
The automatically assigned public IP address of an EC2 instance is dynamic: it changes if the instance is stopped and then restarted. To have a permanent public IP, you need to use an Elastic IP, which is a static IPv4 address allocated to the AWS account.
Result
Count your correct answers:
- 27-30: Excellent - You master EC2 concepts
- 22-26: Good - A few points to review
- 17-21: Average - Review the course before the lab
- Less than 17: Insufficient - Start the course from the beginning
Proceed to the EC2 Architecture Lab once you have achieved at least 22 correct answers.