Courseiva
Incident and Event ResponsehardMultiple ChoiceObjective-mapped

DOP-C02 Incident and Event Response Practice Question

A company runs a stateful web application on EC2 instances behind an Application Load Balancer. The application uses sticky sessions (session affinity) based on cookies. During a deployment, the Auto Scaling group launches new instances, but users experience session loss. What is the most likely cause?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The target group's deregistration delay is too short.

Sticky sessions rely on the instance ID to route requests. During a deployment, Auto Scaling launches new instances and terminates old ones. The target group's deregistration delay controls how long the ALB waits before forcibly closing connections to deregistering instances. If this delay is too short, in-flight requests and sessions are abruptly terminated, causing users to lose their sessions. Options A, B, and D are incorrect: lifecycle hooks (A) are for custom actions, not directly related to session loss; stickiness duration (B) affects how long a session sticks to an instance but does not cause loss during deployment; and health check interval (D) affects availability but not session persistence.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The Auto Scaling group's lifecycle hooks are not configured.

    Why it's wrong here

    Lifecycle hooks control what happens during instance termination at the EC2 Auto Scaling level, letting you run cleanup scripts before shutdown, but they do not influence how the Application Load Balancer routes traffic or how existing connections are handled. Even with hooks configured, the instance is eventually terminated and the ALB's deregistration process still closes connections after the configured delay, so missing hooks cannot be the cause of sessions being dropped specifically when a deployment replaces instances.

  • The stickiness duration is set too low.

    Why it's wrong here

    A low stickiness duration causes the load balancer to stop pinning a client to one backend after a short period, so sessions could naturally migrate earlier, but this is a per-request cookie timeout independent of instance replacement. During a rolling deployment the ALB explicitly deregisters instances and begins draining them; an expired stickiness cookie would not make the ALB send traffic to a terminating instance in the first place, so this does not explain active sessions being cut off at deployment time.

  • The target group's deregistration delay is too short.

    Why this is correct

    The deregistration delay is the connection-draining window during which the target group keeps already-established connections open after an instance is deregistered, but stops sending new ones. If this value is set too short, the ALB forcibly closes in-flight sessions as soon as the delay expires, dropping users whose requests or websocket connections take longer than that time, which is exactly the failure seen during rolling deployments when instances are rotated out.

  • The target group's health check interval is too long.

    Why it's wrong here

    The health check interval controls how frequently the ALB sends health checks and how quickly it marks an instance unhealthy. A longer interval delays the removal of a failing or terminating instance from rotation, so it would cause slower failover and perhaps a longer period of errors, not the abrupt termination of active sessions, because the ALB continues to send traffic to the instance until then and existing connections are not affected by health check timing.

About these practice questions

One of 251 original DOP-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on DOP-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A company runs a stateful web application on EC2 instances behind an Application Load Balancer. The application uses sticky sessions (session affinity) based on cookies. During a deployment, the DevOps engineer notices that some users are being logged out and losing session data. The deployment uses a rolling update strategy. What is the MOST likely cause?

hard
  • A.The Auto Scaling group is terminating instances before the new ones are fully ready.
  • B.The health check interval is too long, causing the ALB to route traffic to unhealthy instances.
  • C.The ALB sticky session cookie is not being generated correctly.
  • D.The session data is stored locally on the EC2 instance, not in a shared external store.

Why D: During a rolling update, old instances are terminated and new instances are launched. Sticky sessions are tied to a specific instance; when that instance is terminated, the user's session is lost if it is not shared externally. Option A is wrong because the ALB configuration remains unchanged. Option B is wrong because health checks are not the direct cause. Option C is wrong because Auto Scaling is not involved unless explicitly configured.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.