Goldman Sachs | SDE - 2 | Offer | Accepted

goldman sachs logo
goldman sachs
sde 2Offer
March 15, 202426 reads

Summary

I successfully interviewed for an Associate SDE role at Goldman Sachs, navigating multiple DSA, system design, and behavioral rounds, ultimately receiving and accepting an offer after approximately seven weeks.

Full Experience

I applied for the Associate SDE role at Goldman Sachs via LinkedIn without a referral and surprisingly received a call from a recruiter the very next day. After discussing my current role and responsibilities, I was sent a HackerRank online assessment link, which I took two days later. (A tip for others: always try to apply through a referral!)

HackerRank Online Assessment

This assessment involved two LeetCode medium-level DSA questions, which I completed in 40 minutes out of the allotted 90. Although I don't remember the exact problems, one was array and sum related, and the other involved strings, hashing, and timestamps.

Three days later, I received a call to proceed, and my first interview was scheduled two days after that.

Round 1: DSA

This 1-hour round required solving two DSA questions with optimized code. I managed to solve both, and with 20 minutes remaining, the interviewer gave me a third question, which I also coded successfully.

The questions were:

  1. Two Sum II - Input Array Is Sorted
  2. Palindromic Substrings
  3. Meeting Rooms II

I received another call from the recruiter the following day, informing me about a "Super Day" consisting of four elimination-based rounds on the same day.

Super Day: Round 1 (DSA)

This 1-hour round presented two questions.

  1. Copy List with Random Pointer: I initially provided an O(n) time and space solution. The interviewer then challenged me to optimize the space to O(1), which I successfully achieved, thanks to remembering a tutorial from Striver.
  2. A question similar to 132 Pattern: I explained my solution for this problem, and the interviewer seemed satisfied. He then posed a follow-up to count the number of such pairs, for which I presented an O(n^2) solution. This was more of a discussion, and I wasn't asked to code it.

Super Day: Round 2 (DSA)

Another 1-hour round with two questions.

  1. Fraction to Recurring Decimal: The interviewer added a constraint that the division operator should not be used and hinted at using binary search to find the quotient of a/b.
  2. A custom problem: Given a long string (document) and a prefix, output the indices where the prefix occurs within a specific word. For example, for doc = "A BCD AB CDE DEF AGH" and prefix = "A", the output should be {0, 6, 17}. Initially, I considered a simple O(m*n) traversal, but I was hasty and jumped to a Trie solution. The interviewer gently steered me back to the simpler traversal and then followed up by asking why I considered Trie, its advantages (e.g., for multiple queries on an immutable document), and disadvantages (memory). I then outlined a Trie-based approach involving storing word-index pairs and building a Trie with lists of indices at appropriate nodes. I wasn't asked to code the initial simple traversal but was asked to code the Trie solution after our discussion.

Super Day: Round 3 (Design)

This round was purely discussion-based.

  1. First Non-Repeating Character in a Stream: The core problem was to find the first non-repeating character, with follow-ups on implementing it in single machine/multiple threads and multiple machines/multiple threads environments. I explained my approach for each scenario, including using frequency maps, splitting workloads, parallel processing, and concepts like load balancing and fault tolerance. The interviewer seemed satisfied.
  2. Design LRU cache: I also had to design an LRU cache with a follow-up. Unfortunately, I don't remember the follow-up, and I felt I messed up that part.

Super Day: Round 4 (Hiring Manager)

This round was short, lasting only 15 minutes. I discussed one of my projects and provided instances of my leadership abilities.

Two weeks later, the recruiter contacted me for one final round.

Final Round (Design + Hiring Manager)

This 30-minute round involved explaining one of my projects, followed by a design question based on that project.

Approximately seven weeks after the final round, I had a compensation call with the recruiter and received the offer, which I accepted.

Additional Info: Every round happened on CoderPad. Two interviewers were present in each round, except for Round 1 (DSA) and Super Day Round 4 (Hiring Manager).

Interview Questions (9)

Q1
Two Sum II - Input Array Is Sorted
Data Structures & AlgorithmsMedium
Q2
Palindromic Substrings
Data Structures & AlgorithmsMedium
Q3
Meeting Rooms II
Data Structures & AlgorithmsMedium
Q4
Copy List with Random Pointer
Data Structures & AlgorithmsMedium
Q5
132 Pattern (and count follow-up)
Data Structures & AlgorithmsMedium

Given an array of n integers nums, a 132 pattern is a subsequence of three integers nums[i], nums[j] and nums[k] such that i < j < k and nums[i] < nums[k] < nums[j]. The interviewer asked me to explain the solution for finding such a pattern, and a follow-up to count the total number of such pairs.

Q6
Fraction to Recurring Decimal (without division operator)
Data Structures & AlgorithmsMedium

Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating, enclose the repeating part in parentheses. An additional constraint was added: the division operator should not be used. The interviewer hinted to use binary search to find the quotient of a/b.

Q7
Find Prefix Occurrences in Document
Data Structures & Algorithms

You are given a long string doc and a prefix. The task is to output the starting indices at which the prefix occurs in a specific word within the doc. For example, if doc = "A BCD AB CDE DEF AGH" and prefix = "A", the output should be {0, 6, 17}. I initially thought of a trie but was guided towards a simpler O(m * n) traversal. The interviewer then followed up on the advantages and disadvantages of using a trie, especially for multiple queries on an immutable document. I then discussed and was asked to code a trie-based approach.

Q8
First Non-Repeating Character in a Stream (Distributed)
System DesignMedium

The core problem is to find the first non-repeating character in a string. The discussion focused on implementing this efficiently in different environments: single machine with a single thread, single machine with multiple threads, and multiple machines with multiple threads. For the single-threaded case, I described using a frequency map (map<char, pair<int, int>>) to store counts and last occurring indices, then iterating the map to find the character with frequency 1 and minimum index. For multiple threads/machines, I proposed splitting the string, processing parts in parallel, merging individual maps into a master map, and using a load balancer/fault tolerance mechanism.

Q9
Design LRU Cache
System DesignMedium

Design a Least Recently Used (LRU) cache. There was a follow-up question which I couldn't recall, and I believe I struggled with it.

Preparation Tips

To crack the interviews, I recommend the following:

  • Practice NeetCode 150 diligently, take notes, and revise them regularly. This forms the foundation.
  • Participate in LeetCode contests and upsolve problems.
  • For design rounds, have a thorough understanding of your resume projects. Avoid bluffing.
  • During each round, think out loud, explaining your thought process clearly. It's also acceptable to ask for hints from the interviewer if needed.

For System Design, I took mentorship through Preplaced, which I found very helpful for doubt resolution. The topics covered are similar to those found in resources like donnemartin/system-design-primer and ashishps1/awesome-system-design-resources.

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!