3/03/2012

Interviews I have been gone through

Since last semester I have been applying for summer internship of software development. Companies I was interviewed included Amazon, Google, Morgan Stanley, Bloomberg, Epic, Robustlinks (startup), Moonlyt (startup), Douban. And I think I am still waiting for more company interviews in the following weeks.

Right now I only have offers from the startups and was rejected by all the larger scale companies. And in the following part I will explain all the interview process from big firms and how I regard each firm. Also some thoughts about why I didn't get the offers.

1. Amazon
I applied Amazon in Oct 2011. I got two phone interviews and after two or three weeks I got the third one. A week later I was told rejected.

Questions in the first interview:
What's a Hashmap? How to make a good Hashmap?
Given the pre-order and in-order array of a tree. Can you represent the tree without knowing the elements inside the array?

Question in the second interview:
We have a chess grid (table) which is 8x8, we’ll index the cells from 0 to 7 both vertically and horizontally :
(0,0) is the  top left
(7,7) right bottom and our "target"

An ant is situated in the top left corner (0,0) and she needs to reach the bottom right corner (7,7).

The ant can only move forward to the target , one square at a time either horizontally or vertically.

More formally, the ant can move either:
from       (i,j)  -> (i+1, j)  if    i+1 <= 7
or from    (i,j ) -> (i, j+1)  if     j+1 <= 7
1) write a program that will display all possible paths to the standard output.
2) How many paths there are ?

Questions in the third interview:
1. Sum up all the prime number from 1 to 100.
2. Asked me about what is polymorphism, what is encapsulation.

It's way too early at that time as my English is not that fluent and I haven't prepared for anything. Thus the first interview is a mass and I totally have no idea how Amazon ask questions and what I should be answering.

2. some technical company
Applied in November. Got two phone interview in the same day of early December. Got rejected the next day.

First interview:
1. write function in Java which takes an array as a number, and return the increment of the array by one.

eg.
[2,4,7] -> [2, 4, 8]
[1, 0 , 0 , 3] -> [1 ,0 ,0,4]
[4,5,9] -> [4,6,0]
[1, 9 , 9] -> [2, 0 , 0]
[9,9] -> [1,0,0]



2. You have machine with limited amount of memory: 1024 bytes.
Write the longest running program - which will terminate at some point.
long = as much time as possible

What's the running time of your code? How can you proof your code to have the longest running time?

Second interview:
1. What's the function of the following code? And does it have any bugs?

public class Generator {
 private static final Map<byte[], byte[]> cache = new HashMap<byte[], byte[]>();

 
 public static byte[] generate(byte[] src) {

   byte[] generated = cache.get(src);
   if (generated == null) {
     synchronized (cache) {
       generated = cache.get(src);
       if (generated == null) {
         generated = doGenerate(src);
         cache.put(src, generated);
       }
    }
  }
 return generated;
}

private static byte[] doGenerate(byte[] src) {...}
}

2. Write code for the Fibonacci function.

3. Morgan Stanley
Applied through careerNet. Got oncampus interview. And was rejected several days later.
Questions are pretty general. Not much technical questions.


4. Bloomberg
1. Why bloomberg?
2. Discussed something about differences between Java and C++, then talk about JVM
3. Given a number and a base, return 转换后以那个该进制的数。
eg. number is 5, base is 3, then then return 12
4. You have three baskets with fruits inside and with tags outside. One of them has apple, one has orange and one has both. Now you know they are definitely tagged mistakenly. You can pick up as many fruits as you want. How many times do you have to pick the fruits to determine the fruits in the baskets.

2 comments: