QuizzesMessage Keys & Partitioning Strategy — Concept Check
intermediate
kafka

Message Keys & Partitioning Strategy — Concept Check

Questions on Message Keys & Partitioning Strategy. Records with the same key are routed to the same partition, preserving order per entity; null keys distribute records round-robin across partitions.

8 minutes 8 questions Pass at 70%
Time Limit
8 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

8 questions on Message Keys & Partitioning Strategy — Concept Check. Work through them here, then start the quiz to answer them and see your score.

  1. 1.A Kafka producer sends order events with orderId as the key. What happens if two producers send events with the same orderId simultaneously?

    • AAll events go to different partitions.
    • BEvents from different producers are interleaved.
    • CEvents are processed in parallel across partitions.
    • DOrdering is guaranteed within a single partition.
  2. 2.A service experiences a slowdown. Kafka metrics show one partition has 10x the messages of others. What is likely the cause?

    • ACustom partitioner misconfiguration.
    • BHigh cardinality keys causing even distribution.
    • CKafka's round-robin distribution failing.
    • DA hot partition due to skewed key distribution.
  3. 3.You want to ensure all events for a customer are processed in order. What key should you use?

    • AUse a random key.
    • BOrder status as the key.
    • CNull key for round-robin distribution.
    • DCustomer ID as the key.
  4. 4.A Kafka topic uses null keys for messages. What is the effect on partitioning?

    • AMessages are evenly distributed based on key cardinality.
    • BMessages are distributed round-robin across partitions.
    • CMessages are routed to a single partition.
    • DMessages are routed based on a hash of the value.
  5. 5.A Kafka producer sends events with a low cardinality key. What problem might arise?

    • AHot partition due to skewed distribution.
    • BEven distribution across partitions.
    • CIncreased consumer parallelism.
    • DGuaranteed ordering across all partitions.
  6. 6.You implement a custom partitioner to route premium customers to dedicated partitions. What must you ensure?

    • AThe partitioner logic remains consistent.
    • BThe partitioner ignores premium customer status.
    • CThe partitioner uses round-robin for all keys.
    • DThe partitioner randomly assigns partitions.
  7. 7.A Kafka topic has 12 partitions. What happens if you use a custom partitioner for routing?

    • AAll messages are routed to partition 0.
    • BMessages are distributed based on value length.
    • CAll messages are evenly distributed by default.
    • DPremium customers can be routed to specific partitions.
  8. 8.Why might using order status as a key lead to performance issues in Kafka?

    • AIt guarantees ordering across all partitions.
    • BIt ensures even distribution across partitions.
    • CIt results in high cardinality and even distribution.
    • DIt can cause a hot partition due to low cardinality.