InterviewLegend

Class Design: Lockers, Trailers & Deposit Boxes

Alex Chen45 min readGuide updated

Samsara has been asking candidates to model a slice of its business in classes since at least 2017. A truck and the pallets on it. A box and what goes in it. You write one or two small classes, the interviewer adds a method, you run it, and then they ask what it costs. The newest case is a Premium question from a March 2026 virtual onsite, which the candidate built and then extended with more complicated getters and setters.

For years the older versions were the phone screen. Pallet and trailer came up again and again from March to October 2019, and the step that sinks people is the last one: the trailer's weight at some past time. This lesson works the 2026 locker system first. After it come the older problems, from 2019 to 2025: sending an event to the closest truck, pallet and trailer, a Premium question and a sensor alert monitor.

The Samsara angle
Keep it plain and say what each step costs. In a 2019 pallet screen the interviewer asked for the time complexity after every step, then talked through alternatives. A dict and a list you can explain take the next requirement with a small edit. A clever structure you must defend line by line eats the time the last step needs.

SamsaraPremium lesson · Coding round

The 5 Samsara problems are below.

  1. A Premium questionCoding · Medium
  2. A Premium questionCoding · Medium
  3. A Premium questionCoding · Medium

+ 2 more in this lesson

Each with hints, the follow-up and a tested solution.

Get the Samsara questions

$49 a year · all 122 companies · instant access

21,000+ candidate reports

Samsara interview guide

Know what Samsara asks before you walk in.

25 coding · 4 system design · 11 behavioral questions

Get Premium$49 a year · Instant access
Or start freeNo card.

Get their questions first.

Had your Samsara interview?How we research

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.