Assemble an On-Call Team Maximizing Total Speed Times Minimum Efficiency

Last updated: November 29, 2026

Quick Overview

Each engineer has a speed and an efficiency. Choose at most k engineers to maximize (sum of their speeds) times (minimum efficiency among them). Return the maximum value.

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

0

0

0 solved


Each engineer has a speed and an efficiency. Choose at most k engineers to maximize (sum of their speeds) times (minimum efficiency among them). Return the maximum value.

A Google onsite optimization question in an SRE on-call staffing frame. The interviewer checks the trick of fixing the minimum efficiency by sweeping in descending efficiency, and a size-k min-heap that keeps the fastest speeds.

What the Interviewer Expects
  • Sorts by efficiency descending
  • Treats each engineer in turn as the minimum efficiency
  • Keeps the k largest speeds in a min-heap
  • Maintains a running speed sum
  • States O(n log n)
Key Topics to Cover
Min-Heap
Greedy
Sorting
Top-K
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
  • What if the team must have exactly k members?
  • Return the team itself
  • What if the objective is sum of speeds times sum of efficiencies?
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: n engineers with speed[i], eff[i], and integer k.
  • Pick 1 to k engineers.
  • Output: max of sum(speeds) * min(effs) over valid teams....
High-Level Design

The minimum efficiency is set by one team member. If we process engineers in descending efficiency, then when we reach engineer i, every engineer seen so far has efficiency >= eff[i], so adding i make...


Submit Your Answer
Markdown supported