Earliest Time Every Pixel Phone Finishes Flashing and Testing

Last updated: November 29, 2026

Quick Overview

A Pixel test lab has one flashing station, so phones are flashed one at a time, each for a known duration; after flashing, each phone runs its own automated test in parallel with known length. Return the earliest time every phone has finished its test.

Google
Coding & Algorithms
Software Engineer
Google
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Hard

0

0

0 solved


A Pixel test lab has one flashing station, so phones are flashed one at a time, each for a known duration; after flashing, each phone runs its own automated test in parallel with known length. Return the earliest time every phone has finished its test.

Device-lab scheduling maps cleanly onto a two-stage greedy that Google onsite interviewers like. They check that you sort by test duration descending and prove it with an adjacent swap argument, since sorting by flash time is a tempting wrong answer.

What the Interviewer Expects
  • Separate the sequential resource (flashing) from the parallel stage (testing)
  • Order phones by test duration descending
  • Compute the finish time as max over phones of flash end plus test
  • Prove optimality with an exchange argument
  • O(n log n) time
Key Topics to Cover
Greedy
Scheduling
Exchange argument
Sorting
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • Two flashing stations instead of one.
  • Tests share a limited pool of k test rigs.
  • Each phone has a deadline; can all meet it?
  • Phones arrive over time with release dates.
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Input: lists flash and test of length n with positive ints. The flash station runs one phone at a time without idle time needed. A phone's test starts right after its flash and runs independently....

High-Level Design

Total flashing time is fixed no matter the order, so the only choice is which phones run their tests late. Put the longest tests first so they overlap with the remaining flashing, and leave short test...


Submit Your Answer
Markdown supported