yp design
P2 设计一个tiny url
P1 设计一个load balancer
P3 what make your DB query slow
- Slow server network connection
- Inadequate memory / page faults
- Missing indexes
- Index columns in wrong order or sorted improperly
- Indexes missing columns (covering index)
- Need to create indexed views
- Replacing cursors with set-based operations
- Table partitioning
- Poor table normalization / denormalization design
- Buffer pool for recent pages too small
- Firstly I’ll check whether all the queries are running slow or any particular query is taking long time to execute. If all the queries are running slow I’ll check any blocking are there in the database engine. If any particular query is running slow I’ll take the execution plan and create missing indexes.
- I’ll check if any indexes are fragmented in the disk. If the index pages are fragmented the same needs to be reorganized or rebuild.
P3 trouble shooting slow page
P4 设计一个方法来判断两端文字的相似度,我用的是cosin similarity. 然后有一些follow-up 问题,比如如何来设置threshold,怎么根据现有的来training。比较难。我没答好
P5 问了database, index。 如何用几句话讲明白什么是index
http://blog.codinglabs.org/articles/theory-of-mysql-index.html
P6 inverted index。
P7 讲intern project,问garbage collection如何实现? 问了database index 是什么?如果有一个query 非常慢,为什么? 怎么找到原因。如何优化?如果是因为index的问题,解释为什么index影响query 速度。
P8 Cross-site request forgery csrf attack http://baike.baidu.com/link?url=FXeEnZO4X4RXeHUA23saNcwJs5yLd9DledQpatBm6lasT2NhtJjB-RhZ8Xnp7-W6lXY5emCjJW_2R70oG7FrKa
其实就是我的浏览器存了A网站的cookie。然后你在B网站上挂了一个链接,作用是向A网站提交一个转账的request。如果我点了B网站的链接他就会利用我A网站的cookie把这笔钱划走。
下面的博文讲得特别好!
http://www.cnblogs.com/hyddd/archive/2009/04/09/1432744.html
P9 xss attack http://baike.baidu.com/item/XSS%E6%94%BB%E5%87%BB/954065?fr=aladdin
其实就是在公共区域插入恶意代码,引导浏览的用户去点击执行,然后就会获取用户的cookie呀!比如我在一个用户开的帖子下面加回复。然后回复里面带恶意的javascript。
P10 SQL vs NoSQL
http://www.thegeekstuff.com/2014/01/sql-vs-nosql-db/?utm_source=tuicool