• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

DE Shaw interview questions

Joined
5/2/06
Messages
11,751
Points
273
Background info: D.E Shaw has a reputation of hiring only top mathematicians, researchers, etc.

"They have these really elitist-sounding recruiting philosophies, like, 'If you're brilliant we'll hire you,'" says one insider about D.E. Shaw's hiring process. Indeed, the firm founded by a Computer Science professor boasts that it includes a disproportionate amount of computer scientists and systems architects, and that it extends an offer to only one out of about 150 of the candidates it considers. It's even harder to get an offer at the firm these days than in boom times; insiders report that the firm is in a deep hiring freeze.
Source Excite -

Disclaimer: These questions and answers are provided as is. We do not take responsibility for any consequences resulted from using these answers during actual job interview.

The source of these info is taken from DE Shaw :: Programming Questions - I - The Nameless Blog

Part I: Programming

1. Swapping two variables x,y without using a temporary variable.
2. Write a program for reversing the given string.
3. The integers from 1 to n are stored in an array in a random fashion. but one integer is missing. write a program to find the missing integer.
4. Write a c program to find whether a stack is progressing in forward or reverse direction.
5. Write a c program that reverses the linked list.

C/C++:

1.
C++:
typedef struct{
       char *;
       nodeptr next;
       } * nodeptr;
what does nodeptr stand for?

2.
int *x[](); means
expl: Elments of an array can't be functions.

3. What is the output?
C++:
int i;
      i=1;
      i=i+2*i++;
      printf(%d,i);
ans: 4

4.
C++:
#include
      char *f()
      {char *s=malloc(8);
      strcpy(s,"goodbye")}
      main()
      {
      char *f();
      printf("%c",*f()='A');
What is the output

5.
C++:
FILE *fp1,*fp2;
      fp1=fopen("one","w")
      fp2=fopen("one","w")
      fputc('A',fp1)
      fputc('B',fp2)
      fclose(fp1)
      fclose(fp2)}
ans: no error. But It will over writes on same
file.

6.
C++:
#define MAN(x,y) (x)>(y)?(x):(y)
      {  int i=10;j=5;k=0;
      k= MAX(i++,++j)
      printf(%d %d %d %d,i,j,k)}

8. what is the output of
C++:
#include
      show(int t,va_list ptr1)
         {
         int a,x,i;
         a=va_arg(ptr1,int)
         printf("\n %d",a)
         }
         display(char)
         {int x;
         listptr;
         va_star(otr,s);
         n=va_arg(ptr,int);
         show(x,ptr);
         }
         main()
         {
         display("hello",4,12,13,14,44);
         }
a) 13 b) 12 c) 44 d) 14

9.
C++:
main()
       {
       printf("hello");
       fork();
       }

10.
C++:
main()
       {
       int i = 10;
       printf(" %d %d %d \n", ++i, i++, ++i);
       }

11.
C++:
#include
       main()
       {
       int *p, *c, i;
       i = 5;
       p = (int*) (malloc(sizeof(i)));
       printf("\n%d",*p);
       *p = 10;
       printf("\n%d  %d",i,*p);
       c = (int*) calloc(2);
       printf("\n%d\n",*c);
       }
12.
C++:
#define MAX(x,y) (x) >(y)?(x):(y)
       main()
       {
        int i=10,j=5,k=0;
         k=  MAX(i++,++j);
          printf("%d..%d..%d",i,j,k);
        }

13.
C++:
#include
       main()
       {
               enum _tag{ left=10, right, front=100, back};
               printf("left is %d, right is %d, front is
       %d, back is
       %d",left,right,front,back);
       }

14.
C++:
main()
       {
               int a=10,b=20;
        a>=5?b=100:b=200;
               printf("%d\n",b);
       }

15.
C++:
#define PRINT(int) printf("int = %d  ",int)
       main()
       {
       int x,y,z;
       x=03;y=02;z=01;
       PRINT(x^x);
       z<<=3;PRINT(x); > y>>=3;PRINT(y);
       }

16. what is the o/p of the program
main()
{
int rows=3,colums=4;
int a[rows][colums]={1,2,3,4,5,6,7,8,9,10,11,12};
i=j=k=99;
for(i=0;i

17. what is output
C++:
main()
      {int i=3;
      while(i--)
      {
      int i=100
      i--;
      printf("%d..",i);
      }
      }
a) infinite loop
b) error
c) 99..99..99..99
d) 3..22..1..
 
Part II Aptitude

1.
ONE RECTANGULAR PLATE WITH LENGTH 8INCHES,BREADTH 11 INCHES AND 2 INCHES THICKNESS IS THERE.WHAT IS THE LENGTH OF THE CIRCULAR ROD WITH DIAMETER 8 INCHES AND EQUAL TO VOLUME OF RECTANGULAR PLATE?
ANS: 3.5INCHES

2.
WHAT IS THE NUMBER OF ZEROS AT THE END OF THE PRODUCT OF THE NUMBERS FROM 1 TO 100

3.
in some game 139 members have participated every time one fellow will get bye what is the number of matches to choose the champion to be held?
ans: 138

4.
one fast typist type some matter in 2hr and another slow typist type the same matter in 3hr. if both do combinely in how much time they will finish.
ans: 1hr 12min

5. in 8*8 chess board what is the total number of squares refer odel
ans:204

6. falling height is proportional to square of the time. one object falls 64cm in 2sec than in 6sec from how much height the object will fall.

7. gavaskar average in first 50 innings was 50 . after the 51st innings his average was 51 how many runs he made in the 51st innings

8.
2 oranges,3 bananas and 4 apples cost Rs.15 . 3 ornages 2 bananas 1 apple costs Rs 10. what is the cost of 3 oranges,3 bananas and 3 apples
ans Rs 15.

9.
in 80 coins one coin is counterfiet what is minimum number of weighings to find out counterfiet coin

10.
in a company 30% are supervisors and 40% employees are male if 60% of supervisors are male. what is the probability that a randomly choosen employee is a male or female?

11.
THERE WERE 750 PEOPLE WHEN THE FIRST SONG WAS SUNG. AFTER EACH SONG 50 PEOPLE ARE LEAVING THE HALL. HOWMANY SONGS ARE SUNG TO MAKETHEM ZERO?
ANS:16

12.
A PERSON IS CLIMBING OF 60 MTS . FOR EVERY MINUTE HE IS CLIMBING 6 MTS AND SLIPPING 4 MTS . AFTER HOWMANY MINUTES HE MAY REACH THE TOP?
ANS: (60-6)/2 +1 :28

13.
SALARY IS INCREASED BY 1200 ,TAX IS DECREASED FROM 12% TO 10% BUT PAYING SAME AMOUNT AS TAX . WHAT IS THE PREVISIOUS SALARY?
ANS:6000

14.
THE LEAST NO. WHICH IS WHEN DEVIDED BY 4,6,7 LEAVES A REMAINDER OF 2 ?
ANS: 86

15.
A MAN DRIVING THE CAR AT TWICE THE SPEED OF AUTO ONEDAY HE WAS DRIVEN CAR FOR 10 MIN. AND CAR IS FAILED. HE LEFT THE CAR AND TOOK AUTO TO GOTO THE OFFICE . HE SPENT 30 MIN. IN THE AUTO. WHAT WILL BE THE TIME TAKE BY
CAR TO GO OFFICE?
ANS:25 MIN

16.
OUT OF 100 FAMILIES IN NEIGHBOUR HOOD , 55 OWN RADIO, 75 OWN T.V AND 25 OWN VCR. ONLY 10 FAMILIES HAVE ALLOF THESE, AND EACH VCR OWNER HAS TV . IF 25 FAMILIES HAVE THE RADIO ONLY, THE NO. OF FAMILIES HAVE ONLY TV ARE?
ANS: 30

17.
KYA KYA IS AN ISLAND IN THE SOUTH PACIFI . THE INHABITANTS OF KYA KYA ALWAYS ANSWER ANY QUESTION WITH TWO SENTENCES, ONE OR WHICH IS ALWAYS TRUE AND OTHER IS ALWAYS FALSE.
1. YOU ARE WALKING ON THE ROAD AND COME TO A FORK. YOU ASK ,THE INHABITANTS RAM.LAXMAN, AND LILA AS" WHICH ROAD WILL TAKE ME TO THE VILAGE?
RAM SAYS: I NEVER SPEAK TO STRANGERS. IAM NEW TO THIS PLACE
LAXMAN SAYS: IAM MARRIED TO.LILA. TAKE THE LEFT ROAD
LILA SAYS: IAM MARRIED TO RAM. HE IS NOT NEW TO THIS PLACE
ANS: LEFT ROAD TAKE YU TO THE VILLAGE

2. YOU FIND THAT YOUR BOAT IS STOLLEN. U QUESTIONED THREE INHABITANTS OT
ISLANDS AND THEIR REPLIES ARE

JOHN : I DIDNOT DO IT. MATHEW DIDNOT DO IT
MATHEW : I DIDNOT DO IT. KRISHNA DIDNOT DO IT
KRISHNA: I DID NOT DO IT; I DONOT KNOW WHO DID IT

ANS: MATHEW STOLEN THE BOAT

3. YOU WANT TO SPEAK TO THE CHIEF OF VILLAGE , U ASK THREE FELLOWS AMAR
BOBBY, CHARLES AND BOBBY IS WEARING RED SHIRT

AMAR : IAM NOT BOBBY`S SON ; THE CHIEF WEARS RED SHIRT
BOBBY : IAM AMARS FATHER ; CHARLES IS THE CHIEF
CHARLES : THE CHIEF IS ONE AMONG US; IAM THE CHIEF

ANS: BOBBY IS THE CHIEF

4. THERE IS ONLY OPNE POLOT IN THE VILLAGE(ISLAND). YOU INTERVIEWED THREEM MAN
KOISK ,LORRY AND MISHRA
U ALSO NOTICE THAT KOISK IS WEARING CAP.

M SAYS : LARRY IS FATHER IN THE PILOT .LARRY IS NOT THE PRIESTS SON
KOISK : IAM THE PRIEST ON THEIS ISLAND ONLY PRISTS CAN WEAR THE CAPS
LARRY : IAM THE PRIEST SON . KOISK IS NOT THE PREST

ANS : KOISK IS THE PILOT

18.
LCM OF 3 PRIME NO.S IS 1729. THE HIGHEST NUMBER AMONG THEM IS ?
A 13
B 19
C 23
D 11.

ANS 19

19.
A SHIP LEFT THE YARD AND TRAVELLED 180 MILES. NOW ANOTHER FLIGHT WITH 10 TIMES THE SPEED OF THE SHIP STARTED . WHEN BOTH WILL MEET?
ANS 200 MILES

20.
THE PRBABILITY OF HITTING A TARGET BY X IS 0.9 AND THAT OF B IS 0.8, THEN IF BOTH TRY WHAT IS THE PROBABILITY OF HITTING THE TARGET.
ANS 0.98.

21.
THE LENGTH OF THE ROPE IS 660M. WHAT IS THE MAXIMUM AREA COVERED BY THIS ROPE?
ANS 34650

22.
a MAN IS INCREASING HIS SPEED 5% EVRY hr ANOTHER INCREASES 1% IN 1ST AND 3% IN SECOND AND SO.ON WHEN THY MEET?

23.
A TAP CAN FILL THE TANK IN 10hrS,10 HOLES CAN EMPTY WITHIN 6hr, OF SAME CAPACITY 15 HOLES WHITH IN 6hr.if ALL OPERATE THEN THE TIME OF FILLING THE TANK.
 
Part III - Placement test

Aptitude:-
  1. What is the area covered in in 14 minutes by the minute hand of a clock of length 15 cm ?
  2. What is the diameter of a wheel if it covers 440 m in 1000 revolutions?
  3. There are 1 Re, 50 p, 25 p coins in the ratio 3:3:4 respectively. if the total amount is Rs.550, how many 1 Re coins are there?
    ans: 300
  4. if A can do 1/3rd of work in 4 days and B can do 1/6th of work in 3 days, then in how many days can both A and B complete the work.
    ans: 7 1/7 days
  5. if a number is divided by 935 remainder is 69. if same no. is divided by 38, what will be the remainder?
    ans: 29
  6. if a tank is filled by 10 pumps, it takes 12 hours. if the same tank is filled by 15 pumps, then it will take 6 hours. how much time will it take to fill the tank if 25 pumps are used?
  7. what is the probability of having b'days of 2 persons on the same day in a gathering of 50 persons?
  8. how many words can be formed by the letters of the word DELCIOUS starting with D and ending with E?
    ans: 6! = 720
  9. if a man works for 3 hours he gets Rs.15 + 1 meal. if he works for 12 hours he gets Rs.90 + 2 meals. what is the cost of a meal?
    ans: Rs.15/-
  10. if a tank can be filled by pipe A in 24 mins and by pipe B in 32 mins. if A and B both are open, when should B be stopped to fill the tank in 18 mins.
C Programming
1.
C++:
typedef struct{
char *;
nodeptr next;
} * nodeptr;
what does nodeptr stand for?

2. supposing thaty each integer occupies 4 bytes and each charactrer
1 byte , what is the output of the following programme?

C++:
#include
main()
{
int a[] ={ 1,2,3,4,5,6,7};
char c[] = {' a','x','h','o','k'};
printf("%d\t %d ", (&a[3]-&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;a[0]),(&c[3]-&c[0]));
}
ans : 3 3

3. what is the output of the program?
C++:
#include
main()
{
struct s1 {int i; };
struct s2 {int i; };
struct s1 st1;
struct s2 st2;
st1.i =5;
st2 = st1;
printf(" %d " , st2.i);
}

ans: nothing (error)
expl: diff struct variables should not assigned using "=" operator.



4.what is the output of the program?

C++:
#include
main()
{
int i,j;
int mat[3][3] ={1,2,3,4,5,6,7,8,9};
for (i=2;i>=0;i--)
for ( j=2;j>=0;j--)
printf("%d" , *(*(mat+j)+i));
}

ans : 9 6 3 8 5 2 7 4 1
 
Wow these guys know cricket... Gavaskar is a famous Indian cricket player Q7 in Part II aptitude test. :) ..
thanks andy for the test
 
Andy did you interview at D.E. Shaw?
No. these are questions I found online. here is another one

[D. E. Shaw, a financial firm in NYC] You and a friend are trying to perform the following "magic" trick. Your friend leaves the room. You hand a standard deck of 52 cards to someone in the audience. The audience member chooses any five cards from the deck and hands those five cards to you.
Now, you must select one of these cards to keep concealed from your friend, and you must display the other four cards side-by-side on a table

Your friend now enters the room, examines the only the four displayed cards, and then tells the audience what's on the concealed card. (Whoa -- what a neat trick!)

Can you and your friend come up with a scheme so that, based solely on the four displayed cards, the fifth card can always be determined?
 
I think there should be a way.

With 4 cards on the table, we are left with 48 in the deck for the friend to guess from. If we agree on seniority of the cards (dimonds => hearts => spades => clubs), we can use the 4 cards on the table as fixed letters A, B, C, D. There are 24 permutations of letters A, B, C, D. If we are to put them horizontally or vertically, it would add anoter 24+24 = 48 ways. Now recalling the seniority of the cards, we find the number from 1 to 48 corresponding to our card and arrange the permutation so that the permutation tells which of the 48 combinations we pick.

For example, the card I have is SQ, and the four others are DQ, H7, H9, CK. Sorted by seniority, they correspond to letters A=DQ, B=H7, C=H9, D=CK.
My SQ card is the 37th in the sequence of 52, but with 4 removed, it is 34th in the sequence of 48. 34 is #10 in the second sequence of 24.
So let the first 24 be horizontal position, and the second 24 be vertical position of my 4 cards.
Now let say we've agreed on the following permutations of A, B, C, D.
A B C D
A B D C
A C B D
A C D B
A D B C
A D C B
B A C D
B A D C
B C A D
B C D A
B D A C
B D C A
C A B D
C A D B
C B A D
C B D A
C D A B
C D B A
D A B C
D A C B
D B A C
D B C A
D C A B
D C B A
Now that my card is encoded as B C D A , I arrange the four cards as H7, H9, CK, DQ vertically on the table, my friend can reverse-engineer my code :)
 
Are these the interview questions for the quant positions only? I'm gonna get an interview with these guys for a securities trading position and I'm really nervous! :cry:Are these questions an accurate representation of the real interview?

The programming questions look tough (I have close to zero programming experience other than a CS51 course I took in my sophomore year), but the aptitude questions here look surprisingly easy. However, I think I may need a calculator on a few of them (is that allowed?).
 
Part III - Placement test

Aptitude:-
  1. What is the area covered in in 14 minutes by the minute hand of a clock of length 15 cm ?
  2. What is the diameter of a wheel if it covers 440 m in 1000 revolutions?
  3. There are 1 Re, 50 p, 25 p coins in the ratio 3:3:4 respectively. if the total amount is Rs.550, how many 1 Re coins are there?
    ans: 300
  4. if A can do 1/3rd of work in 4 days and B can do 1/6th of work in 3 days, then in how many days can both A and B complete the work.
    ans: 7 1/7 days
  5. if a number is divided by 935 remainder is 69. if same no. is divided by 38, what will be the remainder?
    ans: 29


Something is not right with #5 ... or I just don't understand it correctly ... The way I understand it there is a number (N=935k+69) - some possible values are 69, 1004, 1939, 2874, ... If it is divided by 38 the reminders will vary. For 69 it is 31, for 1004 it is 16, for 1939 it is 1. So what is 29? Did I miss something?
 
Yeah I think it'd make more sense if the question was a = 69 mod 935 = r mod 38 (r some integer like 69), find a.
 
10.
main()
> {
> int i = 10;
> printf(" %d %d %d \n", ++i, i++, ++i);
> }

The answer to this one is
13 11 13

But I can't figure out why? Any ideas?

I know the arguments are pushed onto the stack in reverse order, but I haven't been able to figure out anything else.
Thanks!
 
The answer to this one is
13 11 13

But I can't figure out why? Any ideas?

I know the arguments are pushed onto the stack in reverse order, but I haven't been able to figure out anything else.
Thanks!

First of all, the answer is undefined here. While it may produce the results you mentioned, it's not guaranteed on different systems/compilers/etc.

My guess would be:

1. i is initialized to 10 upon definition
2. There is a buffer where both incremented variables are stored (for postfix and prefix).
3. prefix is incremented twice (since there are two ++ prefix operators in the argument list) and postfix is incremented once
4. printf is evaluated. The first argument that is pushed is the last on the list, and it happend to be prefix, so we push 13.
5. The second argument contain postfix operator, so "the other i" is pushed which is 11.
6. The last 13 is pushed as before.

So in the end we pop, 13, 11, 13. And here is the output....

Again, as far as I know, this behavious is undefined, and even some compilers will give you the warning.
 
Let n denote a positive integer and let f(n) denote the number of consecutive zeros at the right end of n! expressed in base ten. Explicitly express f(n) in terms of n, and find limit of f(n)/n as n approaches infinity.
 
Here are some questions I got from a Google book.

....1
...11
...21
...1211
111221

Give me the next row in this sequence.

WWWDOT-GOOGLE=DOTCOM. If you can substitute the values for M and E, find the solution to this equation (no leading zeroes).

Let f(n) denote the number of ones written if all positive numbers before, and when n are written. For instance, f(13)=6. (1, 10, 11, 12, 13). Notice that f(1)=1. Find the next largest number such that f(n)=n.

Edit: here's where I got it from: Cruft: GLAT - Google Labs Aptitude Test
 
What interview questions did D.E. Shaw ask Larry Summers?

As director of the president's National Economic Council, Larry Summers is currently facing the world's biggest math problem. It was encouraging, therefore, to read in Monday's New York Times that, when he applied for a job in 2006 with investment firm D.E. Shaw, "Mr. Summers was asked to solve math puzzles. He passed, and the job was his."

It's hard to imagine Summers being subjected to the same brainteasers that entry-level quants have to answer. And a White House spokesperson confirmed that it wasn't the same series of questions. But he did have to answer analytical reasoning problems asked by a member of the company's executive committee. What kinds of questions does D.E. Shaw ask?

The New York-based firm is known for its rigorous, numbers-heavy interview process. Most applicants have sterling academic backgrounds. The goal, therefore, is to see if the person can apply the concepts he learned in school to the real world. "The question is, 'Can they get past their white papers?' " says Richard Rusczyk, a former D.E. Shaw trader who conducted dozens of interviews over four years at the firm.

The type of questions most interviewers ask—and those D.E. Shaw is known for—are those with no right answers. Here's an example:

Ten people are bidding on a stock at 90, while 100 people are offering to sell it at 91. What price is the next trade?

Interviewees often say that since there are more sellers than buyers, the sellers get to determine the price. That logic usually yields an answer between 90 and 91. That's exactly wrong. "They're not thinking about what's going on in the real world," says Rubczyk. In reality, when there are more sellers than buyers, the price falls. So the next sale would probably be in the mid- to low 80s.

"Some candidates would say you can't answer that question, because there's no formula," says Rusczyk. "If that makes their heads explode, that's a problem."

The next level of difficulty is the type of question with no answer at all. One such question, which Rusczyk has asked, is the famous St. Petersburg Paradox:

There's a dollar on the table. I'm going to flip a coin. If it comes up heads, I'll double the money. If it comes up heads again, I'll double it again. Whenever it comes up tails, we stop.

But there's a catch: You have to pay a fee to play. How much are you willing to pay?


The answer: infinity. You should theoretically be willing to pay any amount, since the probability on any given flip is that you win 50 cents. (On the first flip, $1 x 1/2 = $0.50. On the second flip, $2 x 1/4* = $0.50. On the third, $4 x 1/8 = $0.50. And so on.) So the potential winnings extend infinitely.

Of course, you can't offer the guy infinity dollars. So the interviewee is forced to either settle on a real world number—as much as the player can afford—or delve into marginal utility theory. Either way, the interviewer gets a sense of how the person's mind works. (This answer is understandably baffling to most people. See philosopher Ian Hacking wrestle with it here.)

The most difficult question of all is the kind that the interviewee must first get wrong before he can get it right. Rusczyk described a question in which the interviewer first explains the concept of a call option. (That's when you have a right but not an obligation to buy a stock.) He then asks a series of six or seven questions about the call option's price based on different market scenarios. The point is to create situations where academic math tells you to do one thing but the market tells you to do another. The ideal candidate follows the market. Eventually, you get to a stage where everyone gets the question wrong. "Then you ask them a leading question, after which they realize their last answer was wrong," says Rusczyk. "They'd then say, 'Where did I go wrong?' "

During his tenure at D.E. Shaw, only three candidates Rusczyk interviewed made it to the last question. "One is a partner [at D.E. Shaw], one took a professorship at Harvard, and one is in business," he says.

Rusczyk argues that these questions, while hypothetical, are very relevant to our current economic challenges. "Within financial markets, one of the big failures was assuming all these mortgages were more or less uncorrelated based on historical data," he says. In other words, models didn't take into account the possibility that housing prices would not keep trending up indefinitely. "That's kind of what the St. Petersburg Paradox is about. Theoretically, [the game] is worth an infinite amount of money. But in the real world, it's not worth infinity."

If the point of D.E. Shaw interviews is to make sure the person can repurpose academic models for the real world, their methodology might serve the Obama administration well. In the meantime, here's another one for Summers:

x = the economy

x + y = the economy not all screwed up

Find y.


What interview questions did D.E. Shaw ask Larry Summers? - By Christopher Beam - Slate Magazine
 
Back
Top