D.E.Shaw interview experience Real time questions & tips from candidates to crack your interview

Associate Developer Intern

D.E.Shaw
upvote
share-icon
4 rounds | 9 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Algorithms, Object-Oriented Programming, Graphs, Trees, DP, Databases
Tip
Tip

Tip 1 : Practise problems on Leetcode and solve past year company-specific problems
Tip 2 : Be very good at OOPS concepts, study in-depth about Polymorphism, Inheritance, Friend functions, Operator Overloading
Tip 3 : Do at least one project and know every in and out about it

Application process
Where: Campus
Eligibility: 7 CGPA
Resume Tip
Resume tip

Tip 1 : Don't fake any project or any programming language on the resume.
Tip 2 : If you are including projects in python or experience in the python language then you must be good with OOPs concepts with implementation.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration95
Interview date31 Aug 2020
Coding problem3

This was a programming test consisting of 3 sections with 1 question each. 25 mins for the 1st section, and 35 for the 2nd and 3rd section. Each section had its own fixed time.

1. Majority Element - II

Easy
10m average time
90% success
0/40
Asked in companies
Morgan StanleyAmazonD.E.Shaw

You are given an array/list 'ARR' of integers of length ‘N’. You are supposed to find all the elements that occur strictly more than floor(N/3) times in the given array/list.

Problem approach

I quickly implemented a brute force solution in 2-3 minutes to pass partially. Then implemented a time-efficient solution with 7^3 time complexity. 

Try solving now

2. MegaPrime Numbers

Easy
15m average time
90% success
0/40
Asked in companies
Daffodil SoftwareUnthinkable SolutionsNagarro Software

Given two integers ‘Left’ and ‘Right’. Your task is to find the total count of ‘megaprime’ numbers from the range ‘Left’ to ‘Right’. A ‘megaprime’ number is a prime number and its individual digits are also prime.

For example, ‘53’ is a ‘megaprime’ number because ‘53’ is a prime number and its individual digits,‘3’ and ‘5’, are also prime. ‘13’ is not a ‘megaprime’ number because out of its individual digits (1, 3), ‘1’ is not prime.

Note :

1.’Left’ and ‘Right’ both are inclusive in the range ‘Left’ to ‘Right’.

Example :

‘Left’ = ‘23’  and ‘Right’ = ‘37’

binary_heap

All prime numbers from ‘23’ to ‘37’ are 23, 29, 31, 37

23 is ‘megaprime’ number because ‘2’ and ‘3’ both are prime
29 is not ‘megaprime’ number because ‘9’ is not a prime
31 is not a ‘megaprime’ number because ‘1’ is not a prime number
37 is ‘megaprime’ number because ‘3’ and ‘7’ both are prime numbers
Hence there are two ‘megaprime’ numbers 23, 37 out of 23, 29, 31, 37.
Try solving now

3. Jump Game

Moderate
15m average time
85% success
0/80
Asked in companies
Deutsche BankGoldman SachsAmazon

You have been given an array 'ARR' of ‘N’ integers. You have to return the minimum number of jumps needed to reach the last index of the array i.e ‘N - 1’.


From index ‘i’, we can jump to an index ‘i + k’ such that 1<= ‘k’ <= ARR[i] .


'ARR[i]' represents the maximum distance you can jump from the current index.


If it is not possible to reach the last index, return -1.


Note:
Consider 0-based indexing.
Example:
Consider the array 1, 2, 3, 4, 5, 6 
We can Jump from index 0 to index 1
Then we jump from index 1 to index 2
Then finally make a jump of 3 to reach index N-1

There is also another path where
We can Jump from index 0 to index 1
Then we jump from index 1 to index 3
Then finally make a jump of 2 to reach index N-1

So multiple paths may exist but we need to return the minimum number of jumps in a path to end which here is 3.
Problem approach

Solved in a greedy manner.

Try solving now
02
Round
Medium
Video Call
Duration70
Interview date1 Sep 2020
Coding problem3

There were two interviewers on a video call. For the first 25 minutes, the first interviewer asked his questions, and later the second one. For the second 25 minutes, questions related to OOPS were discussed, and also was asked to implement few things.

1.

1. What concepts do you know about OOPS?
2. Implement Runtime polymorphism and Compile time polymorphism.
3. What are virtual functions?
4. Write a Copy constructor for a derived class? 
5. He made some changes in my base class written, he added static in front of the virtual keyboard and asked me that now tell how will it behave now?
6. Difference between endl and \n?
7. Overload the << Operator to print comma-separated members of a class?
8. Are virtual destructors possible in c++?
9. Where do we use classes and OOPS concepts in real life?

Problem approach

Tip 1 : Be very thorough with OOPS concepts
Tip 2 : Don't just read about OOPS do try them and write code for OOPS concepts

2. Alien dictionary

Hard
46m average time
50% success
0/120
Asked in companies
AdobeFacebookInfo Edge India (Naukri.com)

You have been given a sorted (lexical order) dictionary of an alien language.


Write a function that returns the order of characters as a string in the alien language. This dictionary will be given to you as an array of strings called 'dictionary', of size 'N'.


Example :
If the dictionary consists of the following words:-
["caa", "aaa", "aab"], and 'K' is 3.

Then, the order of the alphabet is -
['c', 'a', 'b']
Note:
If the language consists of four letters, the four letters should be the starting four letters of the English language. 

However, their order might differ in the alien language.
Try solving now

3. Bottom view of binary tree

Moderate
10m average time
90% success
0/80
Asked in companies
OYOMicrosoftAmazon

You are given a 'Binary Tree'.


Return the bottom view of the binary tree.


Note :
1. A node will be in the bottom-view if it is the bottom-most node at its horizontal distance from the root. 

2. The horizontal distance of the root from itself is 0. The horizontal distance of the right child of the root node is 1 and the horizontal distance of the left child of the root node is -1. 

3. The horizontal distance of node 'n' from root = horizontal distance of its parent from root + 1, if node 'n' is the right child of its parent.

4. The horizontal distance of node 'n' from root = horizontal distance of its parent from the root - 1, if node 'n' is the left child of its parent.

5. If more than one node is at the same horizontal distance and is the bottom-most node for that horizontal distance, including the one which is more towards the right.


Example:
Input: Consider the given Binary Tree:

alt text

Output: 4 2 6 3 7

Explanation:
Below is the bottom view of the binary tree.

alt text

1 is the root node, so its horizontal distance = 0.
Since 2 lies to the left of 0, its horizontal distance = 0-1= -1
3 lies to the right of 0, its horizontal distance = 0+1 = 1
Similarly, horizontal distance of 4 = Horizontal distance of 2 - 1= -1-1=-2
Horizontal distance of 5 = Horizontal distance of 2 + 1=  -1+1 = 0
Horizontal distance of 6 = 1-1 =0
Horizontal distance of 7 = 1+1 = 2

The bottom-most node at a horizontal distance of -2 is 4.
The bottom-most node at a horizontal distance of -1 is 2.
The bottom-most node at a horizontal distance of 0 is 5 and 6. However, 6 is more towards the right, so 6 is included.
The bottom-most node at a horizontal distance of 1 is 3.
The bottom-most node at a horizontal distance of 2 is 7.

Hence, the bottom view would be 4 2 6 3 7


Problem approach

I thought for a bit time then made some trees on the editor and asked him the expected output for those to get the clarity, Then I implemented the DFS were along with depth I stored the direction from parent whether reached node as Left child of a parent or right child and implement smart DFS. The interviewer was satisfied with the entire discussion.

Try solving now
03
Round
Medium
Video Call
Duration60-65 minutes
Interview date1 Nov 2020
Coding problem2

It consisted of two coding problems which involved proper coding it and explaining each and every aspect and I have to show dry run over a few cases

1. Is Binary Heap Tree

Easy
10m average time
90% success
0/40
Asked in companies
AmazonServiceNowD.E.Shaw

You have been given a binary tree of integers.

Your task is to check if it is a binary heap tree or not.

Note:

A binary tree is a tree in which each parent node has at most two children. 

A binary heap tree has the following properties. 
1. It must be a complete binary tree. In the complete binary tree every level, except the last level, is completely filled and the last level is as far left as possible.

2. Every parent must be greater than its all children nodes.
For example:
Consider this binary tree:

binary_heap

Figure 1 is a complete binary tree because every level, except the last level, is completely filled and the last nodes are as far left as possible, and the level has 2 nodes both on the left side.

Figure 2 is not a complete binary tree because level 2 (level is 0 based) is not completely filled means the right child of the node (36) is missing.
There is another reason, in the last level, there can be one another node in between node (1) and node (14) to make the binary tree as far left as possible.
Note:
1. In the world of programming two types of binary heap tree possible:
   a. Min-heap - if all parents nodes are lesser than its children nodes.
   b. Max-heap - if all parents nodes greater than its children nodes, explained in the above figure-1.

2. In this problem binary heap tree is a binary max-heap tree.
Problem approach

Firstly, I solved this using DFS and BFS approach that takes O(N) time so the interviewer asked me to optimize it. Then I used this property of 2*parent,2*parent+1 to solve it in O(logN), I constructed the path from the node to root using a while loop and stored the path. Then traveled from root along that path to reach the required node or if I exceed it then return false.

Try solving now

2. Chocolate Problem

Moderate
15m average time
85% success
0/80
Asked in companies
EcomExpressIBMMicrosoft

Given an array/list of integer numbers 'CHOCOLATES' of size 'N', where each value of the array/list represents the number of chocolates in the packet. There are ‘M’ number of students and the task is to distribute the chocolate to their students. Distribute chocolate in such a way that:

1. Each student gets at least one packet of chocolate.

2. The difference between the maximum number of chocolate in a packet and the minimum number of chocolate in a packet given to the students is minimum.

Example :

Given 'N' : 5 (number of packets) and 'M' : 3 (number of students)

subsequence

And chocolates in each packet is : {8, 11, 7, 15, 2}

All possible way to distribute 5 packets of chocolates among 3 students are -

( 8,15, 7 ) difference of maximum-minimum is ‘15 - 7’ = ‘8’
( 8, 15, 2 ) difference of maximum-minimum is ‘15 - 2’ = ‘13’ 
( 8, 15, 11 ) difference of maximum-minimum is ‘15 - 8’ = ‘7’
( 8, 7, 2 ) difference of maximum-minimum is ‘8 - 2’ = ‘6’
( 8, 7, 11 ) difference of maximum-minimum is ‘11 - 7’ = ‘4’
( 8, 2, 11 ) difference of maximum-minimum is ‘11 - 2’ = ‘9’
( 15, 7, 2 ) difference of maximum-minimum is ‘15 - 2’ = 13’
( 15, 7, 11 ) difference of maximum-minimum is ‘15 - 7’ = ‘8’
( 15, 2, 11 ) difference of maximum-minimum is ‘15 - 2’ = ‘13’
( 7, 2, 11 ) difference of maximum-minimum is ‘11 - 2’ = ‘9’

Hence there are 10 possible ways to distribute ‘5’ packets of chocolate among the ‘3’ students and difference of combination (8, 7, 11) is ‘maximum - minimum’ = ‘11 - 7’ = ‘4’ is minimum in all of the above.
Problem approach

I solved using recursion + dynamic programming first then I optimized it using the Binary Search approach.

Try solving now
04
Round
Easy
HR Round
Duration20 minutes
Interview date1 Sep 2020
Coding problem1

It was a very friendly and chill round.

1. Do you have any question for the interviewer?

Here I was supposed to ask the questions from the hiring manager. She asked if I want to know anything about the company or any general questions. So asked him about the projects and teams at Deshaw and some other questions.

Problem approach

Be natural don't try to make a question out of nowhere.
 

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
SDE - Intern
2 rounds | 3 problems
Interviewed by D.E.Shaw
2237 views
1 comments
0 upvotes
SDE - 1
3 rounds | 3 problems
Interviewed by D.E.Shaw
0 views
0 comments
0 upvotes
SDE - Intern
3 rounds | 6 problems
Interviewed by D.E.Shaw
865 views
0 comments
0 upvotes
Technology Developer
3 rounds | 13 problems
Interviewed by D.E.Shaw
1523 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Associate Developer Intern
2 rounds | 3 problems
Interviewed by HCL Technologies
0 views
0 comments
0 upvotes