goldman sachs logo
Goldman Sachs· Software Engineer

Goldman Sachs | CoderPad 1st round | US - Software Engineer

Location
US
Posted
20 Feb 2026
611 reads

Summary

I had a 1 hour 15 minute CoderPad interview for a Software Engineer role at Goldman Sachs, where I was asked two Data Structures & Algorithms questions.

How it went

It was 1:15hrs long interview, and I was asked 2 DSA questions:

1. Given a list of student and scores, return the max average of all students.

It's basically the High Five problem (easy) on leetcode, but even easier in a way, that you don't need a min heap as a key, but just a list of [total of scores, number of scores].


2. Return the ID of the tallest tree given a forest with many unconnected trees (dictionary with child -> parent). If two trees have the same height, return the ID with lesser value.

Input: {2:3, 3:5, 4:5, 8:9} -> Return 5, since it is the root of the tallest tree.

Build an adjaceny list, and also store all_nodes and children in 2 separate sets. We can get the roots by doing set subtraction (all_nodes - children). Then implement DFS, and call DFS on each root to get the tree height.

Questions asked (2)

  1. 01

    Max Average of All Students

    Data Structures & Algorithms · Easy

    Given a list of student and scores, return the max average of all students. It's basically the High Five problem (easy) on leetcode, but even easier in a way, that you don't need a min heap as a key, but just a list of [total of scores, number of scores].

  2. 02

    Tallest Tree in a Forest

    Data Structures & Algorithms

    Return the ID of the tallest tree given a forest with many unconnected trees (dictionary with child -> parent). If two trees have the same height, return the ID with lesser value.

    Input: {2:3, 3:5, 4:5, 8:9} -> Return 5, since it is the root of the tallest tree.

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Goldman Sachs 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!