## Reasons They Recruit

From Ace of Programming Interview, Cpt1 - Hiring Programmers: The Inside Story

## Establish a Rapport

For an interviewee, one the the most efficient way to build a rapport is to try to see things in from the interviewer's perspective.

• understand the motivation of the interviewer
• establishing a common ground
• adapting your …

## The Checklist of Steve Yegge

Hey man, I don't know that stuff

Stevey's talking aboooooout

If my boss thinks it's important

I'm gonna get fiiiiiiiiiired

Oooh yeah baaaby baaaay-beeeeee....

## 非技术部分

### 热身

#### 好好读一本讲数据结构和算法的书

Yegge推荐了 Steven S. Skiena 的《算法设计手册》，而我推荐的是 Udi Manber 的《算法引论》

## 银弹？

1. 将日志进行分片。把hash(ip)相同的ip地址分到同一个片中。（注：这里的hash并不是签名函数，只是一个分片标示）
2. 分片后的日志的大小会小很多，可以方便的进行排序，记数。
3. 然后再从各个片中，统计出最热门的IP地址。（或TopK的IP地址）

## 题目大意

```for i = 1 to M do
for j = 1 to N do
if j % B[i] == 0 then
A[j] = A[j] * C[i]
endif
end do
end do
```

1≤ N,M ≤ 10^5

1 ≤ B[i …

## Background

This problem is from the book "Algorithm 4th edition" (Exersise 4.1.10)

There are N cities and M undirected roads between those cities. People can travel to any city along the roads.

One day, a war breaks out. Our cities are under attack! As we can't defend all …