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.
Round 2: CoderPad
Here two questions were asked :
- 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).
- Given an array of integers and a sum, output the number of pairs whose addition is equal to the given sum.
- Introduce yourself
- What is Virtual keyword, how vtable works, virtual destructor.
- Exception handling in C++, C++14(if you claim to know c++14)
- Lots of scenarios related to run-time polymorphism are given and asked what will be the output and why
- STL containers Map, Set, unordered_map.
- Difference between map and unordered_map in C++, their implementation details.
- Real world uses of map, set, unordered_map.
- Thread safety of STL containers.
- smart pointers like unique_ptr, shared_ptr, weak_ptr. Usecases and differences among them.
- Algorithm Question: Given a matrix of integers , find the sub matrix with the maximum sum.
- Virtual mechanism
- Pure Virtual function uses
- Pure virtual function vs virtual function
- 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)
- 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
- Implement assignment Operator Overloading , copy constructors.
- Different types of cast and difference between them
- Up Cast and Down cast, why and how they works.
- Diamond problem and how to resolve it.
- How virtual inheritance works internally.
- 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.