D.E.Shaw CodePair Round | off-campus
- Posted
- 30 Jul 2021
Summary
I recently went through an off-campus CodePair round interview with D.E.Shaw, which was conducted on Hackerrank and involved a variety of coding, technical concepts, and a puzzle.
How it went
The CodePair round for D.E.Shaw was an off-campus interview conducted on Hackerrank. It started with a challenging coding problem that required careful thought. Following the coding task, I was presented with several conceptual questions covering fundamental programming differences and system design considerations. The round concluded with a well-known logic puzzle.
Questions asked (5)
- 01
Smallest Subarray with Max Frequency Element
Data Structures & Algorithms · Medium
Given an array, A. Let x be an element in the array. x has the maximum frequency in the array. Find the smallest subarray length of the array which also has x as the maximum frequency element.
e.g. Input : arr[] = {4, 1, 1, 2, 2, 1, 3, 3} Output : 5 The most frequent element is 1. The smallest subarray that has all occurrences of it is 1 1 2 2 1 - 02
Difference between #include<stdio.h> and #include "stdio.h"
Other · Easy
Explain the difference between
#include<stdio.h>and#include "stdio.h"in C/C++. - 03
Difference between Definition and Declaration
Other · Easy
Describe the difference between definition and declaration in the context of any programming language.
- 04
Divisibility Check on Infinite Bit Stream
Data Structures & Algorithms · Medium
There is an infinite stream of bits (0/1) coming. At each bit, you need to check whether the number formed from bits till that point is divisible by a given N or not. How will you approach this problem? You cannot store the entire stream anywhere as it is infinite.
e.g. N = 14 stream = 10101100100010001010010.....
We need to answer at each bit coming from left to right. - 05
Camel and Bananas Transport Puzzle
Other · Medium
A person has 3000 bananas and a camel. The person wants to transport the maximum number of bananas to a destination which is 1000 KMs away, using only the camel as a mode of transportation. The camel cannot carry more than 1000 bananas at a time and eats a banana every km it travels. What is the maximum number of bananas that can be transferred to the destination using only the camel (no other mode of transportation is allowed)?