Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

D E Shaw Interview | Set 1

  • Difficulty Level : Medium
  • Last Updated : 28 Jul, 2021

Total 3 rounds. 1st written followed by 2 face to face and every round was ELIMINATION one. 

Round 1(Written – 1hr): 3 sections. 20 min each. 

section 1: 20 aptitude questions and was really hard. Avg no of questions solved is 4. 

section 2: 20 (C++ & Java) oops related questions and other output questions too. (level was good. G-Facts) 

  • In C++: mainly Virtual functions, virtual destructor, copy constructor, initializer list, virtual inheritance questions, inner classes, etc.
  • In java: mainly inner classes, Base reference, and Child object concept, overriding questions, etc. 

     

section 3: Write running code for the following problem: 

  • Find 2 nos in a sorted array whose DIFFERENCE is given no K. 

     

Out of 99, 22 students got selected. They were mainly from IITs, IIITs, NITs, Amazon, Microsoft, Adobe, etc. 

Round 2(Face to Face – 1hr): Rapid-fire questions 🙂 Mainly from OOPs concept of C++, Data Structures & Algorithms, O.S 
 

  1. Started with a simple question and moved in depth.
  2. What is a dangling reference?
  3. Moved on to what happens when we access it?
  4. How to handle it? I said we can use reference count or std::auto_ptr to avoid dangling references. He was happy with the auto_ptr smart pointer concept.
  5. Then what happens when another auto_ptr assigns previously assigned auto_ptr (i.e when we use assignment operator in auto_ptr)? I said only one auto_ptr can hold an object, so the old auto_ptr will point to NULL.
  6. Now, what happens when Old auto_ptr tries to access an object (i.e NULL). I said runtime exception and program may crash.
  7. Name the type of exception. I said maybe segmentation fault. 
     

More questions like: 

  1. Simple question. In exception handling, there is “return 1” written in a try block and “return 5” written in the final block. Which value will be returned from the function and why?
  2. Create your own Heap overflow, Stack overflow. How will you handle them?
  3. How virtual functions internally work. Explained in detail working of Virtual Table with multiple inheritance concepts too.
  4. What is pure virtual function and what is its use?
  5. What is a virtual destructor and why do we use it? Few discussions on it.
  6. What is Iterator? Write a code to implement an iterator for a given Stack Class.
  7. And many more OOPS questions which as I said was asked rapidly. 

     

Now D.S & Algorithms were simple like: 

1.Students are sitting in a classroom in row-wise order. They have been given their exam marks. Now a teacher comes and starts with 1st-row 1st student and asks their marks till the last row last students linearly. At any point in time, the highest mark up to now was to be told and after saying the highest mark that student should leave class. Next time, the highest marks were to be told in remaining ones. So basically insertion and deletion was there. 
I gave solution using MAX heap with insertion logn and deletion logn. 
Or self balancing BST with insertion logn and deletion logn. 

2.Largest BST in Binary Tree. Implemented this with O(n) time complexity. 

3.Implement phone dictionary. Gave solution using trie with hashing. Few discussions on it, but was happy at the end. 
This round went excellent according to me. 
Out of 22, 5 students were able to go to 3rd round. 

Round 3(Face to Face): Mainly tried to confuse everyone. It was fun. (1:15 hr) . Mainly related to my present work. As I was working in java field, using Spring & Hibernate, so they asked me few basic questions of Spring & Hibernate. Not in depth. 

They focused on Java, O.S & D.S & Algo. 

Java: 

1. Can static method be overridden? Why? 

I knew the answer so explained in detail. 

2. This is good one. 

class Employee
{
  int age;
  String name;
  Date DOB;
}

In another class a function was written like:

Object myFun(Employee obj, String attribute)
{
   //return proper attribute value without using conditions like If-Else, ternary or     
   // conditional operators like && etc.
}

Now if i call: 

myFun(obj, “name”); 

then this function should return name of Employee from object “obj” which was passed as parameter. So based on name of attribute value, it should return that object’s attribute value. 

D.S & Algo were simple: 

1. Given sorted array. All are repeated twice except one. Find that.  Normally people will XOR and get result in O(n). Challenge comes in using sorting property to get in log(n). 

2. Sequentially Sorted Array. All present exactly once. One number was missing from sequence and was replaced with any random number. Find both missing & random numbers. This was just to confuse people who try to use sorting property without realizing that searching in sorted array will not always result in log(n) solution. 

More twist on this question like, all repeated exactly twice except for one which is present once and its 2nd occurrence is replaced with any random numbers. 

And 2 more modifications. Overall, it was simple and required little thinking. 

3. Rotate a square matrix by 90 degree with O(1) extra space. This was interesting. 

Operating System: 

  1. What is Zombie process? Write code to create Zombie process.
  2. What is Orphan process? Write code in C to create Orphan process too.
  3. One query. Given a table having attributes stud_name, English, phy, chem., maths. Write a query to display the name of student in descending order of their aggregate marks.
  4. What is IPC? (Asked from my friend).
  5. There are N points in space. Find whether two given points are connected or not. This is a graph question. Modified Floyed Warshall’s Algorithm will work. Other good algorithms are also available in GeeksForGeeks. (Asked from my friend)

Results declared after 3-4 days. Out of 5 students, 2 of them got selected finally. I was one of the lucky guys. 🙂 

Special Thanks to you GeeksForGeeks team. I am following this site since 1 year. This is my favorite Geek Site. Now I got very good offer from D. E. SHAW. The way you have organized your site is awesome. The algorithms you provide are neat, efficient & easy to grasp. Though whole GeeksForGeeks content is very good, but I would recommend other Geeks to specially follow GeeksForGeeks algorithms & G-Facts. 

This article is compiled by Shahnawaz. Many Many congratulations to Shahnawaz for his selection. If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to review-team@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks. 

 

 

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!