Cleartrip SDE-2 Machine Coding F2F
Anonymous User
585
Oct 11, 2025

Objective

Develop a real-time order notification system for a modern e-commerce platform. The system should alert various users (customers, sellers, logistics etc) about significant events in an order's lifecycle. The system must be designed in an extensible manner so that more users can be easily accommodated in the future if needed.

Requirements

Handling Event : Implement a system that handles three primary order events types

• Order Placed: Triggered when a customer successfully creates an order.
• Order Shipped: Triggered when the seller ships the package.
• Order Delivered: Triggered when the logistics partner confirms delivery.

Messaging Stakeholders : The system must notify different types of subscribers, each interested in specific events:

• Customer: Should be notified of all three events (Order Placed, Order Shipped, Order Delivered).
• Seller: Should only be notified when an order is placed.
• Logistics (Delivery Partner): Should only be notified when an order is shipped to manage the delivery.
• Only stakeholders linked to a particular order should be notified

Notification Channels : The system must support multiple channels for sending notifications. The choice of channel should be configurable. For example, it could be possible that the customer is receiving only mails for order getting placed. Types of notification channels could be

• Email Notification
• SMS Notification
• App Push Notification

Functional Requirements

• Subscribe to Event:

○ Allow a stakeholder (e.g. a Customer) to subscribe to notifications for a specific event type with preferred channels of choice (e.g an Email).
○ Notifications should only be sent to Stakeholders linked with a particular order.

• Manage Subscriptions : Stakeholders should be able to

○ Unsubscribe from Event : Allow a stakeholder to unsubscribe from notifications for a particular event type. Once any stakeholder unsubscribes from a particular event type, they will not receive any notification for any order for that particular event type.
○ Add / Remove Channels : A stakeholder should be able to manage their preferred channels for receiving notifications i.e add or remove channels as per choice. (It can be assumed that by default all the channels would be enabled by default for any user)

Bonus Requirements:

• Event replay : Implement a feature to replay the notification events for a particular order id, event type and stakeholder.

○ When we replay a certain event, the stakeholder will receive the message on all the subscribed channels again for that particular order. For example if I can replay an Order delivery message for the Order - 001 for the Customer who had subscription on Email and Phone, The tagged customer with that particular order will receive the message on Email and Phone.
○ The preferred channels for stakeholders during replay should be the latest preference on each subscription. For example, if customer A had Email and App push notification as preferred channels for Order 0 while getting notifications initially and later changed it to SMS only, the replay would only include SMS notifications.

• Concurrency : Handle cases related to user concurrency where multiple stakeholders could be trying to add / remove subscriptions

• Asynchronous : The notifications should be sent in a non-blocking manner for the order system.

Comments (3)