Pack Triplets on a Conveyor Belt
Asked at Google · Coding Questions · Difficulty: Medium
Items arrive one at a time on a conveyor belt, and each item has an integer value. As soon as a newly arrived item can be packed together with two items already waiting on the belt so that the three values add up to a fixed target `size`, those three items are packed and leave the belt. Implement a class that processes the arrivals online and reports each packed triplet.
Loading the problem…
More Google interview questions
- LLM conceptual questions
- Implement a Nested Tic-Tac-Toe Game Engine
- ML Fundamentals Deep Dive (AI/ML & MLE Roles)
- ML System Design: Recsys, Chatbot, Image Classifier
- Implement Scaled Dot-Product Attention
- Meeting Rooms: Minimum Rooms to Hold All Meetings