肿瘤囊泡?# Biology - 生物学
d*r
1 楼
名单上列了11个人。见了10个,跟名单上有临时改动,有一个的shadow没来。
1. given such a structure,
id -- list of friend ids (sorted), similar to bi-directional or
undirected graph eg.
1 -- 3 5 6
2 -- 5 8
3 -- 1 8
5 -- 1 2
6 -- 1
8 -- 2 3 9
9 -- 8
find an efficient way to decide if two ids are connected by 1 hop or 2
hop. for instance.
one hop: 1 -> 3 -> 8
two hop: 1 -> 3 -> 8 -> 9
2. design a hashtable, get, put, etc. consider thread-safety and hash
capacity resizing.
3. some introduction of the team. no question since it is short lunch.
4. pair: design question. one key/value store, keys can all be loaded into
memory, while value can't since they are very big. When write values to disk
, we can only apppend, no random seek write is allowed, reading values from
disk can alow random seek. How to design a way to efficiently store and
retrieve the values. Follow up on thread-safety and how to clean-up stale
entries in the file.
5. pair: maximum subsequence. min span window (最短摘要).
6. pair: given a stream of unique key-value pairs. given a window size.
write method to getKey, putKey and getAverage. consider thread-safety and
efficiency. optimize getKey and getAverage, which returns the avearge of the
values within the window size.
7. given a push and pull api call, design the protocal on the wire. also
design the memory management unit to reduce memory allocation and
deallocation.
(After a long day, kind of exhausted, i am having trouble understanding the
intention of his questions. 交流出现严重问题).
when he came in, without self-introduction, draw a figure on the board. say.
two sides: one side push the other side pull
push?sequenceNo=xxx&numOfBytes=yyy pullBatch?sinceSequence=xxx&
numOfBytes=yyy
the side that does the push each time only push one sequence of payload with
different sizes.
say 4 pushes like this.
1. push?sequencNo=1&numberOfBytes=50
2. push?sequencNo=4&numberOfBytes=70
3. push?sequencNo=6&numberOfBytes=100
4. push?sequencNo=7&numberOfBytes=80
sequnenceNos doesn't have to be contiguous.
the pull side is a batch operation. it only pull the payload up to
numOfBytes without cutting the sequence. For instance.
pullBatch?sinceSequence=1&numOfBytes=200. will pull sequneceNo 4 and 6 with
the actual size=70+100=170.
Then he asked me to design the underline layer that supports the specified
pullBatch operation. Can either in application layer (Http) or even in
tranport layer (tcp) if I want to.
I got caught.
Then later, he asks how to design the structure of the central unit, I said
use a queue or boundedqueue. he said the problem is queue will always
allocate and deallocate memories. How to optimize. I start to talk about
maintain your own free memory pool. While I was trying to explain my
thoughts, he start to check his iphone. Seems not what he expected. Then he
say this is a short session. walked me out.
some other thoughts on the interview schedule:
cheap: 租车没保险。野外旅馆不带管饭的
hope this could help you.
1. given such a structure,
id -- list of friend ids (sorted), similar to bi-directional or
undirected graph eg.
1 -- 3 5 6
2 -- 5 8
3 -- 1 8
5 -- 1 2
6 -- 1
8 -- 2 3 9
9 -- 8
find an efficient way to decide if two ids are connected by 1 hop or 2
hop. for instance.
one hop: 1 -> 3 -> 8
two hop: 1 -> 3 -> 8 -> 9
2. design a hashtable, get, put, etc. consider thread-safety and hash
capacity resizing.
3. some introduction of the team. no question since it is short lunch.
4. pair: design question. one key/value store, keys can all be loaded into
memory, while value can't since they are very big. When write values to disk
, we can only apppend, no random seek write is allowed, reading values from
disk can alow random seek. How to design a way to efficiently store and
retrieve the values. Follow up on thread-safety and how to clean-up stale
entries in the file.
5. pair: maximum subsequence. min span window (最短摘要).
6. pair: given a stream of unique key-value pairs. given a window size.
write method to getKey, putKey and getAverage. consider thread-safety and
efficiency. optimize getKey and getAverage, which returns the avearge of the
values within the window size.
7. given a push and pull api call, design the protocal on the wire. also
design the memory management unit to reduce memory allocation and
deallocation.
(After a long day, kind of exhausted, i am having trouble understanding the
intention of his questions. 交流出现严重问题).
when he came in, without self-introduction, draw a figure on the board. say.
two sides: one side push the other side pull
push?sequenceNo=xxx&numOfBytes=yyy pullBatch?sinceSequence=xxx&
numOfBytes=yyy
the side that does the push each time only push one sequence of payload with
different sizes.
say 4 pushes like this.
1. push?sequencNo=1&numberOfBytes=50
2. push?sequencNo=4&numberOfBytes=70
3. push?sequencNo=6&numberOfBytes=100
4. push?sequencNo=7&numberOfBytes=80
sequnenceNos doesn't have to be contiguous.
the pull side is a batch operation. it only pull the payload up to
numOfBytes without cutting the sequence. For instance.
pullBatch?sinceSequence=1&numOfBytes=200. will pull sequneceNo 4 and 6 with
the actual size=70+100=170.
Then he asked me to design the underline layer that supports the specified
pullBatch operation. Can either in application layer (Http) or even in
tranport layer (tcp) if I want to.
I got caught.
Then later, he asks how to design the structure of the central unit, I said
use a queue or boundedqueue. he said the problem is queue will always
allocate and deallocate memories. How to optimize. I start to talk about
maintain your own free memory pool. While I was trying to explain my
thoughts, he start to check his iphone. Seems not what he expected. Then he
say this is a short session. walked me out.
some other thoughts on the interview schedule:
cheap: 租车没保险。野外旅馆不带管饭的
hope this could help you.