# Goldman Sachs Interview Experience | Set 36 (For Experienced)

Last Updated : 02 Dec, 2017

I have interviewed with Goldmanc sachs in Nov-17. The processÂ  is very slow as in my case first round was started in Sept-17 andÂ last round ended in Nov-17.

Round 1:Â First was the HackerRank Test. Two Coding questions, first easy ,second Medium to Hard Level.

Note: I do not remember the exact wording of the question.

1.)Â  Given an string and a burst length , output the string such that count of same adjacent characters in string areÂ less than burst length.

Example:

Input : abbcaaaccd , 3

Output: abbd

2.) Given an array of distinct integers, output the number of sub-sequences of length 3, either in increasing or decreasing order.

Tips:Â Prepare Dynamic Programming asÂ almost every time second question is of DP.

Here two questions were asked :

1. Â A robot can only move in four directions , UP(U), DOWN(D),LEFT(L),RIGHT(R). Given a string consisting of instructions to move , output the co-ordinates of robot after the executing the instructions. Initial position of robot is at origin(0,0).
2. Given an array of integers and a sum, output the number ofÂ pairsÂ  whoseÂ addition is equal to the given sum.

Tips: InÂ  CoderPad round first discuss your algorithm with the interviewer. Interviewer exceptsÂ you to writeÂ professional level code. Also interviewer will ask you to write all possible test cases especially corner test cases and your code should pass it.

Round 3: Video ConferenceÂ

In this round lots of technical questions were asked to check to in-depth knowledge of theÂ C++ language.

Some questions i remember are:

1. Introduce yourself
2. What is Virtual keyword, how vtable works, virtual destructor.
3. Exception handling in C++, C++14(if you claim to know c++14)
4. Lots of scenariosÂ related to run-time polymorphismÂ Â  are given and asked what will be the output and why
5. STL containers Map, Set, unordered_map.
6. Difference between map and unordered_map in C++, their implementation details.
7. Real world uses of map, set, unordered_map.
8. Thread safety of STL containers.
9. smart pointers like unique_ptr, shared_ptr, weak_ptr. Usecases and differences among them.
10. Algorithm Question: Given a matrix of integers , find theÂ sub matrix with the maximum sum.

After this roundÂ and a month wait, i was called for face to face discussion in GS Bangalore. All the below round were happened in GSÂ Bangalore and in single day. For each round there were two interviewers.

Round 4:Â  Face to Face

Again lots of questions on C++ :

1. Virtual mechanism
2. Pure Virtual function uses
3. Pure virtual function vs virtual function
4. Output prediction :Â Given some C++ code , what will be output and why.( I do not remember the exact questions but one case was of run-time polymorphism and second one was of local reference returned from a function)
5. Algorithm questions
• Given an array of integers find the maximum sub-array. Output the sumÂ with start-end index.
• Given a matrix filled with X and 0(zero). Calculate the distance from nearest 0 for all cells marked with X.The distance of four neighboring cells(top,bottom,right,left) will be 1. For exampleInput:X X X
X 0 X
X X X

Output:
2 1 2
1 0 1
2 1 2

Round 5Â

C++ questions :

2. Different types of cast and difference between them
3. Up Cast and Down cast, why and how they works.
4. Diamond problem and how to resolve it.
5. How virtual inheritance works internally.
6. Algorithm questions :
• Given a linked list with only three possible numbers 0,1,2, sort the list.
• Given a array of sorted but repeated integers , find the number of occurrence of a given number.

Round 6

Design QuestionÂ  : Design a mobile directory i.e. the list of contacts to save mobile number , email and other information. All operations which we can do in our mobile like searching by name , number etc.

Algorithm Question :Â Given two strings s1, s2. output all the ways in which these two strings can be merged while keeping the order of character same as they were in s1, s2. Design a recursive algorithm.

Example : s1 : ab , s2: cd

Output :

abcd

acbd

acdb

cabd

cdab

So guys, hope you will find it useful for your interview preparation. Best of luck!!!

Previous
Next