Interview Experience Goldman Sachs | Analyst | Coderpad round

goldman sachs logo
goldman sachs
AnalystOngoing
September 29, 202514 reads

Summary

I had a Coderpad round for an Analyst position at Goldman Sachs where I was able to solve two algorithmic questions, though I received some hints on the second one. The verdict is still pending.

Full Experience

I joined the Coderpad round for an Analyst position at Goldman Sachs. The interviewer started right on time with introductions. I was asked two specific questions. I managed to solve both of them. For the second question, the interviewer provided a couple of hints when I was heading in the wrong direction, which I thankfully picked up and used to solve the problem. I am currently awaiting the final verdict.

Interview Questions (2)

Q1
Find Unique Substrings of Length 'len'
Data Structures & Algorithms

Given a string, find all the unique substrings of a specified length 'len'. As a follow-up, I was asked to handle multiple edge cases through exception handling.

Q2
Find Root of Largest Tree in a Forest
Data Structures & Algorithms

Given a forest (one or more disconnected trees), find the root of the largest tree and return its Id. If there are multiple such roots, return the smallest Id among them. I was provided with a map immediateParent, containing key-value pairs indicating child -> parent relationship. The key is the child and the value is its corresponding immediate parent.

Constraints:

  • Child cannot have more than one immediate parent.
  • Parent can have more than one immediate child.
  • The given key-value pair forms a well-formed forest (a tree of n nodes will have n-1 edges).
Example:
Input:
{ { 1 -> 2 }, { 3 -> 4 } }
Expected output: 2

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

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