Match Chromebooks to Students by Minimum Spec Requirement
Last updated: November 29, 2026
Quick Overview
Each student needs a Chromebook with at least a given RAM size, and each device can go to one student. Given student needs and device specs, return the maximum number of students who get a suitable device.
0
0
0 solved
Each student needs a Chromebook with at least a given RAM size, and each device can go to one student. Given student needs and device specs, return the maximum number of students who get a suitable device.
A warm-up in the style Google uses early in a phone screen, framed around Chromebooks for Education. The interviewer checks that you sort both sides, use two pointers, and can explain why giving each student the smallest sufficient device never hurts.
What the Interviewer Expects
- Sort both lists
- Two-pointer sweep giving the smallest adequate device to the least demanding student
- Explain why the greedy pairing is optimal
- O(n log n + m log m) time
- Clean loop termination
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- Return the actual assignment of device to student.
- Devices have a cost; satisfy the most students and break ties by lowest cost.
- Each device can serve up to two students with combined need under its RAM.
- Specs are multidimensional (RAM and storage). Does the greedy still hold?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: needs (list of ints) and specs (list of ints). A student with need g is satisfied by a device with spec s >= g. Each device is used once. Output: the maximum number of satisfied student...
High-Level Design
Sort both lists ascending. Walk devices from smallest to largest with a pointer into students. If the current device meets the current least-demanding unsatisfied student, assign it and move to the ne...