Dropbox/SF/昂塞

第一轮:设计供公司内部所有team使用的logging系统的api。各个team的log逻辑上分开。log的形式是key-value pair,schema可以不同,如:
组A :
{ name: “Jack”,id:231,age:23 }
{ name:“Jack”,position:“SDE”,location:“SF,CA”}
{ id:21,value:23.4}

组B : { id:234,ip:“127.0.0.1”,event:“login”}
组A查询name="Jack"时,返回match的所有行:例中前2行

第二轮:给TokenBucket的构造函数TokenBucket(int tokens, int refreshrate, int capaciy);
tokens: 初始tokens;
refreshrate: 每refreshrate秒往里加1个token
capacity: token bucket最大容量
要求实现线程安全的api: void get(int amount):从token bucket中取出amount个token。

第三轮:实现分配ID的api:
allocate():返回0-N中可用ID
release(int):释放ID
要求:

  1. 优化时间
  2. 优化空间
  3. 兼顾时间和空间

第四轮:deep dive project

第五轮:BQ

第六轮:managet Q/A