Bird
Raised Fist0
Kafkadevops~20 mins

In-sync replicas (ISR) in Kafka - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Kafka ISR Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate
2:00remaining
What is the output of the ISR status check command?
Given a Kafka topic with 3 partitions and replication factor 3, you run the command to describe the topic and check the ISR for partition 0. What output will you see if all replicas are in sync?
Kafka
kafka-topics.sh --describe --topic my-topic --bootstrap-server localhost:9092
APartition: 0 Leader: 1 Replicas: 1,2,3 Isr: 1
BPartition: 0 Leader: 1 Replicas: 1,2,3 Isr: 1,2,3
CPartition: 0 Leader: 1 Replicas: 1,2,3 Isr: 2,3
DPartition: 0 Leader: 1 Replicas: 1,2,3 Isr: 1,3
Attempts:
2 left
💡 Hint
ISR includes all replicas that are fully caught up with the leader.
🧠 Conceptual
intermediate
1:30remaining
What happens when a replica falls out of the ISR?
In Kafka, if a follower replica falls behind the leader and cannot keep up, what is the expected behavior regarding the ISR?
AThe ISR size automatically increases to include more replicas.
BThe replica remains in the ISR but stops receiving data.
CThe leader shuts down to prevent data loss.
DThe replica is removed from the ISR until it catches up again.
Attempts:
2 left
💡 Hint
ISR only contains replicas fully caught up with the leader.
🔧 Debug
advanced
2:00remaining
Why does the ISR not include a replica after network partition?
You notice that after a network partition, one replica is no longer listed in the ISR for a partition. Which of the following is the most likely cause?
AThe replica failed to fetch data and fell behind the leader's log.
BThe leader replica crashed and was removed from ISR.
CThe replica was promoted to leader and removed from ISR.
DThe ISR list is fixed and does not update dynamically.
Attempts:
2 left
💡 Hint
ISR updates dynamically based on replica sync status.
📝 Syntax
advanced
1:30remaining
Which command correctly lists the ISR for a Kafka topic?
Select the correct Kafka CLI command to describe a topic and show the ISR for all partitions.
Akafka-topics.sh --describe --topic my-topic --bootstrap-server localhost:9092
Bkafka-consumer-groups.sh --describe --group my-group --topic my-topic
Ckafka-configs.sh --describe --entity-type topics --entity-name my-topic
Dkafka-producer-perf-test.sh --topic my-topic --describe
Attempts:
2 left
💡 Hint
The topic description command shows ISR info.
🚀 Application
expert
2:30remaining
How many replicas are in the ISR after this scenario?
A Kafka topic has replication factor 4. Initially, all replicas are in the ISR: [1,2,3,4]. Replica 3 falls behind due to slow disk and replica 2 loses network connectivity temporarily. After some time, replica 3 catches up but replica 2 is still disconnected. What is the current ISR?
A[1,4]
B[1,2,3,4]
C[1,3,4]
D[3,4]
Attempts:
2 left
💡 Hint
ISR only includes replicas currently caught up and connected.

Practice

(1/5)
1. What does In-sync replicas (ISR) mean in Kafka?
easy
A. Replicas that are offline
B. Replicas that never receive data
C. Replicas that have the latest data from the leader
D. Replicas that only store old data

Solution

  1. Step 1: Understand the role of ISR

    ISR are replicas that keep up-to-date with the leader's data.
  2. Step 2: Compare options

    Only Replicas that have the latest data from the leader correctly describes ISR as replicas with the latest data.
  3. Final Answer:

    Replicas that have the latest data from the leader -> Option C
  4. Quick Check:

    ISR = Latest data replicas [OK]
Hint: ISR means replicas fully caught up with leader data [OK]
Common Mistakes:
  • Thinking ISR includes offline replicas
  • Confusing ISR with replicas that lag behind
  • Assuming ISR means replicas with old data
2. Which Kafka configuration controls the minimum number of ISR replicas required to acknowledge a write?
easy
A. replica.fetch.max.bytes
B. min.insync.replicas
C. max.insync.replicas
D. offsets.retention.minutes

Solution

  1. Step 1: Identify configuration related to ISR acknowledgments

    The setting min.insync.replicas defines the minimum ISR count for write success.
  2. Step 2: Eliminate unrelated options

    Other options control fetch size or retention, not ISR acknowledgments.
  3. Final Answer:

    min.insync.replicas -> Option B
  4. Quick Check:

    Minimum ISR replicas = min.insync.replicas [OK]
Hint: min.insync.replicas sets minimum ISR for writes [OK]
Common Mistakes:
  • Confusing min.insync.replicas with max.insync.replicas
  • Choosing unrelated configs like offsets.retention.minutes
  • Assuming replica.fetch.max.bytes controls ISR count
3. Given a Kafka topic with 3 replicas and ISR = [replica1, replica2], what happens if replica2 falls behind and leaves ISR?
medium
A. Only replica1 remains in ISR; leader continues with one ISR
B. Leader stops producing until replica2 catches up
C. All replicas are removed from ISR
D. Replica2 becomes the new leader immediately

Solution

  1. Step 1: Understand ISR behavior when a replica falls behind

    If a replica lags, it is removed from ISR, leaving others in ISR.
  2. Step 2: Analyze leader and ISR state

    The leader continues with remaining ISR replicas; it does not stop or change leader immediately.
  3. Final Answer:

    Only replica1 remains in ISR; leader continues with one ISR -> Option A
  4. Quick Check:

    Lagging replica leaves ISR, leader continues [OK]
Hint: Lagging replica leaves ISR; leader stays with remaining ISR [OK]
Common Mistakes:
  • Thinking leader stops producing when ISR shrinks
  • Assuming all replicas leave ISR together
  • Believing lagging replica becomes leader immediately
4. You see this error in Kafka logs: "Not enough replicas are in ISR to satisfy min.insync.replicas". What is the likely cause?
medium
A. The consumer group is not committed
B. The leader replica is offline
C. The topic has zero partitions
D. Too few replicas are currently in ISR compared to min.insync.replicas

Solution

  1. Step 1: Interpret the error message

    The error means the number of replicas in ISR is less than the configured minimum.
  2. Step 2: Match cause with options

    Too few replicas are currently in ISR compared to min.insync.replicas directly matches the error cause; other options are unrelated to ISR count.
  3. Final Answer:

    Too few replicas are currently in ISR compared to min.insync.replicas -> Option D
  4. Quick Check:

    ISR count below min.insync.replicas causes error [OK]
Hint: Error means ISR count < min.insync.replicas [OK]
Common Mistakes:
  • Blaming leader offline instead of ISR count
  • Confusing consumer group commit with ISR errors
  • Thinking zero partitions cause this error
5. You want to ensure high availability in Kafka by allowing leader failover only if at least 2 replicas are in ISR. Which configuration and setup achieve this?
hard
A. Set min.insync.replicas=2 and have at least 3 replicas per partition
B. Set min.insync.replicas=1 and have 2 replicas per partition
C. Set min.insync.replicas=3 with 2 replicas per partition
D. Set min.insync.replicas=0 and 1 replica per partition

Solution

  1. Step 1: Understand min.insync.replicas meaning

    This setting defines the minimum ISR count required for leader failover and write success.
  2. Step 2: Match configuration to requirement

    To require at least 2 ISR replicas, set min.insync.replicas=2 and have at least 3 replicas to allow failover.
  3. Final Answer:

    Set min.insync.replicas=2 and have at least 3 replicas per partition -> Option A
  4. Quick Check:

    High availability needs min.insync.replicas=2 with 3 replicas [OK]
Hint: min.insync.replicas ≤ replica count for failover [OK]
Common Mistakes:
  • Setting min.insync.replicas higher than replica count
  • Using too few replicas for desired availability
  • Setting min.insync.replicas to zero disables safety
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard