Horizontal Pod Autoscaler (Infrastructure Automation Internship)
See Snowflake hiring insights
The developers are trying to optimize their horizontal pod autoscaler for their micro-services. There are n micro-services where the number of pods for the ith micro-service is pods[i]. According to traffic, the number of pods of a service can increase or decrease. Also, at specific times when there is expected traffic, all services with fewer than x pods are assigned x pods.
There is an event log of size m, which is described as a 2D array logs where logs[i] is an array of integers of size = 3. The interpretation of these logs are shown.
[1, p, x]: the number of pods of thepth micro-service is changed tox.[2, -1, x]: all the micro-services whose number of pods is less thanxare changed tox.
Find the resulting number of pods for the micro-services.
Complete the function findPodCount in the editor below.
findPodCount has the following parameters:
int pods[n]: the number of pods for the micro-services (1 <= p <= n)int logs[m][3]: the event log of the horizontal pod autoscalerReturns
int[n]: the ith element represents the final pod count of the ith micro-service
pods = [2, 4, 1, 4] logs = [[1, 2, 30], [1, 3, 4], [2, -1, 10]] return = [10, 30, 10, 10]

pods = [3, 50, 2, 1, 10] logs = [[1, 2, 0], [2, -1, 8], [1, 3, 20]] return = [8, 8, 20, 8, 10]
1 ≤ n ≤ 2 * 10^51 ≤ pods[i] ≤ 10^91 ≤ m ≤ 2 * 10^51 ≤ p ≤ n0 ≤ x ≤ 10^9
- Effective Role PrivilegesPHONE SCREEN · Seen May 2026
- Closest Bathroom / Desk on a GridPHONE SCREEN · Seen May 2026
- Minimum Clicks Between Wiki PagesOA · Seen May 2026
- Minimum Index Distance Between Person and CakeOA · Seen May 2026
- Simple Array Rotation GameSeen Apr 2026
- Max Element Indexes After RotationsOA · Seen Mar 2026
- String Formation (Also for AI/ML Software Engineer Intern :)OA · Seen Mar 2026
- Grid Traversal (Infrastructure Automation Internship)Seen May 2025
public int[] findPodCount(int[] pods, int[][] logs) {
// write your code here
}