Bird
Raised Fist0
Kafkadevops~20 mins

Standalone vs distributed mode in Kafka - Practice Questions

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Kafka Mode Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate
2:00remaining
Output of Kafka standalone mode configuration
Consider a Kafka setup running in standalone mode with a single broker. What will be the output of the following command that lists topics?
Kafka
kafka-topics.sh --list --bootstrap-server localhost:9092
AError: Could not connect to server
BNo topics found
CList of all topics created on the single broker
DList of topics from all brokers in the cluster
Attempts:
2 left
💡 Hint
In standalone mode, there is only one broker managing all topics.
🧠 Conceptual
intermediate
2:00remaining
Difference in fault tolerance between standalone and distributed mode
Which statement correctly describes the fault tolerance difference between Kafka's standalone and distributed modes?
ADistributed mode allows replication of partitions across brokers for fault tolerance
BStandalone mode provides automatic failover using multiple brokers
CStandalone mode replicates data across multiple machines
DDistributed mode runs only one broker, so no fault tolerance
Attempts:
2 left
💡 Hint
Think about how Kafka handles data safety in a cluster.
🔧 Debug
advanced
2:00remaining
Identify the error in distributed mode broker configuration
Given this broker configuration snippet for distributed mode, what error will occur? broker.id=0 listeners=PLAINTEXT://:9092 log.dirs=/tmp/kafka-logs zookeeper.connect=localhost:2181 Options:
AZookeeper connection error due to wrong port
BKafka broker starts normally and joins the cluster
CSyntax error in configuration file
DKafka broker fails to start due to missing advertised.listeners
Attempts:
2 left
💡 Hint
In distributed mode, brokers must advertise their address to clients and other brokers.
📝 Syntax
advanced
2:00remaining
Syntax error in standalone mode startup command
Which option shows the correct syntax to start Kafka in standalone mode using the command line?
Akafka-server-start.sh -daemon config/server.properties
Bkafka-server-start.sh --config config/server.properties
Ckafka-server-start.sh config/server.properties
Dkafka-server-start.sh config/server.properties --standalone
Attempts:
2 left
💡 Hint
The -daemon flag runs Kafka in the background.
🚀 Application
expert
3:00remaining
Choosing mode for a fault-tolerant Kafka deployment
You need to deploy Kafka for a critical application requiring high availability and fault tolerance. Which mode should you choose and why?
AStandalone mode, because it is simpler and faster to set up
BDistributed mode, because it supports partition replication and failover
CStandalone mode, because it uses less memory and CPU
DDistributed mode, because it runs on a single machine with multiple brokers
Attempts:
2 left
💡 Hint
Consider how Kafka handles failures and data safety.

Practice

(1/5)
1. What is the main purpose of running Kafka Connect in standalone mode?
easy
A. To run multiple workers for high scalability
B. To run Kafka Connect in a single process for simple or testing use
C. To enable fault tolerance across multiple machines
D. To connect Kafka with distributed databases automatically

Solution

  1. Step 1: Understand standalone mode context

    Standalone mode runs Kafka Connect in one process, suitable for simple or testing scenarios.
  2. Step 2: Compare with distributed mode

    Distributed mode runs multiple workers for scalability and fault tolerance, unlike standalone mode.
  3. Final Answer:

    To run Kafka Connect in a single process for simple or testing use -> Option B
  4. Quick Check:

    Standalone mode = single process for testing [OK]
Hint: Standalone = single process, simple use [OK]
Common Mistakes:
  • Confusing standalone with distributed mode
  • Thinking standalone supports fault tolerance
  • Assuming standalone is for large scale pipelines
2. Which of the following is the correct command to start Kafka Connect in distributed mode?
easy
A. kafka-connect.sh start-standalone
B. connect-standalone.sh config/connect-standalone.properties
C. kafka-connect.sh start-distributed
D. connect-distributed.sh config/connect-distributed.properties

Solution

  1. Step 1: Identify the script for distributed mode

    The script connect-distributed.sh is used to start Kafka Connect in distributed mode.
  2. Step 2: Confirm the configuration file

    The configuration file config/connect-distributed.properties is the standard config for distributed mode.
  3. Final Answer:

    connect-distributed.sh config/connect-distributed.properties -> Option D
  4. Quick Check:

    Distributed mode uses connect-distributed.sh [OK]
Hint: Distributed mode uses connect-distributed.sh script [OK]
Common Mistakes:
  • Using connect-standalone.sh for distributed mode
  • Mixing config files between modes
  • Assuming kafka-connect.sh is a valid command
3. Given the following scenario: You start Kafka Connect with connect-standalone.sh and add two connectors. What will happen if the process crashes?
medium
A. Both connectors will automatically restart on another worker
B. Connectors will continue running without interruption
C. The connectors will stop and require manual restart
D. Kafka Connect will switch to distributed mode automatically

Solution

  1. Step 1: Understand standalone mode fault tolerance

    Standalone mode runs in a single process without fault tolerance or automatic recovery.
  2. Step 2: Consequence of process crash

    If the process crashes, connectors stop and need manual restart because no other worker is available.
  3. Final Answer:

    The connectors will stop and require manual restart -> Option C
  4. Quick Check:

    Standalone mode lacks automatic recovery [OK]
Hint: Standalone mode needs manual restart after crash [OK]
Common Mistakes:
  • Assuming automatic failover in standalone mode
  • Thinking distributed mode starts automatically
  • Believing connectors run independently of the process
4. You configured Kafka Connect in distributed mode but notice that only one worker is running and no failover happens. What is the likely cause?
medium
A. You started Kafka Connect with connect-standalone.sh instead of connect-distributed.sh
B. You did not configure the Kafka cluster correctly
C. You forgot to add connectors to the worker
D. Distributed mode does not support multiple workers

Solution

  1. Step 1: Check the startup script used

    If connect-standalone.sh is used, only one worker runs without failover, even if config is for distributed mode.
  2. Step 2: Understand distributed mode requirements

    Distributed mode requires starting with connect-distributed.sh to run multiple workers and enable failover.
  3. Final Answer:

    You started Kafka Connect with connect-standalone.sh instead of connect-distributed.sh -> Option A
  4. Quick Check:

    Wrong startup script causes single worker [OK]
Hint: Use connect-distributed.sh to run multiple workers [OK]
Common Mistakes:
  • Assuming config alone enables distributed mode
  • Believing distributed mode runs with standalone script
  • Ignoring startup script importance
5. You have a data pipeline that must handle high volume and remain available even if one worker fails. Which Kafka Connect mode should you choose and why?
hard
A. Distributed mode, because it supports multiple workers and fault tolerance
B. Standalone mode, because it is simpler to configure
C. Standalone mode, because it automatically restarts connectors on failure
D. Distributed mode, because it runs connectors in a single process

Solution

  1. Step 1: Analyze pipeline requirements

    High volume and availability require scalability and fault tolerance.
  2. Step 2: Match requirements to Kafka Connect modes

    Distributed mode runs multiple workers and supports fault tolerance, meeting these needs.
  3. Final Answer:

    Distributed mode, because it supports multiple workers and fault tolerance -> Option A
  4. Quick Check:

    High volume + fault tolerance = distributed mode [OK]
Hint: Choose distributed mode for scalability and fault tolerance [OK]
Common Mistakes:
  • Choosing standalone for high availability
  • Thinking standalone auto-restarts connectors
  • Misunderstanding distributed mode runs single process
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