San Fransisco Onsite surface by

Source: Internet
Author: User

Tag: Dropbox Uber Twitter onsite

To San Francisco, Dropbox,uber and Twitter, mainly infrastructure's new grad position.


Dropbox:

The deep-pocketed Dropbox, a dream company, can claim $90 a day, the highest I've ever had, and an extra day at the hotel and the expense of 100 of knives for sightseeing. HR is also very attentive to list a lot of attractions for play. Inside the work environment is great, canteen good, white proportion high, because by the sea, view is good, you can see the seaside sunset.

One thing to note is that after the code is written, many people will take a picture, so the code is still written neat a bit better, this is not known at the beginning, the handwriting is a bit bad.

The first round asked the behavioral and the questions.

The second round is game of life, a two-dimensional array in which each element lives and dies, and the state transitions according to the conditions of the surrounding elements. Follow up is a large file operation, not an in-memory array. Basically belong to the pure implementation of the topic, very simple.

The third round implements the web crawler. Follow up is an asynchronous implementation of Web crawling and page parsing. In fact, it is asynchronous implementation of BFS. I used three queue to achieve, except for a self-bfs need to queue, another two blockedqueue, do not know right.

The fourth round implements two functions, int allocate () and void Release (IntID), and each call to allocate returns an ID that needs to be unique, an integer between 1 and N. If you release it, you can continue to be allocate. Before using Array+hashmap to reach O (1) Time and O (N) space. Later was told that the space used too much, map space efficiency is low, and finally used bitmap. This problem in fact and the implementation of the file system of the metadata area is similar, but in the end is to use time to change space, a bit surprised me.

Fifth Wheel System design: For distributed servers, get a time series that summarizes the various information for each server. Very open-ended, anyway, the various system design principles are used on the line.

Added to eat a total of 6 hours, there are some problems do not remember ...


Uber:

The biggest feeling is that the company's expansion is very strong, but the improvement of the system and the renovation of the facilities have not been followed, many places are immature. In fact, the interview process is not very normative, but also asked to bring their own laptop. Feel because of the rapid IPO, forcing lattice is very high, the topic is more difficult than flag.

The first interviewer is branded, feels unfriendly, and begins to discuss the project experience at the time of the various disapproval. Then 40 minutes to ask four questions, there is no time to finish. The first question is Leetcode, next permutation, second. But the brand was a suspicion of my thinking, and later it took a lot of effort to persuade. The second problem is to implement a hash map, indicating that the method should be used chaining, CC150 should have, also the second. The most wonderful thing is, just started to write a part of the code, and later branded that I am not good code typesetting, so I wiped, the middle of a line, let me use double-column typesetting rewrite. (In total there is only a very narrow vertical white board, the whiteboard above 1/3 of the space is actually wasted, because the hand can not reach). Reluctantly, it took some time to rewrite the code. Then let me achieve concurrent map, a bit to achieve the reader writer's problem feeling, no time to finish writing. 5 minutes left to ask how to implement the load factor under the chaining mechanism, it is not, but found that the answer is tricky. In fact, three elder brother also came in one months, feel good to coax, do the problem of the time has been in the side of the finger, such as algorithm design when the beginning is easy to declare some superfluous parameters, and so on the topic explored in fact often also at a glance, nature will be removed, but three brother halfway to say that a parameter is not necessary, Seriously affected the fun and continuity of their own exploration problems. In addition, I also seriously doubt if he does not look at the mark answer, whether it is possible to begin to know that a parameter is the last unnecessary,

The second person on a topic, feel very difficult, think for 40 minutes to come up with a solution. Requires the design of a data structure that satisfies the insert (int key), remove (int key), and int Getmostfrequentkey (). For the same key, each time the insert, the count is added 1, each time the remove, the count minus 1, and then need to take the maximum count of key. All operations are required to be O (1) complex.

This is done by trying to rule out map+maxheap combinations and then Lenovo streaming Max. After prompting the data structure needs to maintain a partial ordering nature (if guaranteed to be fully sorted, the insert delete operation is not possible O (1)). Considering that count is an integer, I think of the bucket sort, in addition to the LRU design idea (doubly linked list + hash map), the following structure is designed:

Class Node {

int key;

int count;

}

Class Bucket {

set<node>set; All the nodes with equal count.

Bucket prev;

Bucket Next;

}

Bucket Head;

Hashmap<integer:key, node:node>

Although the solution proved to be feasible, it always felt that its design was a bit too complex. After finishing this problem, the mental waste goes to half ...

The third round of design a game, from the beginning to the end there are two non-coincident length of the same path, each step along the current path, need to spend a certain amount of energy, if you switch to the same location of another path, also need to spend some energy. You can only move forward or switch paths at a time, requiring you to print a path that consumes the least amount of energy. In fact, is a general difficulty DP problem, but this age also test DP really not much. Later, functional programming was discussed, requiring a linked list and a filter function pointer to output a new linked list of filter, which can only be written recursively. Actually iterative turn recursive also not difficult. Then talk to me about the parallel implementation of Kmeans, and then let me guess another clustering algorithm. I guess hierarchical clustering and density-based, the result is not guessed right, finally told me is to let me answer em algorithm. Kuanghan, I didn't put EM in the clustering category. Finally, I talked about the maximum likelihood estimate. Statistical aspects of things themselves do not understand, some depressed: their face infrastructure team, but this goods how always to machine learning chat it? This new Grad request is too comprehensive ...

The four people mainly talk about whether the background and team match, the topic only a power set, is finally relaxed.


Twitter:

The problem is not difficult, there is not much detail here.

1. Variant of prime number problem.

2. A variety of sampling problems, big data, distributed.

3. Leetcode Original title: Clone alinked list with random pointers.

4. Design How distributed storage tweets, including maintaining the sorting nature of what.

5. String matching problem, there is no fancy method for example KMP what time is over.

6. Design a Timer class.

It is estimated that because of my project experience, many problems eventually extend to distributed implementations and implementations with MapReduce.


Then go to SF to finish Airbnb and continue to add ...

San Fransisco Onsite surface by

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.