Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding
Ninjas X Naukri.com

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

D.E.Shaw

4 rounds | 9 Coding
problems

Preparation

Duration: 6 months

Topics: Algorithms, Object-Oriented Programming, Graphs, Trees, DP, Databases

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

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.

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.

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.

```
1.â€™Leftâ€™ and â€˜Rightâ€™ both are inclusive in the range â€˜Leftâ€™ to â€˜Rightâ€™.
```

```
â€˜Leftâ€™ = â€˜23â€™ and â€˜Rightâ€™ = â€˜37â€™
```

```
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.
```

```
Consider 0-based indexing.
```

```
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.

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. 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

```
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']
```

```
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.
```

```
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.
```

```
Input: Consider the given Binary Tree:
```

```
Output: 4 2 6 3 7
Explanation:
Below is the bottom view of the binary tree.
```

```
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.

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

```
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.
```

```
Consider this binary tree:
```

```
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.
```

```
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.

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

```
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.

04

Round

Easy

HR Round

Duration20 minutes

Interview date1 Sep 2020

Coding problem1

It was a very friendly and chill round.

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

What does HTML stand for?

Choose another skill to practice

Start a Discussion

Similar interview experiences

SDE - Intern

2 rounds | 3 problems

Interviewed by D.E.Shaw

1810 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

554 views

0 comments

0 upvotes

Technology Developer

3 rounds | 13 problems

Interviewed by D.E.Shaw

1009 views

0 comments

0 upvotes

Companies with similar interview experiences

Associate Developer Intern

2 rounds | 3 problems

Interviewed by HCL Technologies

0 views

0 comments

0 upvotes