# Internships Interview Questions

Internships interview questions shared by candidates

## Top Interview Questions

How do you determine the risk profile of a company? 1 Answerfinancial statements, cash flows, financial ratios, historic events and company developments |

### Procurement Internship at Wrigley was asked...

Your supplier ran out of resin and you have a delivery to a customer today. What do you do? How would you improve this package? Name three cost savings that could be made to this package? 1 AnswerCall supplier ask why they ran out of resin and get name of vendor the supplier purchases resin from . Place a resin order with suppliers vendor @ their cost or @ an even lower cost and ask what action they are to take to prevent this on future resin orders. Due to inventory discrepancy @ supplier negotiate the below cost supplier should agree with. 1) purchase from suppliers vendor @ supplier cost 2) supplier responsible for freight bill 3)Supplier pay cost for same day delivery fee to expedite |

Flip a coin until either HHT or HTT appears. Is one more likely to appear first? If so, which one and with what probability? 13 AnswersLet A be the event that HTT comes before HHT. P{A} = P{A|H}P{H} + P{A|T}P{T} = .5P{A|H} + .5P{A|T} P{A|T} = P{A} therefore, P{A|H} = P{A|T} P{A|H} = P{A|HH}P{H} + P{A|HT}P{T} = (0)(.5) + P{A|HT}(.5) Therefore, 2P{A|H} = P{A|HT} P{A|HT} = P{A|HTT}P{T} + P{A|HTH}P{H} = (1)(.5) + P{A|H}(.5) 2P{A|H} = .5 + P{A|H}(.5) P{A|H} = 1/3 and P{A|H} = P{A}, therefore, P{A} = 1/3 So, HHT is more likely to appear first and it appears first 2/3 of the time. P{A|H} = P{A|HH}P{H} + P{A|HT}P{T} = (0)(.5) + P{A|HT}(.5) Need help - - why is P{A|HH} = 0 ? P(A|HH) = 0 because after a sequence of consecutive heads, you can no longer achieve HTT. The moment you get a tail, you will have the sequence HHT. This the reason HHT is more likely to occur first than HTT. Show More Responses P(A|HH) = 0 because after a sequence of consecutive heads, you can no longer achieve HTT. The moment you get a tail, you will have the sequence HHT. This the reason HHT is more likely to occur first than HTT. HHT is more likely to appear first than HTT. The probability of HHT appearing first is 2/3 and thus the probability of HTT appearing first is 1/3. Indeed, both sequences need H first. Once H appeared, probability of HHT is 1/2 (b/c all you need is one H), and probability of HTT is 1/4 (b/c you need TT). Thus HHT is twice is likely to appear first. So, if the probability that HTT appears first is x, then the probability that HHT appears first is 2x. Since these are disjoint and together exhaust the whole probability space, x+2x=1. Therefore x=1/3. You guys seem to be mixing order being relevant and order being irrelevant. If order is relevant (meaning HHT is not the same as HTH) then this has a 1/8 of occuring in the first 3 tosses. Also HTT has a 1/8 chance of occurring in the first 3 tosses, making them equally likely. Now, if order is not relevant. (so HHT and THH are the same), then this has a (3 choose 2) * (1/8) probability of happening in the first 3 tosses. The same goes for HTT (which would be the same as THT etc and others) so this has a (3 choose 2) * 1/8 probability of happening in the first 3 tosses as well. Either way they come out to being equally likely, please comment on my mistake if I am doing something wrong. Ending up with HHT more likely (with probabilty 2/3). HHT is more likely (2/3) probability. People with wrong answers: Did you not Monte Carlo this? It takes 5 minutes to write a program, and you can then easily see that 2/3 is correct empirically. I don't get it. Shouldn't P{A|HH} = P{A} in the same sense that P{A|HTH} = P{A} from both HH and HTH we have get the first H from HTT and so it should be P{A|HH} = P{A|HTH} = P{A} Am i wrong? sorry, i meant: I don't get it. Shouldn't P{A|HH} = P{A|H} in the same sense that P{A|HTH} = P{A|H} from both HH and HTH we have get the first H from HTT and so it should be P{A|HH} = P{A|HTH} = P{A|H} Am i wrong? Above link is the best solution I have seen for this problem http://dicedcoins.wordpress.com/2012/07/19/flip-hhh-before-htt/ Apologies, Below* Here's my answer. Let x = probability of winning after no heads (or a tail). y=probability after just one heads. z=probability after two heads. w=probability after HT. Thus x=(1/2)x+(1/2)y, y=(1/2)z+(1/2)w, z=1/2 + (1/2)z, w=(1/2)y. Therefore, z=1, y=2/3, w=1/3, x=2/3. We wanted x at the beginning, so it is 2/3 that HHT comes up first. |

Determine whether the binary representation of a number if a palindrome or not, code it on a white board. 13 AnswersThis was the first question I was asked and is considered a warm up. public static boolean isPalindrome(int someInt) { final int WIDTH = 8; boolean isPalindrome = true; for (int i = 0; i < WIDTH && isPalindrome == true; i++) { int maskLower = (int) Math.pow(2, i); int maskUpper = (int) Math.pow(2, WIDTH - (i+1)); boolean bitLowerOn = ((maskLower & someInt) == maskLower) ? true : false; boolean bitUpperOn = ((maskUpper & someInt) == maskUpper) ? true : false; isPalindrome = bitLowerOn && bitUpperOn && isPalindrome || !bitLowerOn && !bitUpperOn; } return isPalindrome; } anon.. would this work for a number like 17 (10001)? Show More Responses bool checkPalindrome(unsigned int n) { int m = n, k =0; bool ret = false; while(m!=0) { int i = 1; i = i & m; k = k > 1; } if((k^n)==0) { cout<<"Palindrome"< I have a simple solution. Reverse the bits one by one and test equality of the two resulting numbers. (Matlab code) function [r] = isPalindrome(a) n = a; m = 0; while(n>0) m = bitshift(m, 1); m = m + mod(n, 2); n = bitshift(n, -1); end r = (m==a); end public static boolean isPalindrome(int n) { int nb = 0, nl=n; while(nl>0) { nb=(nb>1; } return nb==n; } @john/catalin4ever, i think it'll fail because it doesn't concat the 0s. For example: if the input is 0110, then after execution "nb" becomes to 0011. this is because of the condition: while(nl>0) Ask interviewer if they want the MSB that is a 1 to dictate the bit range to check, have it given as a parameter, or assume sizeof(T)*8 perhaps. Little details and extras like this can make a difference to them. public static bool CheckPalindrome(uint n) { return CheckPalindrome(n, 0); } unsafe public static bool CheckPalindrome(uint n, int bits) { if (bits == 0) { // Determine bits to check as the MSB having a 1 uint temp = n; while (temp != 0) { ++bits; temp >>= 1; } } uint m1 = (uint)1 > 1; i > 0; --i) { if (((n & m1) != 0) ^ ((n & m2) != 0)) { return false; } m1 >>= 1; m2 <<= 1; } return true; } Examples: BitOps.CheckPalindrome(17, 0) is true BitOps.CheckPalindrome(17, 8) is false BitOps.CheckPalindrome(0xABD5, 0) is true BitOps.CheckPalindrome(0xABD5, 16) is true BitOps.CheckPalindrome(0x5BDA, 0) is false BitOps.CheckPalindrome(0x5BDA, 16) is true string binary; int start=0, int end= binary.length -1; while(start < end) { if (binary[start] == binary[end]) { start ++; end- -; } else return false; } return true; int isPalindrome( int num ) { int x = num & num; return ( x == num ) ? 1 : 0; } /* function declaration goes here.*/ int isPalin(int orig); int main() { int x = 9; int i = isPalin(x); printf("i = %d \n", i); } int isPalin(int orig) { int copy = orig; static int reversed = 0; while(copy!=0) { reversed >= 1; } return (reversed == orig); We can compare the leftmost and rightmost bits by left shifting and right shifting the bits and also by getting rid of those bits . If the binary number is a palindrome, the left and right bits should be equal. Here is a C# implementation of the above logic static bool IsBinaryPalindrome(byte num) { int i = 0; while (true) { i++; bool right = false, left = false; byte origNo = num; if (((num > i) != origNo) { left = true; //left most bit contains one } num >>= i; //putting the right bit back in its original position origNo = num; if (((num >>= i) << i) != origNo) { right = true; // right most bit contains one } num <<= i; //putting the left bit back in its original position if (left != right) { return false; } if (num == 0 || num == 1) break; } return true; } python one-line need to replace the the 0b >>> str(bin(255).replace('0b',''))==str(bin(255).replace('0b',''))[::-1] True |

### Quant Internship at Jane Street was asked...

You have 100 marbles, 50 are blue, 50 are red. You want to distribute them between two drawers, in such a way that none is left outside and no drawer is left empty. After distributing them you are gonna select a drawer randomly and from that drawer you are gonna remove one marble randomly. How do you distribute the marbles in such a way that the probability of getting a red marble is maximized? 6 AnswersPut one red marble in one drawer and all the others in the other drawer. It doesn't matter how you distribute the marbles. The fact that they are split into two drawers doesn't affect the sample space. The probability of choosing either draw is 1/2 (i.e. the same). The first answer is correct. Say you put one red marble in drawer 1, and drawer 2 has 24 red and 25 blue. The chances of choosing drawer 1 and a red marble are .5 or 49/98 since all the marbles are red in drawer 1. The chances of choosing drawer 2 and a red marble are .5*(24/49) so 12/49 or 24/98. The total chances of choosing a red marble in this case are 73/98, much higher than 1/2. Show More Responses In drawer #1: 1 RED 0 BLUE In drawer #2: 49 RED 50 BLUE 50% chance of selecting drawer #1 - where there is a 100% chance of selecting RED = .5 * 1.00 = .5 50% chance of selecting drawer #2 - where there is a 49/99 or .4949% chance of selecting RED = .5 * .4949 = .2474 .5 + .2474 = .7475 Stephen is correct. The answer is indeed 1/2*(1/1) + 1/2*(49/99) = 1/2*(148/99) = 74/99 = 74.75%. "P" has the right approach but has assumed the wrong number of marbles, as there should be 100 marbles in total, not 50 :) Here's a really intuitive way to see derive the solution without any actual math. You can obviously achieve 50% odds by putting all the red marbles in one drawer and all the blue marbles in the other. If you were to take a blue marble from the blue drawer and put it into the red drawer, then you slightly decrease the odds overall. Conversely, if you were to take a red marble from the red drawer and put it into the blue drawer, then you slightly *increase* the odds overall, since if you pick the red drawer you still have a 100% chance (at that point) of getting a red marble, and if you pick the blue drawer you now have a nonzero chance of getting a red marble. Repeating this, we arrive at the optimal solution posted by others: one drawer should contain one marble while the other drawer should contain all other marbles. |

We each flip three fair coins. I offer to pay you $1 if we do not get the same amount of heads, if you agree to pay me $2 if we do (get the same amount of heads). Will you agree to play this game? 5 AnswersPlay the game. EV = 1/16. Screwed up again, EV is -1/4, don't play Agreed. EV is - 0.25 Show More Responses would you mind sharing the math behind the answer Rob. Thank you 1/2^6 + 9/2^6 + 9/2^6 + 1/2^6 = 20/64 the probability to get same number of heads. Expected value : 20/64 X (-2) + 44*/64 * (1) = 1/16 play the game |

How many digits are there in 2^50? 5 Answerslog2(2^50) / log2(10) = 50 / 3.3 ~= 15 2^50 / 10 = 16 * 2^46 *1.6 16 digits: 2^50 = (2^10)^5 = 1024^5 Show More Responses every 3 powers of 2 the number of digits increases by 1. 50/3 = 16.67, so there are 16 digits. With these brain teasers, is it allowed to use scratch paper? Is there a favored approach between trying to work quickly and mentally as opposed to thoroughly and methodically? I can see the pro's and con's of both, and I'm just curious whether I should practice one way or another. |

What is your favorite financial statement and why. 3 AnswersCash flow Standard Model He expected future financial changes 10-K Let's just say he didn't like my answer. |

You have two decks of cards, one normal 52-card deck and one 104-card deck with double every card. Is one deck better than the other if you wanted to get two black cards in a row? 3 AnswersYes, you would want to choose the 104-card deck. With 52-card, probability is 12/204, with 104-card, probability is 25/412. The latter one is bigger 104 card deck has higher probability. For 104 cards: (52/104)*(51/103) = 0.24757 For 52 cards: (26/52)*(25/51) = 0.245098 |

### Software Engineer Internship at Amazon was asked...

How would you count the number of words in a string consisting of uneven number of spaces between words( not dictionary words)? With and without library functions. 3 AnswersWith -Use Java String Tokenizer or split function int wc(char *s) { if (!s) return -1; int wc = 0; /* prune initial continuous spaces */ while (*s == ' ') ++s; /* count spaces, i.e words! */ while (*s != '\0') { if (*s == ' ') { ++wc; s++; /* prune continuous spaces */ while (*s == ' ') ++s; } else ++s; } /* sentence can end without space, check last word has been accounted */ if (*(s-1) != ' ') ++wc; return wc; } char str[] = "jdjd jdjd jriri"; count=0; for(i=0; i<=strlen(str); i++) { // str[i] while(str[i]==' ') { i++; } count++; while(str[i]!=' ') { i++; } } |

**1**–

**10**of

**6,320**Interview Questions

## See Interview Questions for Similar Jobs

- Accountant
- Mechanical Engineer
- Engineering
- Human Resource
- Administrative Assistant
- Account Executive
- Marketing
- Healthcare
- Cashier
- Dental Assistant
- Hospitality
- Truck Driver