Halloween Sale
Unlock all premium questions for over 30% off
Highway Checkpoint Tolls
Medium
Question
Several toll checkpoints sit along a highway. Each time a car passes one, a log entry records its license plate and which checkpoint it was. A checkpoint's position is the number inside its name (letters are ignored), and driving between two checkpoints costs 10 per unit of distance between their positions. A trip from "K7" back to "K2", for instance, is charged |7 - 2| * 10 = 50.
...
Asked at:Google
More Google interview questions
- Grep Command With Context Linesmedium
- Design Unix Find Command With Filtershard
- Paint a Row of Houseshard
- Employee Shift Timeline Intervalsmedium
- Two Car Destinationsmedium
- Rearrange House Numbers in Neighborhoodsmedium
- Count Distinct Elements in Each Windoweasy
- Merge Two Sorted Interval Listsmedium
OfferRetriever
Master technical interviews with real questions from top companies. Build your confidence and career.
LEGAL
© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.