r/leetcode • • Dec 02 '25

Question PayPal Interview Experience | System Design | Sr Software Engineer

Question
Design a notification service.

While solving the problem, for idempotency handling, I have used even-driven architecture.
The solution that I gave is publishing the messages in Kafka, and processing the messages through Flink. So that unique message gets processed exactly once, with respect to the idempotent id.

Interviewer's (Staff Software Engineer) comments

  1. There is no way to handle idempotency using event driven architecture.
  2. He was expecting solution with Redis. (Synchronous write-through caching)

I did some research, my solution is working and much-more scalable in case of burst traffic and bust notification.

I got rejected.

Was I correct?

85 Upvotes

25 comments sorted by

View all comments

Show parent comment

6

u/reddit_user157 Dec 02 '25 edited Dec 02 '25

As someone who has extensively worked with Flink, you are confusing Flink’s exactly-once state semantics being used for Idempotency. A simple scenario - How will you handle scenarios when something breaks in producer and sends 2 events with the same message-id?

Did you get into any details on how Flink will work during the interview? Because you just sound like throwing fancy words around without experience.

Read up more here https://flink.apache.org/2018/02/28/an-overview-of-end-to-end-exactly-once-processing-in-apache-flink-with-apache-kafka-too/

2

u/Electrical-Ask847 Dec 02 '25

yep exactly. even if flink job processes exactly once. there are no such gaurentees in notifications service, network etc.

Client device needs to have a local cache that rejects duplicate notfication ids.