InterviewDB
Question
Trailer: Implement a Fixed-Size Trailing Buffer That Captures the Last N Events
phone
Question Details
Round 1 - Coding / OOD Problem Design a Trailer data structure — a fixed-capacity circular buffer that keeps only the last N items added. Support adding items, iterating in insertion order, and querying the current count. Example Follow-ups What is the time complexity of add and iteration in your implementation? How would you make this thread-safe for concurrent producers and consumers? How would you extend this to support a window_sum() or window_average() that operates on numeric items in O(1)…
Full Details
🔒
Unlock all Samsara questions
Full insider details, leaked discussions, and candidate experiences.
Get full access — $100 a year, unlimited accessAbout This Question
This is a reported interview question from a samsara interview during the phone round.
More Samsara Interview Questions
InterviewDB
Samsara SWE Phone - Axis Permutation
InterviewDB
Command Parser: Parse and Dispatch Shell-Like Commands from User Input
InterviewDB
Samsara SWE Phone - Concurrent Meetings
InterviewDB
Engine States: Model a Vehicle Engine Using a Finite State Machine
InterviewDB
Engine Utilization: Compute and Report Resource Utilization Across Processing Engines