Programming MCQs Feed

📊 Rabbit MQ
Q. What is a consumer in RabbitMQ?
  • (A) Message sender
  • (B) Message receiver
  • (C) Message router
  • (D) Message encryptor
💬 Discuss
✅ Correct Answer: (B) Message receiver

Explanation: Consumers receive messages from queues.

📊 Rabbit MQ
Q. Which exchange type supports pattern matching?
  • (A) Direct
  • (B) Fanout
  • (C) Topic
  • (D) Headers
💬 Discuss
✅ Correct Answer: (C) Topic

Explanation: Topic exchange supports wildcard pattern matching in routing keys.

📊 Rabbit MQ
Q. What symbol is used as a wildcard in topic exchange?
  • (A) * and #
  • (B) ? and %
  • (C) & and @
  • (D) $ and !
💬 Discuss
✅ Correct Answer: (A) * and #

Explanation: * matches one word, # matches zero or more words.

📊 Rabbit MQ
Q. What is prefetch count?
  • (A) Number of queues
  • (B) Number of messages a consumer can receive before ack
  • (C) Number of producers
  • (D) Number of exchanges
💬 Discuss
✅ Correct Answer: (B) Number of messages a consumer can receive before ack

Explanation: Prefetch count limits unacknowledged messages per consumer.

📊 Rabbit MQ
Q. What is a dead letter exchange (DLX)?
  • (A) Exchange for deleted messages
  • (B) Exchange for failed messages
  • (C) Exchange for encrypted messages
  • (D) Exchange for broadcast messages
💬 Discuss
✅ Correct Answer: (B) Exchange for failed messages

Explanation: DLX handles messages that cannot be processed or are rejected.

📊 Rabbit MQ
Q. What is message TTL?
  • (A) Time to live
  • (B) Total transfer limit
  • (C) Temporary transfer level
  • (D) Timeout transmission logic
💬 Discuss
✅ Correct Answer: (A) Time to live

Explanation: TTL defines how long a message can live before being discarded.

📊 Rabbit MQ
Q. Which command ensures fair dispatch in RabbitMQ?
  • (A) basic.consume
  • (B) basic.publish
  • (C) basic.qos
  • (D) basic.ack
💬 Discuss
✅ Correct Answer: (C) basic.qos

Explanation: basic.qos with prefetch ensures fair message distribution.

📊 Rabbit MQ
Q. What is a binding?
  • (A) Connection between producer and consumer
  • (B) Link between exchange and queue
  • (C) Message format
  • (D) Queue identifier
💬 Discuss
✅ Correct Answer: (B) Link between exchange and queue

Explanation: Binding defines relationship between exchange and queue.

📊 Trishul API
Q. What is the primary responsibility of the Request class in Trishul API?
  • (A) Handling database queries
  • (B) Managing HTTP requests
  • (C) Rendering views
  • (D) Managing background jobs
💬 Discuss
✅ Correct Answer: (B) Managing HTTP requests

Explanation: The Request class handles incoming HTTP requests including headers, body, cookies, etc.

📊 Trishul API
Q. Which method is used to retrieve query parameters?
Code:
$params = $request->____()->all();
  • (A) body
  • (B) query_params
  • (C) header
  • (D) session
💬 Discuss
✅ Correct Answer: (B) query_params

Explanation: query_params() returns the QueryParams object to access query parameters.