Goldman Sachs interview experience Real time questions & tips from candidates to crack your interview

SDE - Intern

Goldman Sachs
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 1 Month
Topics: DSA, Computer Networks, Operating Systems, DBMS, OOPS
Tip
Tip

Tip 1 : Practice CP more and more.
Tip 2 : Keep your resume short and crisp.

Application process
Where: Referral
Eligibility: No
Resume Tip
Resume tip

Tip 1 : Keep your resume short and crisp.
Tip 2 : Highlight your achievements and projects.

Interview rounds

01
Round
Easy
Online Coding Test
Duration60 Minutes
Interview date11 Apr 2019
Coding problem2

It was online test round, which consisted of CODING, APTITUDE and DEBUGGING questions.

1. Aggressive Cows

Moderate
30m average time
70% success
0/80
Asked in companies
AdobePhonePeSamsung

You are given an array 'arr' consisting of 'n' integers which denote the position of a stall.


You are also given an integer 'k' which denotes the number of aggressive cows.


You are given the task of assigning stalls to 'k' cows such that the minimum distance between any two of them is the maximum possible.



Example:
Input: 'n' = 3, 'k' = 2 and 'arr' = {1, 2, 3}

Output: 2

Explanation: The maximum possible minimum distance will be 2 when 2 cows are placed at positions {1, 3}. Here distance between cows is 2.
Problem approach

Tip 1: it was Leetcode medium problem, you can solve easily if you have practiced from there.

Try solving now

2. Rotting Oranges

Moderate
20m average time
78% success
0/80
Asked in companies
Samsung R&D InstituteSalesforceSamsung

You have been given a grid containing some oranges. Each cell of this grid has one of the three integers values:

  • Value 0 - representing an empty cell.
  • Value 1 - representing a fresh orange.
  • Value 2 - representing a rotten orange.
  • Every second, any fresh orange that is adjacent(4-directionally) to a rotten orange becomes rotten.

    Your task is to find out the minimum time after which no cell has a fresh orange. If it's impossible to rot all the fresh oranges then print -1.

    Note:
    1. The grid has 0-based indexing.
    2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
    
    Try solving now
    02
    Round
    Medium
    Video Call
    Duration60 Minutes
    Interview date19 Apr 2019
    Coding problem2

    2 coding questions were asked.

    1. Search In Rotated Sorted Array

    Moderate
    30m average time
    65% success
    0/80
    Asked in companies
    InformaticaDelhiveryGoldman Sachs

    Aahad and Harshit always have fun by solving problems. Harshit took a sorted array consisting of distinct integers and rotated it clockwise by an unknown amount. For example, he took a sorted array = [1, 2, 3, 4, 5] and if he rotates it by 2, then the array becomes: [4, 5, 1, 2, 3].

    After rotating a sorted array, Aahad needs to answer Q queries asked by Harshit, each of them is described by one integer Q[i]. which Harshit wanted him to search in the array. For each query, if he found it, he had to shout the index of the number, otherwise, he had to shout -1.

    For each query, you have to complete the given method where 'key' denotes Q[i]. If the key exists in the array, return the index of the 'key', otherwise, return -1.

    Note:

    Can you solve each query in O(logN) ?
    
    Problem approach

    First applied brute force - then slowly optimized the solution.
    The interviewer was very helpful.

    Try solving now

    2. The Celebrity Problem

    Moderate
    30m average time
    60% success
    0/80
    Asked in companies
    OlaVisaApple

    There are ‘N’ people at a party. Each person has been assigned a unique id between 0 to 'N' - 1(both inclusive). A celebrity is a person who is known to everyone but does not know anyone at the party.

    Given a helper function ‘knows(A, B)’, It will returns "true" if the person having id ‘A’ know the person having id ‘B’ in the party, "false" otherwise. Your task is to find out the celebrity at the party. Print the id of the celebrity, if there is no celebrity at the party then print -1.

    Note:
    1. The helper function ‘knows’ is already implemented for you.
    2. ‘knows(A, B)’ returns "false", if A doesn't know B.
    3. You should not implement helper function ‘knows’, or speculate about its implementation.
    4. You should minimize the number of calls to function ‘knows(A, B)’.
    5. There are at least 2 people at the party.
    6. At most one celebrity will exist.
    
    Try solving now

    Here's your problem of the day

    Solving this problem will increase your chance to get selected in this company

    Skill covered: Programming

    How do you remove whitespace from the start of a string?

    Choose another skill to practice
    Similar interview experiences
    company logo
    SDE - Intern
    3 rounds | 5 problems
    Interviewed by Goldman Sachs
    2522 views
    0 comments
    0 upvotes
    company logo
    SDE - Intern
    3 rounds | 11 problems
    Interviewed by Goldman Sachs
    5992 views
    0 comments
    0 upvotes
    company logo
    SDE - Intern
    4 rounds | 7 problems
    Interviewed by Goldman Sachs
    821 views
    0 comments
    0 upvotes
    company logo
    SDE - Intern
    3 rounds | 14 problems
    Interviewed by Goldman Sachs
    812 views
    0 comments
    0 upvotes
    Companies with similar interview experiences
    company logo
    SDE - Intern
    3 rounds | 6 problems
    Interviewed by Amazon
    15605 views
    4 comments
    0 upvotes
    company logo
    SDE - Intern
    4 rounds | 7 problems
    Interviewed by Microsoft
    15499 views
    1 comments
    0 upvotes
    company logo
    SDE - Intern
    2 rounds | 4 problems
    Interviewed by Amazon
    10216 views
    2 comments
    0 upvotes