Open In App

Goldman Sachs Interview Experience for SDE 2 (1.5 Yrs Exp) 2022

Last Updated : 06 Oct, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Coding Round:
 

  1. Given a number x, and a range of y to z. Please find the count of all the numbers in the range. Such that the product of the numbers n and x does not contain any digit from the number n.
    Input: 2 10 15
    Output: 4
  2. Number Pattern: Given a pattern containing Ns and Ms. N represent ascending, M represents descending. The sequence is given (let’s say NMMNM), digits that can be used 1-9 (digits can’t repeat.) Output: Min number for the given sequence.
    Input: M
    Output: 21

Telephonic Round 1: 

  1. Encode the string such that:
    Eg1. String= abcabc
            Encoded string=abc*
    Eg2. String= ababababba
            Encoded=ab**ba
    If the string matches with the start to that digit then replace it with a *.
    https://www.geeksforgeeks.org/run-length-encoding/

Round 1(F2F):

  1. Swap the elements if the first digit is less than the second one.
  2. In an array count the triplets with a sum greater than k.
  3. Difference between final finalize and finally.
  4. Different types of inheritance?
  5. Difference between inheritance in Java and Cpp.
  6. Difference between overloading and overriding?
  7. Aware of the self-binary tree?
  8. What is heap sort?
  9. Explain Merge Sort?

Round 2(F2F):

  • https://www.geeksforgeeks.org/find-possible-words-phone-digits/amp/
  • (DFS/BFS) Check if the sensor can trigger the last sensor in a 2 D matrix. One sensor can trigger neighboring four sensors (right, left, up, down).
  • Difference between abstract and Interface.
  • Difference between Integer and int.
  • How to use interface to extend 2 classes.
  • Tricky questions on declaring class A, class B extending classes, which of the declarations are correct.
    Class B extend A
    a,b, alist, blist;
alist.add(b); 
blist.add(a); correct
alist.addAll(blist); 
blist.addAll(alist); correct
   
   List<List<A>>  all= ListList<L>()
   List<list<B>  bll
   
   all.add(blist);
 bll.add(alist);
 
 class ALsit{
   List<List<A>> l;
 }
 class BLsit extends ALsit{
   List<List<B>> l;
 }
  • What is different in Java 8?
  • How to filter and return names using the lambda function in Java 8?

Round 3(F2F):

  1. https://www.geeksforgeeks.org/find-a-tour-that-visits-all-stations/amp/ There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it costs consumption[i] of gas to travel from station i to its next station (i+1).gas={1,2,3,4,5}
    consumption={3,4,5,1,2}
  2. How is memory allocated in python?
  3. How is memory allocated in Java?
  4. What is stack heap?
  5. Difference between tag and element in HTML.
  6. Write endpoint (@Getmapping)
  7. Mutable class?
  8. Are you aware of the design pattern?
  9. How to write a singleton class?
  10. Write singleton class without using annotations.

Verdict: Rejected


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads