DE Shaw Off-Campus Fresher Interview Experience

How I Applied? 
I applied through their careers page https://www.deshawindia.com/OpenPositions.shtml . 
I got to know about their recruiting through a friend. Then got an invitation for their OffCampus test after a week of applying.

Hackerrank  Test : 
The test was for 100 marks with 90 minutes time limit. The format of the test is as follows:

  1. Programming Section: It had 2 coding questions of 20 and 40 marks each, with a time limit of 50 minutes.
  2. MCQ Section: This had 10 technical and 10 aptitude questions, with a time limit of 20 minutes each. Each correct answer will carry 2 marks and the wrong answer will carry negative 0.5 marks.
  3. Technical questions will cover Data structures & algorithms, Operating systems, Database systems, SQL, and Networks.
  4. Aptitude questions will cover Quantitative Aptitude, Problem-solving, and Logical & verbal Reasoning.

The first Coding question was easy, something related to array manipulation and implementation. Another one was about finding kth permutation of a string (k<=1e9).

Round 1: CodePair Round 1.5 hr
I got a reply from them after a month of the test. In CodePair Round the interviewer asked me to solve two programming questions. The first one was quite easy and straight forward it said to find the number of ways a given number can be expressed as a sum of more than 1 consecutive natural numbers. You can find the link https://www.geeksforgeeks.org/count-ways-express-number-sum-consecutive-numbers
The second one was: Given a matrix(n * m) and a queen positioned at (n-1,m/2). Find the number of ways in which the queen can reach cell no. (x,y) in minimum number of moves. There were Q queries of (x,y). The queen can move in any of the eight valid directions in one move. Preprocessing of O(n2) was allowed and queries were supposed to be answered in O(1).
Then there was a small discussion on my projects and some questions regarding polymorphism, Virtual functions were asked along with other OOPS concept.

Round 2: Technical Round 1 hr
This round was also on HackerRank CodePair. I was supposed to solve one programming. The question was: Given stock prizes for N days. Each day you could either buy a stock or sell some/all of the stocks you have purchased previously. It is also allowed to not perform any operation for a day.  
Buying a stock will count as a negative addition to profit and selling will count as a positive addition to the profit. Find the maximum profit that could be achieved given the Stock prizes for N days. 
Example :  [1,5,2,100,3,2]
Buy stocks for first three days = -1 + -5 + -2 = -8
Sell all the stocks on the fourth day = +100*4 
Don’t do anything on the fifth and sixth day as there is no way one could sell the bought stock at a higher price. Thus, maximum profit = -8 + 100*4 = 392



My Solution: Find the next maximum Stock price for each day and buy that stock only if there is any available higher prize. So the profit will be: 
For each ith day buying a stock ( – stockPrize[i] ) and selling the stock at a later day with highest stock prize ( i.e. +max(stockPrize[i+1,n-1] ) ). This range maximum could be easily computed using suffix maximum, given a solution in linear time.

Apart from this coding question I was asked questions from DBMS, OS, Projects: 

  • What is a Composite Index? How does it work?
  • Some SQL queries using joins.
  • What is the significance of on condition in an outer join?
  • Some questions on the Tech Stack of my Projects.
  • Questions on ReactJS, as I had some projects and internships on that.
  • The lifeCycle of React? Why React is used?  What is Virtual DOM? How does it work? etc.

Round 3: Technical Round 1.5 hr
This round was also on HackerRank CodePair. Design and implement a class that can be used to allocate and de-allocate a certain amount of memory blocks. The class will initially have a fixed block of memory which will only be used to allocate memory. Say 1024 blocks.

  • They were expecting me to think and design a prototype that will work the way internally memory management works.
  • Discussion on what data structure could be used for allocating contiguous blocks of memory. What methods will be used and what will their signatures?
  • Which data structure is the most suitable and why?  What will be the complexity of the allocate and de-allocate functions? 
    How will you handle the situation of a variable amount of memory blocks?
  • While I was implementing the prototype of the class they asked me to write Copy Constructor and also asked to overload the subscript operator for the class.
  • Does the copy constructor do a shallow copy or a deep copy? If Shallow then how will you make this a Deep Copy? What are the problems in Shallow Copy?

There is no right or wrong answer for the Class Design. They just want to judge you on how you could apply CS fundamentals to solve the problem and are you able to identify some flaws in the design and also they expect you to eventually solve them.

Given a file consisting of millions of records. The data is in a structured format i.e in a tabular format with each record consisting of many attributes. 

  • How will you perform search operation on the file given the file is stored in secondary memory? Optimize it.
  • What if the whole file can be brought into the main memory?
  • Sorting is not an option as data needs to be searched on different attributes, how will you optimally solve this?
  • If you are allowed to store additional data structures after doing some preprocessing on the file in order to perform an optimized search operation. What data structures will you use and how much effect it will have on optimality?

What is a Trie Data Structure? Explain it’s node structure and working? What is it’s applications?
How will you optimize the memory usage in Trie?
 

A simple Game Theory question: Given Two Players A and B separated by N number of tiles. In a move, each one can move one or two-step ahead. Who will win if player A starts and each one plays alternately and optimally. The player who is not able to make any move losses the game.
A _ _ _ _ B for n=4  
Solution : 
If n=1 or 2, A wins in one move. Thus, both n=1 and n=2 are winning states
n=3, B wins as from n=3 we could go to either n=1 or n=2 and both are winning states
Thus if f(n) = 0 if B wins and 
                          1 if A wins
f(n) = 0 if ( f(n-1)==1 and f(n-2)==1 ) 
f(n) = 1 if( f(n-1)==0 or f(n-2)==0 )
Base cases f(2)=1 and f(1)=1This could be solved in linear time. But if you write down all the values of f() you will find that it decomposes to f(n) =  0 if n is a multiple of 3 otherwise f(n)=1.

After a day or two, I got their call that they are willing to offer me the position. 


Write your Interview Experience or mail it to contribute@geeksforgeeks.org

My Personal Notes arrow_drop_up

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.