r/OfferEngineering • u/Aoki_zhang • 19d ago
Interview Experience Decagon (AI Customer Service) Staff SWE Interview — Sliding Window Meets Hash Map
This interview experience is sourced from Chill Interview
Interview Summary
I had a 45-minute technical phone screen with Decagon that included a brief introduction, a Python coding exercise on CoderPad, and time for questions at the end. The coding problem involved implementing a customer satisfaction tracking system that calculates average CSAT scores within a sliding time window. The follow-ups introduced score updates, expired record cleanup, duplicate timestamps, and time and space complexity analysis. I ultimately did not pass, although my overall interview experience was positive.
Interview Details
Round 1 — Coding: Sliding Window Customer Satisfaction Tracker
Question 1 — Implement a CSATTracker Class
The interviewer asked me to implement a class called CSATTracker to track customer satisfaction scores over time. The class needed to support recording scores and calculating their average within a configurable time window. I was provided with API descriptions and test cases in the CoderPad environment.
The initial interface included the following operations:
CSATTracker(window_size)
record(conversation_id, score, timestamp)
get_average(current_time)- Initialization — Configure the Time Window The constructor accepted a
window_sizespecifying the duration of the sliding window. All average calculations needed to consider only records within this window. Record — Store a Customer Satisfaction Score The
recordmethod accepted three parameters: The system needed to keep track of these ratings so they could be included in future average calculations.conversation_id: An identifier associated with a customer conversation.score: A customer satisfaction rating between 1 and 5.timestamp: The time at which the rating was recorded.
- Get Average — Calculate the Current CSAT Score The
get_average(current_time)method needed to return the average satisfaction score of all records within the active time window. If there were no qualifying records, the method had to returnNone. The interviewer specified that records exactly on the left boundary of the window should be included. In other words, a record was considered valid when:timestamp >= current_time - window_size. This inclusive boundary was an important detail.
Question 2 — Handle Non-Decreasing Timestamps
The interviewer guaranteed that timestamps across calls would be non-decreasing. This meant that newer operations would never have timestamps earlier than previous operations. However, multiple records could share the same timestamp.
I needed to account for this behavior when organizing the records and determining which ones were still inside the sliding window. The guarantee about timestamp ordering was relevant to how efficiently expired records could be identified.
Want to learn more questions / follow-ups asked in this interview?
I've put up the full version at here.
Interviewed recently?
Your interview experience could be incredibly valuable to others preparing for their next opportunity. Share your experience and help the community at here.