0
0
GCPcloud~20 mins

Message ordering in GCP - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Message Ordering Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
How does Pub/Sub ensure message ordering with ordering keys?

Google Cloud Pub/Sub supports message ordering using ordering keys. Which statement best describes how Pub/Sub guarantees message order for messages with the same ordering key?

APub/Sub delivers messages with the same ordering key in the exact order they were published, but only if the publisher acknowledges each message before the next is sent.
BPub/Sub delivers messages with the same ordering key in any order, but the subscriber must reorder them based on timestamps.
CPub/Sub guarantees message order only if messages are published to a single partition without ordering keys.
DPub/Sub does not support message ordering; ordering keys are ignored.
Attempts:
2 left
💡 Hint

Think about how Pub/Sub uses ordering keys and acknowledgments to maintain order.

Architecture
intermediate
2:00remaining
Designing a Pub/Sub system to preserve message order across multiple subscribers

You need to design a Pub/Sub system where multiple subscribers process messages but message order must be preserved per key. Which architecture best supports this requirement?

ACreate multiple subscriptions without ordering keys; subscribers process messages independently and order is preserved automatically.
BUse a single subscription with multiple subscribers and enable ordering keys; each subscriber processes messages with different ordering keys to preserve order per key.
CUse multiple topics with one subscriber each; ordering keys are not needed because topics isolate message streams.
DUse a single subscription with multiple subscribers and disable ordering keys; rely on subscriber logic to reorder messages.
Attempts:
2 left
💡 Hint

Consider how ordering keys and subscriptions affect message order and parallel processing.

security
advanced
2:00remaining
Impact of message ordering on Pub/Sub security and access control

How does enabling message ordering with ordering keys affect security and access control in Google Cloud Pub/Sub?

AOrdering keys do not affect security; access control is managed independently via IAM roles on topics and subscriptions.
BOrdering keys require additional IAM roles to be assigned to publishers to encrypt messages per key.
CEnabling ordering keys disables encryption, reducing security for ordered messages.
DSubscribers must have special permissions to reorder messages when ordering keys are enabled.
Attempts:
2 left
💡 Hint

Think about how IAM roles and encryption relate to message ordering features.

Best Practice
advanced
2:00remaining
Best practice for handling message ordering failures in Pub/Sub

If a subscriber fails to acknowledge a message with an ordering key, what is the best practice to handle message ordering to avoid blocking subsequent messages?

AIgnore the failure and continue publishing messages; Pub/Sub will reorder them automatically later.
BDisable ordering keys temporarily to allow messages to flow without blocking.
CDelete the subscription and recreate it to reset message ordering state.
DPause publishing messages with that ordering key until the failed message is acknowledged or dead-lettered to prevent blocking.
Attempts:
2 left
💡 Hint

Consider how Pub/Sub handles unacknowledged messages with ordering keys.

🧠 Conceptual
expert
2:00remaining
Why does Pub/Sub require explicit enabling of message ordering?

Google Cloud Pub/Sub does not guarantee message ordering by default. Why must message ordering be explicitly enabled with ordering keys?

ABecause message ordering is only supported for pull subscriptions, not push subscriptions.
BBecause ordering keys require messages to be encrypted differently, which is not always needed.
CBecause enabling ordering keys changes the internal message routing and delivery guarantees, which can impact throughput and latency.
DBecause ordering keys are deprecated and only used for backward compatibility.
Attempts:
2 left
💡 Hint

Think about trade-offs between ordering guarantees and system performance.