Google OA/Phonescreen [L4] - 24 Dec 2025

Result
Ongoing
Posted
24 Dec 2025
750 reads

Summary

I recently completed my Online Assessment and Phonescreen for a Software Engineer L4 role at Google, facing three distinct algorithmic challenges.

How it went

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.

Questions asked (3)

  1. 01

    Count Ways to Select K Coins with Sum Divisible by M

    Data Structures & Algorithms · Hard

    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

  2. 02

    Min Town Sum Difference After Edge Deletion in Tree

    Data Structures & Algorithms · Medium

    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:
    2
    10 20
    1 2
    Output: 10

    Constraints:
    1 <= N <= 10^5
    1 <= towns[i] <= 10^4

  3. 03

    Shuffle Playlist to Minimize Adjacent Artists

    Data Structures & Algorithms · Medium

    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

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Google recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!