# DE Shaw Summer Internship Interview Experience 2021 | On-Campus VIT Vellore

Written by Siddharth Garg | Published 4 months ago

DE Shaw visited VIT, Vellore on 21st August 2020 for the position of Quality & Test Engineering Intern. The position was for two months in summer 2021, for 2022 batch (3rd year) students. They selected 2 interns from the campus. I got selected for this position so I thought I could help other people curious about the process as I was.

**The Eligibility Criteria:**

- 70% or 7.0 CGPA in X and XII
- 7.0 GPA in pursuing Degree (CS/IT Related Branches)
- 8.0 CGPA (ECE /EEE Related Branches)
- No Standing Arrears

The selection process consisted of three rounds.

__Round 1 (1500+ people appeared)__

__Round 1 (1500+ people appeared)__

This round was conducted on hackerrank. This was a programming & MCQ test for 138 marks with 95 minutes time limit. Each wrong answer will carry a negative marking of 33% of the marks for that question. The format of the test was as follows:

**Aptitude Section**: 14 Questions for 28 minutes (Also includes 2 sets with 3 questions)

I was able to solve all questions but one, the questions were a mix of quantitative reasoning and general aptitude.

**Technical Section**: 12 Questions for 17 minutes

This section comprised of pseudo code questions, general programming concepts, SQL questions ,and some based on Data Structures and Algos. I was able to attempt 10 out of 12 of these with confidence. I didn't attempt the other two in lieu of negative marking

**Coding Section** **1**: 1 Question for 20 minutes

**Q. Given an array of positive integers, find out the number of sub-arrays which consist of prime numbers only. **

Eg - [2,3,1,7,2] --> Subarrays would be [2],[3],[2,3],[7],[2],[7,2]. So the answer would be 6.

**Coding Section** **2**: 1 Question for 30 minutes

**Q. The question was long and had a lot of unnecessary stuff like Thanos is out to destroy the planets, but the gist was-**

**Two arrays are given, one binary array A (containing only 0s and 1s) and the other cost array B of the same length. You have to convert the binary array to all 1s in minimum cost. For every ith element in the array A, converting from 0 to 1 requires B[i] cost. and if A[i-1] and A[i+1] are 1 then A[i] can be converted with 0 cost. Find the minimum possible cost to convert all 0s to 1s. **

I passed some test cases of question 1 but couldnt pass any of question 2. But fortunately because of my performance in the other two sections __ I was selected for the next round. __

__Round 2 (17 people shortlisted)__

__Round 2 (17 people shortlisted)__

- The round was scheduled on 21st and 22nd August (the same day and next day). For me, it was on 22nd scheduled for 1 hour but lasted 1hr 30mins. There were two interviewers, super friendly and supportive.
- This round was conducted on hackerrank's CodePair platform where you can simultaneously share your IDE and video chat with the recruiters. The recruiters can see your IDE and edit the code as well.
- It started with general interview questions like introduce yourself. Then they asked if I had any previous internship experience, I had 2 internships in my profile which I described in detail. I was then asked about my projects. The recruiter took a keen interest in one project which was a complicated one, I spent 10-15 mins explaining that project itself.
- Then I was given a little open ended question to solve - "Given a regex consisting of '\d','\w','$',^','+','*' (where the regex symbols have their usual meaning). I was asked to generate as many different kind of strings as possible for any given regex input."
- Since this question was a little vague, I asked what exactly the output should be, I was told to print 50 strings that matched the regex in the start but then eventually they asked to print as many different types of strings as possible. Before starting to write the code, you are asked to explain how are you going to approach this problem, so I broke it into two parts. First was tokenizing different symbols and storing them in a vector of vectors containing the [[symbol,modifier],[symbol,modifier]...] where symbols were 1,2,3,4 representing '\d','\w','$',^' and modifiers were 1,2,-1 representing '+','*',<absence of any modifier which means exactly one charachter> .
- I was told to first code only the tokenizing part which I did, and as I was doing it the recruiters were very supportive giving constant feedback and going as far as fixing some of my typos. I arbitrarily chose to make the strings with '1's and 'a's in order to simplify the question. Further I created a string vector res initialized it with one empty string . If the first symbol was not '^', I added 4 strings 'a','1','a1','1a' to the vector. I looped through the tokens vector (2d vector containing symbols, modifiers) and set appendVal equal to 'a' for \w and '1' for \d. Then for every string s in res -> if * was the modifier then added two more strings s+appendVal and s+(appendVal*2), for '+' -> modified s=s+appendVal and added s+(appendVal*2), if there was no modifier I just set s=s+appendVal. After looping through the entire tokens I checked for '$' at last element if it didnt exist then added s+'1a',s+'a',s+'1',s+'a1' to res vector.

The interviewers were satisfied. Then they asked me about the drawbacks of my approach and what test cases I didnt cover like other alphabets and longer strings. The interview ended with a little general chit chat and then they asked if I had any questions.

**I was informed I was shortlisted within 5 hours for the next round.**

__Round 3, Final Round (7 people shortlisted)__

__Round 3, Final Round (7 people shortlisted)__

It was conducted on the same day as round 2 (22nd August). The format was the same as of round 2. But the questions were more, and trickier. The interviewers for this time weren't as friendly as round 1 (maybe because mine was the last interview of the day) but they still corrected typos and gave suggestions as I coded. It was also scheduled for 1 hour but lasted a little longer.

This time they didnot waste much time in the intro and started straight with the questions. I was asked 3 questions -

- The gist was - Given an array of strings A, find the string with maximum length for which every prefix string existed in the array. Eg - For ['a','ab','abc',abcd','aaaaa','aabsd'] answer would be 'abcd' as 'a','ab','abc' exist in the array.
**Optimal Strategy for a Game****.**I gave the basic recursion solution first and before I could fix a few bugs and optimize the solution they were satisfied as they cared only if I understood the approach and gave me the next question.- It was a taxi problem, the gist was -> Given pickup points , drop points and tips array, every ith element represent a trip from pickup[i] to drop[i], which would earn the driver drop[i]-pickup[i]+tip[i]. And for every trip, the next pickup point should be greater than or equal to the last drop point. You have to return the maximum possible earnings of the driver.

I discussed the various possibilities and explained different approaches that can be taken, the interviewer gave some suggestions some good, some misleading to check how I respond. But after some discussion, I reached the conclusion that dynamic programming would be the way to go. The interviewers gave an expression as if they wanted to end the interview as it had already passed the time limit so I rushed the code, I explained what I'm doing as I wrote it, and explained the DP approach. My code was well structured but it gave segfault and before I could fix it they said that this much is enough for the interview and asked if I had any questions. I just asked for general feedback on my performance and how I could improve further.

I got a mail on 23rd (the next day) Morning from my college's placement cell that **2 people were selected and I was one of them !**