HireHireInterview Quizzes › Cloud Engineer

Cloud Engineer Interview Questions

Think you're ready? These are the questions that actually decide Cloud Engineer interviews. Warm up on Easy — then face the Hard round, where 95% of candidates crumble. 80 questions across 3 levels, instant score, completely free.

80Questions
3Difficulty levels
95%Fail the hard round
FreeInstant score
Easy
Warm-up · 20 Qs
Medium
Practical · 30 Qs
Hard
Brutal · 30 Qs
⚡ Take the Cloud Engineer quiz — get your score →

The Cloud Engineer interview questions

Below are the real questions, grouped by difficulty. Expand any one to reveal the correct answer and why — or take the timed quiz for a score you can share. Can you clear the Hard round?

Easy round 20 questions

You add an inbound rule to a security group allowing port 443. Do you also need a matching outbound rule for the response traffic to reach the client?
  • A. No, security groups are stateful so return traffic is allowed automatically ✓
  • B. Yes, you must add a matching outbound rule for every response
  • C. Yes, but only for UDP traffic
  • D. No, but only if you also attach a NACL
Correct answer: A. Security groups are stateful, so responses to allowed inbound traffic are permitted without an explicit outbound rule.
An e-commerce app gets heavy traffic every evening and is idle at night. Which approach best keeps it responsive while controlling cost?
  • A. Run a fixed large fleet of servers 24/7
  • B. Configure auto scaling to add instances as load rises and remove them as it falls ✓
  • C. Manually launch extra servers each evening by hand
  • D. Permanently upgrade to the largest instance size
Correct answer: B. Auto scaling matches capacity to demand automatically, giving responsiveness during peaks and savings when idle.
A load balancer's health check for one backend instance begins failing. What does the load balancer do?
  • A. Terminates the failing instance immediately
  • B. Stops routing new requests to that instance while continuing to serve traffic from healthy ones ✓
  • C. Sends all traffic to the failing instance to retest it
  • D. Fails the entire application until the instance recovers
Correct answer: B. A load balancer routes around unhealthy targets, sending requests only to instances passing health checks.
To keep a web tier available even if one data center fails, you should deploy your instances across...
  • A. A single availability zone using larger instances
  • B. Multiple availability zones within the region ✓
  • C. One availability zone with more frequent backups
  • D. A single zone with a bigger disk volume
Correct answer: B. Spreading instances across multiple availability zones survives the failure of any one data center.
Compliance logs must be retained for 7 years but are almost never read. Which storage choice fits best?
  • A. A standard, frequently-accessed object tier
  • B. An archival/cold storage tier such as Glacier ✓
  • C. An in-memory cache
  • D. A local instance store volume
Correct answer: B. Rarely-accessed long-term data belongs in cheap archival storage optimized for infrequent retrieval.
A batch job only needs to read files from one bucket. Following least privilege, its IAM role should have...
  • A. Full administrator access for convenience
  • B. Read-only permission scoped to that single bucket ✓
  • C. Write access to all buckets in the account
  • D. The root account credentials
Correct answer: B. Least privilege grants only the minimum permission needed—here, read-only on the one required bucket.
An instance has a public IP but still cannot reach the internet. The most likely missing piece is...
  • A. A route to an internet gateway in the subnet's route table ✓
  • B. A NAT gateway added to the subnet's route table
  • C. An outbound security-group rule permitting all traffic
  • D. An Elastic IP in place of the auto-assigned public IP
Correct answer: A. Without a route to an internet gateway, a subnet stays private regardless of the instance's public IP.
You need a server's public IP to remain the same across stop/start cycles. You should...
  • A. Rely on the auto-assigned public IP
  • B. Attach a static/elastic IP to the instance ✓
  • C. Only reboot the instance instead of stopping it
  • D. Attach an additional elastic network interface (ENI)
Correct answer: B. Auto-assigned public IPs change on stop/start; a static/elastic IP stays fixed and can be reattached.
Users far from your origin server complain that images load slowly. What helps most?
  • A. Serving images through a CDN that caches them at edge locations near users ✓
  • B. Adding a read replica of the database in another region
  • C. Upgrading the origin to a larger, faster instance type
  • D. Adding more origin servers behind a load balancer
Correct answer: A. A CDN caches content at edge locations close to users, cutting latency for geographically distant requests.
Read queries are overwhelming your primary database. To offload the reads you add a...
  • A. Read replica that serves read traffic ✓
  • B. Second primary that also accepts writes
  • C. Multi-AZ standby instance to handle the reads
  • D. Larger primary instance with more memory
Correct answer: A. A read replica handles read-only traffic, relieving load on the primary while writes stay on the primary.
To let a web app scale horizontally behind a load balancer, user session state should be...
  • A. Stored in memory on each individual server
  • B. Kept in a shared external store so any server can serve any request ✓
  • C. Disabled entirely for all users
  • D. Permanently pinned so each user always hits one fixed server
Correct answer: B. Externalizing session state makes servers stateless, so any instance can handle any request as the fleet scales.
You lowered a DNS record's TTL to 60 seconds shortly before a planned IP migration. Why?
  • A. To make resolvers cache the old record for longer
  • B. So clients pick up the new IP quickly after the change ✓
  • C. So the old and new IPs both resolve simultaneously during the change
  • D. To let the record fail over automatically if the new server is down
Correct answer: B. A short TTL means caches expire fast, so clients resolve the new IP soon after the record is updated.
You run the same unchanged Terraform configuration a second time. What should happen?
  • A. It recreates all resources from scratch
  • B. It reports no changes because actual state already matches desired state ✓
  • C. It deletes all managed resources
  • D. It duplicates every resource
Correct answer: B. Infrastructure-as-code is idempotent—if reality already matches the config, no changes are applied.
What is the best-practice way to supply environment-specific config (like a database URL) to a container?
  • A. Hardcode the values inside the image
  • B. Pass them in at runtime via environment variables ✓
  • C. Rebuild a separate image for each environment
  • D. Write them as comments in the Dockerfile
Correct answer: B. Injecting config at runtime keeps one portable image reusable across environments without rebuilds.
Data moving between a user's browser and your web server is protected primarily by...
  • A. Encryption at rest on the disk
  • B. TLS/HTTPS encryption in transit ✓
  • C. Nightly volume snapshots
  • D. IAM permission policies
Correct answer: B. TLS/HTTPS encrypts data in transit between client and server; encryption at rest protects stored data instead.
A fault-tolerant batch job that can safely restart if interrupted is a good candidate for...
  • A. On-demand instances exclusively
  • B. Spot/preemptible instances for lower cost ✓
  • C. A mandatory 3-year reserved commitment
  • D. Dedicated bare-metal hosts
Correct answer: B. Interruptible, restartable workloads suit cheap spot instances, tolerating occasional reclamation.
Your single server is fully maxed out and can't be upsized any further. To handle more load you...
  • A. Vertically scale to an even larger instance type
  • B. Add more servers behind a load balancer to share the traffic ✓
  • C. Add a read replica to the database tier
  • D. Enable a CDN to cache dynamic responses
Correct answer: B. When vertical scaling hits its limit, you scale horizontally by adding servers behind a load balancer.
You set an alarm to fire only when CPU stays above 90% for 5 continuous minutes. Why the 5-minute window?
  • A. To avoid alerting on brief, harmless spikes ✓
  • B. To give auto scaling time to add capacity before alerting
  • C. To ensure the alarm can only fire once per day
  • D. Because CloudWatch only samples CPU every 5 minutes
Correct answer: A. A sustained-duration threshold filters out momentary spikes, alerting only on genuinely persistent load.
Before applying a risky change to a production data volume, the safest first step is to...
  • A. Take a snapshot so you can restore if the change fails ✓
  • B. Detach the volume and reattach it after the change
  • C. Enable encryption on the volume first
  • D. Switch the volume to Provisioned IOPS
Correct answer: A. A pre-change snapshot gives a known-good restore point if the risky change goes wrong.
With a serverless function (like Lambda), how are additional concurrent requests handled?
  • A. You manually provision more servers
  • B. The platform automatically runs more concurrent instances of the function ✓
  • C. All requests queue behind a single instance
  • D. You must reboot the function to scale
Correct answer: B. Serverless platforms scale automatically by spinning up concurrent function instances as demand rises.

Medium round 30 questions

A web server EC2 instance in a public subnet cannot be reached from the internet, even though its security group allows inbound HTTP (port 80) from 0.0.0.0/0. The instance has a public IP. What is the MOST likely cause?
  • A. The subnet's route table has no route to an Internet Gateway ✓
  • B. The security group is missing an outbound rule for port 80
  • C. The instance needs an Elastic IP instead of a public IP
  • D. The subnet needs a NAT gateway to receive inbound internet traffic
Correct answer: A. A public subnet requires a route table entry directing 0.0.0.0/0 traffic to an Internet Gateway; without it, the instance is unreachable regardless of its public IP or security group.
You want to grant an EC2 application running on an instance permission to read objects from an S3 bucket. What is the recommended AWS practice?
  • A. Attach an IAM role to the EC2 instance with an S3 read policy ✓
  • B. Store an IAM user's access keys in the application's config file
  • C. Make the S3 bucket public and restrict by the instance's IP
  • D. Use the AWS account root credentials in an environment variable
Correct answer: A. Attaching an IAM role to the instance provides temporary, automatically-rotated credentials, avoiding the risk of hardcoding long-lived access keys.
A containerized application reads its database password from an environment variable. Which approach best keeps this secret out of the Docker image and source control?
  • A. Inject the secret at runtime from a secrets manager or orchestrator secret ✓
  • B. Hardcode it in the Dockerfile using an ENV instruction
  • C. Bake it into the image and mark the image registry as private
  • D. Commit it to a .env file tracked in the Git repository
Correct answer: A. Injecting secrets at runtime (via a secrets manager or Kubernetes/ECS secret) keeps them out of the image layers and version control, where they would otherwise be recoverable.
Your Terraform apply fails midway, and the state file no longer matches real infrastructure. Before making changes, what is the safest first step to reconcile them?
  • A. Run terraform plan to see the difference between state and real resources ✓
  • B. Delete the state file and run terraform apply again
  • C. Manually edit the state file JSON to match reality
  • D. Run terraform destroy and recreate everything
Correct answer: A. terraform plan shows the drift between the recorded state and actual infrastructure without changing anything, letting you decide how to reconcile safely.
An Auto Scaling Group behind an Application Load Balancer is scaling out correctly under load, but new instances start receiving traffic before the app is ready, causing errors. What should you configure?
  • A. An ALB health check with an appropriate health check grace period ✓
  • B. A larger instance type for faster boot times
  • C. A scheduled scaling policy instead of dynamic scaling
  • D. A shorter health check interval on the instances
Correct answer: A. Configuring the load balancer health check plus a health check grace period ensures instances only receive traffic after they pass health checks and the app has finished initializing.
You need to store large volumes of infrequently accessed backup files at the lowest cost while still allowing retrieval within minutes when needed. Which S3 storage class is most appropriate?
  • A. S3 Glacier Flexible Retrieval (formerly Glacier) ✓
  • B. S3 Standard
  • C. S3 One Zone-Infrequent Access
  • D. S3 Glacier Deep Archive
Correct answer: A. Glacier Flexible Retrieval offers very low storage cost with expedited/standard retrievals in minutes to hours, unlike Deep Archive which takes up to 12 hours.
A Kubernetes pod is stuck in CrashLoopBackOff. Which command gives you the most direct insight into why the container is failing to start?
  • A. kubectl logs <pod> --previous ✓
  • B. kubectl get nodes
  • C. kubectl scale deployment <name> --replicas=0
  • D. kubectl describe service <name>
Correct answer: A. kubectl logs with --previous shows the output of the last crashed container instance, which typically contains the error causing the restart loop.
A CI/CD pipeline builds a Docker image on every commit, but builds are slow because dependencies are reinstalled each time. What is the most effective fix?
  • A. Order the Dockerfile so dependency installation happens before copying app code ✓
  • B. Use a larger build machine with more CPU
  • C. Combine all Dockerfile commands into a single RUN instruction
  • D. Disable the Docker build cache entirely
Correct answer: A. Placing dependency installation (a rarely-changing layer) before copying frequently-changing app code lets Docker cache the dependency layer across builds.
Two subnets in the same VPC cannot communicate with each other, though both have instances with correct security groups. What is the most likely misconfiguration?
  • A. A network ACL is blocking traffic between the subnets ✓
  • B. The VPC needs a peering connection between the subnets
  • C. The subnets are in different Availability Zones
  • D. The route table lacks the VPC's local route
Correct answer: A. Subnets in the same VPC route to each other automatically via the local route, so a restrictive Network ACL (which is stateless and applies per-subnet) is the likely blocker; peering is only needed across VPCs.
You are asked to reduce the blast radius of a compromised set of credentials for a service that only needs to write logs to one CloudWatch log group. Which IAM principle should guide your policy?
  • A. Least privilege — grant only the specific write action on that log group ✓
  • B. Grant CloudWatch full access for operational flexibility
  • C. Use a wildcard resource so future log groups are covered
  • D. Attach an AWS managed admin policy and monitor usage
Correct answer: A. Least privilege limits the policy to exactly the actions and resources needed, so compromised credentials can do minimal damage.
You need a stateless web tier to survive an entire Availability Zone failure without downtime. What is the most appropriate design?
  • A. Deploy all instances in one AZ behind a load balancer
  • B. Deploy instances across multiple AZs behind a load balancer with health checks ✓
  • C. Use a single large instance with a static Elastic IP
  • D. Store sessions on local instance disk and pin users to one instance
Correct answer: B. Spreading stateless instances across multiple AZs behind a load balancer with health checks lets traffic shift away from a failed AZ automatically.
A security group and a network ACL both control traffic to a subnet. What is a key difference?
  • A. Security groups are stateful; network ACLs are stateless ✓
  • B. Network ACLs are stateful; security groups are stateless
  • C. Both are stateful and identical in behavior
  • D. Neither can filter by port
Correct answer: A. Security groups are stateful (return traffic is automatically allowed), while network ACLs are stateless and require explicit inbound and outbound rules.
Your Terraform apply fails midway, leaving some resources created. What is the correct next step?
  • A. Delete the state file and start over
  • B. Manually delete all resources in the console immediately
  • C. Inspect the state, fix the config, and re-run apply so Terraform reconciles ✓
  • D. Roll back by restoring an older version of the state file
Correct answer: C. Terraform tracks created resources in state; fixing the configuration and re-running apply lets it reconcile the desired and actual state incrementally.
You want a private subnet's instances to reach the internet for updates but not be reachable from the internet. What do you use?
  • A. An internet gateway attached to the private subnet
  • B. A NAT gateway in a public subnet with a route from the private subnet ✓
  • C. A VPC peering connection
  • D. A public IP on each instance
Correct answer: B. A NAT gateway in a public subnet allows outbound-only internet access for private instances without exposing them to inbound connections.
A Docker container works locally but crashes in the cluster with 'OOMKilled'. What is the most likely cause?
  • A. The image tag is missing
  • B. The container exceeded its configured memory limit ✓
  • C. The registry credentials expired
  • D. DNS resolution failed inside the pod
Correct answer: B. OOMKilled indicates the container's memory usage exceeded its limit and the kernel's OOM killer terminated it.
You need to store database credentials for an application securely and rotate them automatically. What is the best approach?
  • A. Hardcode them in the application code
  • B. Store them in an environment variable in the Dockerfile
  • C. Use a managed secrets manager with automatic rotation ✓
  • D. Put them in a public S3 bucket
Correct answer: C. A managed secrets manager stores credentials encrypted, controls access via IAM, and supports automatic rotation without code changes.
Which strategy deploys a new version alongside the old one and shifts traffic gradually to limit risk?
  • A. Recreate deployment
  • B. Canary deployment ✓
  • C. In-place patching
  • D. Cold standby restore
Correct answer: B. A canary deployment routes a small percentage of traffic to the new version first, allowing validation before a full rollout.
An application's cloud bill spikes due to data transfer costs. Which is the most common driver to investigate first?
  • A. Egress traffic leaving the cloud or crossing regions/AZs ✓
  • B. The number of API requests made to the storage service
  • C. The volume of CloudWatch logs ingested
  • D. The number of EBS snapshots retained
Correct answer: A. Cross-region, cross-AZ, and internet egress data transfer are frequently overlooked cost drivers and the first place to investigate a transfer spike.
You have a Kubernetes pod that must reach a managed database only through a specific outbound port. What resource enforces this?
  • A. A ConfigMap
  • B. A NetworkPolicy ✓
  • C. A horizontal pod autoscaler
  • D. A persistent volume claim
Correct answer: B. A NetworkPolicy defines allowed ingress/egress traffic for pods, letting you restrict outbound connectivity to specific destinations and ports.
For a workload with steady, predictable 24/7 usage over three years, which pricing option usually minimizes cost?
  • A. On-demand instances
  • B. Spot instances
  • C. Reserved instances or committed-use discounts ✓
  • D. Dedicated hosts billed hourly
Correct answer: C. Reserved instances or committed-use discounts offer significant savings for steady, long-running workloads in exchange for a usage commitment.
What is the key difference between an AWS security group and a network ACL (NACL)?
  • A. Both are stateless and operate at subnet level
  • B. Security groups are stateful (instance-level); NACLs are stateless (subnet-level) ✓
  • C. Security groups are subnet-level; NACLs are instance-level
  • D. Both are stateful and operate at instance level
Correct answer: B. Security groups are stateful and attach to instances; NACLs are stateless and apply at the subnet boundary.
Which S3 storage class is most cost-effective for rarely accessed archival data with retrieval times of hours?
  • A. S3 Standard
  • B. S3 Standard-IA
  • C. S3 Glacier Deep Archive ✓
  • D. S3 Intelligent-Tiering
Correct answer: C. Glacier Deep Archive is the lowest-cost class, suited to long-term archives where hours-long retrieval is acceptable.
What does an Auto Scaling Group use to determine instance health?
  • A. Billing alarms only
  • B. CPU utilization only
  • C. EC2 status checks and/or ELB health checks ✓
  • D. Route 53 DNS records
Correct answer: C. ASGs replace instances that fail EC2 status checks or, when attached, ELB health checks.
To let an EC2 instance in a private subnet reach the internet for updates without being publicly reachable, you use:
  • A. A NAT gateway ✓
  • B. An internet gateway attached directly to the instance
  • C. VPC peering with a public VPC
  • D. A security group inbound rule
Correct answer: A. A NAT gateway allows outbound internet access from private subnets while blocking unsolicited inbound traffic.
In Terraform, what does `terraform plan` do?
  • A. Shows the proposed execution plan without making changes ✓
  • B. Applies all changes immediately
  • C. Destroys the managed infrastructure
  • D. Downloads and initializes providers
Correct answer: A. `terraform plan` previews the changes needed to reach the desired state without applying them.
Which IAM best practice grants only the permissions required for a task?
  • A. Role chaining
  • B. The principle of least privilege ✓
  • C. Mandatory MFA enforcement
  • D. Consistent resource tagging
Correct answer: B. Least privilege grants only the minimum permissions needed, reducing the blast radius of compromise.
Which statement describes a stateless application design for horizontal scaling?
  • A. Session state is stored externally so any instance can serve any request ✓
  • B. Session state is written to the instance's local disk
  • C. Each instance maintains its own unique in-memory state
  • D. Sticky sessions are always required
Correct answer: A. Externalizing session state lets any instance handle any request, enabling clean horizontal scaling.
What is the purpose of a load balancer's health check?
  • A. Encrypt traffic in transit
  • B. Route traffic only to healthy targets ✓
  • C. Cache frequently requested responses
  • D. Assign public IP addresses to targets
Correct answer: B. Health checks let the load balancer stop sending requests to targets that are failing.
In Kubernetes, which object ensures a specified number of pod replicas keep running?
  • A. A Service
  • B. A Deployment (managing a ReplicaSet) ✓
  • C. A ConfigMap
  • D. An Ingress
Correct answer: B. A Deployment manages a ReplicaSet that maintains the declared number of pod replicas.
What does a CDN primarily improve?
  • A. Reduces latency by caching content at edge locations near users ✓
  • B. Increases database write throughput
  • C. Manages IAM permissions
  • D. Speeds up instance boot time
Correct answer: A. A CDN caches content at geographically distributed edge locations to lower latency for end users.

Hard round 30 questions

Two engineers run `terraform apply` against the same S3-backed state at nearly the same time, but the team disabled DynamoDB state locking to 'speed things up.' Engineer A's apply reads the state, then Engineer B's apply reads the same state, both plan against it, and both write. What is the most likely concrete failure?
  • A. Terraform automatically serializes the two applies because S3 is strongly consistent, so no corruption occurs
  • B. The second apply to finish overwrites the state file with a version that omits resources the first apply created, so those resources become orphaned/untracked ✓
  • C. Both applies fail immediately with a 409 Conflict from S3 before any resources change
  • D. The state file is fine, but the AWS provider rate-limits and one apply retries transparently
Correct answer: B. Without a lock, the last writer wins and clobbers the other's state, leaving real resources that Terraform no longer tracks (drift/orphans).
A pod is stuck in `CrashLoopBackOff`. `kubectl describe pod` shows `Last State: Terminated, Reason: OOMKilled, Exit Code: 137`, and the container has `resources.limits.memory: 256Mi` with no `requests` set. Which action most directly addresses the root cause?
  • A. Add a liveness probe with a longer `initialDelaySeconds` so the kubelet stops restarting it
  • B. Raise the memory limit (and set a matching request) to fit the app's real working set, or fix the leak causing it to exceed 256Mi ✓
  • C. Set `restartPolicy: Never` so the pod stops crash-looping
  • D. Increase the node's `--max-pods` so the scheduler places it on a larger node
Correct answer: B. Exit code 137 with OOMKilled means the cgroup memory limit was hit; the fix is sizing the limit to the real footprint or fixing excessive memory use, not probe or restart tweaks.
You have VPC-A peered to VPC-B, and VPC-B peered to VPC-C. An instance in VPC-A cannot reach an instance in VPC-C, even though routes and security groups look correct for each individual peering. Why?
  • A. VPC peering requires overlapping CIDR blocks to route transitively, which A and C lack
  • B. VPC peering is non-transitive; traffic cannot hop A→B→C through B, so you need a direct A↔C peering or a Transit Gateway hub ✓
  • C. Security groups cannot reference peer VPCs, so the packets are dropped at B
  • D. Peering only supports IPv6 transit, so the IPv4 path through B is blocked
Correct answer: B. VPC peering is non-transitive by design; the hub VPC won't forward between two peers, so you need a direct peering or a Transit Gateway.
In AWS, an IAM role has an identity policy granting `s3:*` on all buckets, but a permissions boundary attached to the role only allows `s3:GetObject` and `s3:ListBucket`. A user assumes the role and calls `s3:PutObject`. What happens, and why?
  • A. Allowed, because identity policies override permissions boundaries
  • B. Denied, because the effective permissions are the intersection of the identity policy and the boundary, and PutObject isn't in the boundary ✓
  • C. Allowed, because permissions boundaries only apply to the entity that created the role
  • D. Denied, but only if an SCP also denies PutObject; otherwise allowed
Correct answer: B. A permissions boundary caps maximum permissions; the effective set is the intersection with the identity policy, so an action absent from the boundary is denied even if the identity policy allows it.
A Lambda function behind API Gateway starts returning 429s under a traffic spike, and CloudWatch shows `Throttles` climbing while `ConcurrentExecutions` sits flat at 100. Reserved concurrency for the function is set to 100. What is happening?
  • A. The function hit its reserved-concurrency ceiling of 100, so additional simultaneous invocations are throttled ✓
  • B. Cold starts are exceeding the 15-minute timeout, causing 429 responses
  • C. The account ran out of ephemeral /tmp storage, which surfaces as throttling
  • D. API Gateway's default 10,000 RPS burst was exceeded, unrelated to Lambda concurrency
Correct answer: A. Reserved concurrency of 100 caps the function at 100 simultaneous executions; beyond that, Lambda throttles, which is exactly the flat-at-100 concurrency with rising throttles.
You want engineers in Account A to access an S3 bucket in Account B using short-lived credentials, with no long-lived keys stored anywhere. Which mechanism is correct?
  • A. Create an IAM user in Account B, generate access keys, and share them with Account A engineers
  • B. Create a role in Account B whose trust policy allows Account A's principals to `sts:AssumeRole`, and attach the S3 permissions to that role ✓
  • C. Add Account A's account ID to the bucket ACL and rely on ACL-based cross-account access
  • D. Enable S3 public access and restrict by referer header from Account A
Correct answer: B. Cross-account access with temporary credentials is done via a role in the target account with a trust policy permitting the source account to AssumeRole, yielding short-lived STS credentials.
A Terraform module `network` is referenced as `source = "...//modules/network"` with `version = "~> 2.0"`. Someone tags a new `2.4.0` that renamed an output and changed a subnet's `map_public_ip_on_launch` default. On the next `apply` in prod, what's the realistic risk?
  • A. Nothing changes, because `~> 2.0` pins to exactly 2.0.0 and ignores 2.4.0
  • B. The version constraint silently pulls 2.4.0, and the changed default plus renamed output can force subnet replacement / break downstream references ✓
  • C. Terraform refuses to run because minor upgrades always require `-upgrade` and manual approval per resource
  • D. The state lock prevents the module upgrade from taking effect until unlocked
Correct answer: B. `~> 2.0` allows any 2.x, so `terraform init -upgrade` (or a fresh init) can resolve 2.4.0, whose changed defaults/renamed outputs can trigger destructive plans in prod.
A service mesh is configured for strict mTLS between services, but one legacy pod without a sidecar suddenly can't reach a meshed service that it previously could. Which explanation is most consistent?
  • A. The mesh's strict mTLS mode now requires a client certificate the sidecar-less pod can't present, so its plaintext connections are rejected ✓
  • B. mTLS only affects egress, so ingress to the meshed service is unaffected and the problem must be DNS
  • C. Strict mTLS disables all NetworkPolicies, so the traffic is dropped at the CNI layer
  • D. mTLS encrypts payloads but never rejects connections, so the failure must be a resource limit
Correct answer: A. STRICT mTLS makes the server reject plaintext; a pod with no sidecar can't complete the mutual-TLS handshake, so its connections are refused (PERMISSIVE mode would have allowed them).
A client retries a non-idempotent 'create payment' POST after a network timeout, and the server had actually processed the first request. To prevent a duplicate charge while still allowing safe retries, the most robust design is:
  • A. Switch the endpoint to HTTP PUT, since PUT is always idempotent regardless of body
  • B. Have the client send a unique idempotency key; the server records it and returns the original result on any retry with the same key ✓
  • C. Add exponential backoff with jitter, which by itself guarantees no duplicate processing
  • D. Wrap the handler in a database transaction, which makes any repeated request a no-op automatically
Correct answer: B. A client-supplied idempotency key lets the server deduplicate retries at the application layer; backoff, PUT semantics, or a plain transaction alone don't stop a second distinct request from creating a second charge.
You run a stateless web tier behind an L7 load balancer with autoscaling. During scale-in, users report dropped in-flight requests and truncated downloads. Which fix targets the cause?
  • A. Switch from L7 to L4 load balancing so connections are faster to close
  • B. Enable connection draining / deregistration delay so terminating instances finish in-flight requests before removal ✓
  • C. Increase the health-check interval so instances are marked healthy longer
  • D. Set the autoscaling cooldown to zero so scale-in happens instantly
Correct answer: B. Connection draining (deregistration delay) lets a terminating target complete in-flight requests before the LB stops routing to it, preventing mid-request cutoffs.
Two teams manage the same Terraform state file and occasionally overwrite each other's changes. What mechanism prevents this?
  • A. Enabling verbose logging
  • B. Using a remote backend with state locking ✓
  • C. Increasing the parallelism flag
  • D. Running terraform refresh more often
Correct answer: B. A remote backend (e.g., S3 with DynamoDB or Terraform Cloud) provides state locking so concurrent applies cannot corrupt shared state.
A latency-sensitive service uses spot instances for cost savings but suffers occasional interruptions. What is the best resilience pattern?
  • A. Run 100% on spot with no fallback
  • B. Mix spot with on-demand baseline capacity and handle interruption notices gracefully ✓
  • C. Increase instance size to avoid interruptions
  • D. Disable auto scaling entirely
Correct answer: B. Blending an on-demand baseline with spot capacity and draining workloads on the interruption warning balances cost savings with reliability.
In Kubernetes, a pod stays in 'Pending' state indefinitely with no events about image pulls. What is the most likely root cause?
  • A. The container command exited with code 0
  • B. No node has sufficient resources or matching scheduling constraints ✓
  • C. The liveness probe is failing
  • D. The service has no endpoints
Correct answer: B. A persistently Pending pod usually means the scheduler cannot place it because no node satisfies its resource requests, taints/tolerations, or affinity rules.
You must guarantee that objects written to object storage are never deleted or altered for a compliance retention period, even by admins. What feature achieves this?
  • A. Server-side encryption
  • B. Versioning alone
  • C. Object Lock in compliance/WORM mode ✓
  • D. Lifecycle transition to cold storage
Correct answer: C. Object Lock in compliance (WORM) mode enforces immutability for a retention period that not even the root account can override.
A multi-region active-active application needs a globally consistent view of a small critical counter. What is the fundamental trade-off you face?
  • A. Storage cost versus compute cost
  • B. The CAP theorem: strong consistency across regions sacrifices availability during partitions ✓
  • C. IAM complexity versus tagging
  • D. Encryption at rest versus in transit
Correct answer: B. Per the CAP theorem, a partition between regions forces a choice between consistency and availability, so global strong consistency reduces availability.
A VPC peering connection is established between VPC-A (10.0.0.0/16) and VPC-B (10.0.0.0/16) but traffic fails. What is the cause?
  • A. Peering requires a NAT gateway
  • B. Overlapping CIDR ranges are not routable across a peering connection ✓
  • C. Peering only works within one AZ
  • D. Security groups cannot reference peered VPCs
Correct answer: B. VPC peering does not support overlapping CIDR blocks because routing tables cannot unambiguously direct traffic between identical ranges.
Your CI/CD pipeline uses long-lived cloud access keys stored as secrets. What is the more secure modern alternative for GitHub Actions?
  • A. Rotate the keys weekly by hand
  • B. Use OIDC federation to assume a role with short-lived tokens ✓
  • C. Store keys base64-encoded in the repo
  • D. Grant the keys full administrator access
Correct answer: B. OIDC federation lets the pipeline exchange a signed identity token for short-lived cloud credentials, eliminating long-lived static keys.
An application behind an L7 load balancer intermittently returns 502 errors under load while backends appear healthy. What is a common root cause?
  • A. The load balancer keep-alive/idle timeout is shorter than the backend's, closing connections mid-response ✓
  • B. The DNS TTL is too high
  • C. The subnet ran out of IP addresses
  • D. The instances lack public IPs
Correct answer: A. A mismatch where the backend closes idle keep-alive connections before the load balancer expects can cause the LB to return 502 on reused connections.
You need blue-green deployment with instant rollback for a database-backed service where schema changes are involved. What is the key constraint to manage?
  • A. Each color needs its own separate copy of the database to stay isolated
  • B. Backward-compatible schema changes so both versions can run against the same database ✓
  • C. You must delete the blue environment before green starts
  • D. A shared database makes instant rollback impossible, so blue-green can't be used
Correct answer: B. For safe blue-green with a shared database, schema changes must be backward and forward compatible so both versions operate correctly during the switch.
A serverless function experiences high p99 latency due to cold starts under spiky traffic. Which mitigation directly addresses cold starts?
  • A. Increasing the function timeout
  • B. Configuring provisioned/pre-warmed concurrency ✓
  • C. Increasing the function's ephemeral /tmp storage
  • D. Reducing the memory allocation
Correct answer: B. Provisioned (pre-warmed) concurrency keeps a pool of initialized execution environments ready, eliminating cold-start latency for that capacity.
For a multi-region active-active design on AWS, which option natively supports multi-region, multi-master writes?
  • A. RDS Multi-AZ
  • B. DynamoDB Global Tables ✓
  • C. A single Aurora instance
  • D. ElastiCache Redis
Correct answer: B. DynamoDB Global Tables provide fully managed multi-region, multi-active replication with writes in every region.
What problem does Terraform remote state locking (e.g., S3 + DynamoDB) solve?
  • A. Prevents concurrent applies from corrupting the state file ✓
  • B. Encrypts secrets stored in variables
  • C. Speeds up the plan phase
  • D. Versions Terraform modules
Correct answer: A. State locking serializes concurrent operations so two applies cannot corrupt the shared state.
A Lambda function's cold starts are hurting p99 latency. Which is the most effective mitigation?
  • A. Increasing the function timeout
  • B. Provisioned concurrency ✓
  • C. Reducing reserved concurrency
  • D. Disabling logging
Correct answer: B. Provisioned concurrency keeps execution environments pre-initialized, eliminating cold-start latency.
In Kubernetes, if a pod's CPU usage exceeds its CPU limit, what happens?
  • A. The pod is OOMKilled
  • B. CPU is throttled above the limit while scheduling uses the request value ✓
  • C. The pod fails to schedule entirely
  • D. The CPU limit is silently ignored
Correct answer: B. Exceeding a CPU limit causes throttling (not termination); scheduling is based on the request, not the limit.
What is the key advantage of a blue-green deployment over a rolling deployment?
  • A. Instant rollback by switching traffic back to the old environment ✓
  • B. It requires no additional infrastructure
  • C. It updates pods one at a time gradually
  • D. It eliminates all deployment cost
Correct answer: A. Blue-green keeps the old environment intact, enabling near-instant rollback by redirecting traffic.
Which construct gives an EC2 instance private connectivity to S3 without traversing the public internet?
  • A. A NAT gateway
  • B. An internet gateway
  • C. A VPC endpoint ✓
  • D. An Elastic IP
Correct answer: C. A VPC endpoint enables private access to AWS services over the AWS network, bypassing the public internet.
When is eventual consistency preferable to strong consistency in a distributed system?
  • A. When availability and partition tolerance are prioritized over immediate consistency ✓
  • B. When every read must return the most recent write
  • C. For financial ledgers needing strict atomicity
  • D. When network latency is irrelevant
Correct answer: A. Under CAP trade-offs, eventual consistency favors availability and partition tolerance over immediate consistency.
A pod is stuck in Pending with the event 'Insufficient cpu'. What is the root cause?
  • A. The container image failed to pull
  • B. No node has enough allocatable CPU to meet the pod's requests ✓
  • C. The liveness probe is failing
  • D. The container keeps crashing (CrashLoopBackOff)
Correct answer: B. 'Insufficient cpu' means the scheduler cannot find a node whose free CPU satisfies the pod's requests.
What does the 'noisy neighbor' problem refer to in multi-tenant cloud environments?
  • A. One tenant's resource usage degrading performance for others on shared hardware ✓
  • B. A misconfigured DNS resolver
  • C. Cross-region replication latency
  • D. An IAM privilege-escalation attack
Correct answer: A. A noisy neighbor consumes disproportionate shared resources, degrading performance for co-located tenants.
For a steady-state, predictable workload with a long-term commitment, which purchasing option gives the deepest discount?
  • A. On-Demand Instances
  • B. Spot Instances
  • C. Standard Reserved Instances (3-year commitment) ✓
  • D. Dedicated Hosts billed hourly
Correct answer: C. For predictable workloads, a 3-year Standard Reserved Instance offers the deepest committed discount; Spot is cheaper but can be interrupted.

Prep for another role

Questions are original, written and independently verified for HireHire's role interview quizzes. They reflect the kind of knowledge Cloud Engineer interviews test, not any specific company's questions. HireHire maps live tech & IT jobs across India, updated regularly. Last updated: August 2026.