Data Engineering

Google Pub/Sub - Data Streaming

Topics, subscriptions, push vs pull, ordering, dead lettering, exactly-once delivery, monitoring, schema registry

20 interview questionsยท
Senior
1

What is the main architectural characteristic of Google Pub/Sub?

Answer

Google Pub/Sub is a serverless asynchronous messaging service that decouples message producers from consumers. Publishers send messages to topics without knowing the subscribers, and subscribers receive messages via subscriptions without knowing the publishers. This architecture enables independent horizontal scaling on both sides.

2

What is the fundamental difference between a topic and a subscription in Pub/Sub?

Answer

A topic is a named channel to which publishers send messages, while a subscription is a named entity representing a subscriber's interest in receiving messages from a topic. A topic can have multiple subscriptions, and each subscription receives a copy of every message published to the topic.

3

When should a pull subscription be preferred over a push subscription?

Answer

A pull subscription is preferable when the subscriber needs to control the message consumption rate (flow control), process large batches, or when the execution environment cannot expose a public HTTPS endpoint. Pull also makes it easier to handle load spikes by dynamically adjusting the number of messages retrieved.

4

How does the acknowledgement mechanism work in Pub/Sub?

5

What is the role of a dead letter topic in Pub/Sub?

+17 interview questions

Master Data Engineering for your next interview

Access all questions, flashcards, technical tests, code review exercises and interview simulators.

Start for free