Swiggy | Phone | Design Analytics SDK | SDE2
Anonymous User
1433
Mar 17, 2022
Mar 17, 2022

I recently appeared for swiggy frontend interview for SDE2 role. I was asked this question but i have no idea how to implement it. Can someone help me?

Write an analytics SDK that exposes logEvent, it takes in analytics events and queues them
- pass a function sendAnalyticsEvent as a parameter(implement a stub function that resolves in 1 second and fails every n%10 times)
- send the next event to sendAnalyticsEvent when only after it resolves
- when the failure occurs attempt a retry
Comments (3)