Chapter 50 Linkedin 2016 01-06

http://www.1point3acres.com/bbs/thread-174614-2-1.html

那我乱讲讲挂后自己的一些想法,你也就乱听听

先按要求做一些math,算一下数据量,流量,需要的机器数目之类的

感觉此类应用应该是用关系型数据库,data可以自己试着设计一下,API可以这些:

query(user, day), insert(user, event), delete(user, event)

scale out的话,因为用户间关联较稀少,所以可以按照用户来shard到不同机器

短时间内notify大量的用户比较麻烦,没想好
---

这题面试官确实是主要考mysql然后加个memcache的.我当时面的说用couchbase,
面试官感觉也不是在一个频道上..

50.2 Loop mutlidimentional arrays

Given a mutlidenmentional arrays, compute the sum of all values. Given API getValue(dn, dn-1.... d0), dn = index at denmention n

http://www.1point3acres.com/bbs/thread-156427-1-1.html

http://www.1point3acres.com/bbs/thread-156427-1-1.html

这道题的思想很简单,就是题意容易搞不懂.对多维数组,循环就是了.但是我们不能hardcode这个多重循环,因为数组的维数不是确定的.搞懂这个就简单了.正确的思路是用recusrive function.

输入是MDA的pointer是p, 还有dimension array vector ds:

假设ds是{2,3,4}, sum函数必须调用:

其实这个题就是combination {{0,1},{0,1,2},{0,1,2,3}}. Pretty much like: https://leetcode.com/problems/letter-combinations-of-a-phone-number ,用DFS解之.

完整程序见: https://github.com/shadowwalker2718/data_structure_algorithm/blob/master/leetcode_c/MultiDimensionArray.h#L28

  1. technique communcation, describe favorite project
  1. code problems: serialize and deserialize a BST
  1. host manager session: describe the most chanllenging project and how you handle challenges, why choose Linkedin over other companies
  1. system design: design a system to monitors the top exceptions during last hour, last 24 hours