Goldman Sachs
Annu Insulation Traders Interview Questions and Answers
Q1. Given 10 balls which weigh the same, except for one, and a beam balance, what is the minimum number of weighs to find the odd ball?
The minimum number of weighs to find the odd ball is 4.
Divide the 10 balls into 3 groups of 3, 3, and 4.
Compare the weights of the two groups of 3 balls.
If the weights are equal, the odd ball is in the group of 4.
If the weights are unequal, the odd ball is in the lighter group of 3.
Divide the lighter group of 3 balls into individual balls and compare their weights.
The odd ball will be identified in the 4th weigh.
Q2. Given an island in the center of a lake, and you are standing outside the lake, how would you reach the center?
To reach the center of the island, one can use a boat or any other means to cross the lake.
Use a boat to reach the island
Swim across the lake if it's not too far
If the lake is frozen, walk or skate across the ice
If there is a bridge or causeway connecting the island, use it to reach the center
Q3. How would you design an elevator system for a building?
Designing an elevator system for a building involves considering factors like capacity, speed, safety, and efficiency.
Determine the number of floors and the expected traffic flow in the building
Calculate the required capacity and speed of the elevators
Consider safety features such as emergency stop buttons, fire-resistant materials, and backup power supply
Implement efficient algorithms for elevator scheduling to minimize waiting time
Incorporate user-friendly features like cle...read more
Q4. How would you code a linked list? Show the code
A linked list is a data structure where each element contains a reference to the next element.
Create a Node class with data and next pointer
Create a LinkedList class with head pointer
Implement methods like insert, delete, search, etc.
Q5. What is the difference between OOP and procedural programming?
OOP focuses on objects and their interactions, while procedural programming focuses on procedures and functions.
OOP organizes code into objects that encapsulate data and behavior.
Procedural programming uses functions to manipulate data.
OOP supports concepts like inheritance, polymorphism, and encapsulation.
Procedural programming is more straightforward and linear in nature.
OOP promotes code reusability and modularity.
Procedural programming is often used for small-scale projec...read more
Q6. When would Java be used over C/C++?
Java is used over C/C++ when platform independence, ease of use, and security are important.
Java is platform independent, meaning it can run on any operating system or hardware that has a Java Virtual Machine (JVM). C/C++ code needs to be compiled separately for each platform.
Java has automatic memory management, reducing the risk of memory leaks and making it easier to write and maintain code. C/C++ requires manual memory management.
Java has built-in security features, such ...read more
More about working at Goldman Sachs
Reviews
Interviews
Salaries
Users/Month