Google OA/Phonescreen [L4] - 24 Dec 2025
Summary
I recently completed my Online Assessment and Phonescreen for a Software Engineer L4 role at Google, facing three distinct algorithmic challenges.
Full Experience
I recently participated in the Google Online Assessment and a subsequent Phonescreen round for a Software Engineer L4 position. The OA presented two challenging algorithmic problems: one involving dynamic programming with modular arithmetic and the other a tree-based problem requiring subtree sum calculations. The Phonescreen round then focused on an interesting design problem related to playlist shuffling to minimize adjacent artists. I was able to approach all problems and provide solutions.
Interview Questions (3)
There are N coins valued (0 to N - 1). Calculate no. of ways to select K coins such that their sum is divisible by M. Return answer modulo 1e9 + 7.int solve(int N, int M, int K)
Input:4 2 2
Output: 2
Constraints:1 <= N, M, K <= 10^3
Given tree graph with N nodes/regions (1 to N) and (N - 1) bidirectional edges/roads. Each node/region (i + 1) has no. of towns denoted by towns[i]. Calculate min difference in total sum of towns between resulting components when you delete one edge.int minTownsDiff(int N, vector& towns, vector<vector>& roads)
Input:210 201 2
Output: 10
Constraints:1 <= N <= 10^51 <= towns[i] <= 10^4
Given a playlist of songs. Implement a shuffle function, such that there is no/minimal adjacent artists.using Song = pair<string, string>; // (artist, song)void shuffle(vector<Song>& playlist)
Input:[ { "artist": "A", "song": "apple" }, { "artist": "A", "song": "banana" }, { "artist": "B", "song": "orange" }, { "artist": "B", "song": "guava" }, { "artist": "C", "song": "mango" } ]
Output: ABABC