interview-skills

interview-skills

系统设计总结

系统设计的题目,感觉不用做非常多,但要善于总结,相似的问题可以总结成一类,用一个模板来解答,然后加一些小细节加以区分。 如何将一个信息同时传播给多个关注该事务的client 定时任务 Event Sourcing Event sourcing就是说我们不存最后的状态,而是把每一个action都存起来,然后需要结果的话,我们得到所有的action,然后derive出最后的状态是什么。那什么时候需要event sourcing呢?跟钱打交道的时候,比如说Auction system需要我们prove为什么是这个人赢得了最后的bid等。另一个就是,如果很多人都在竞拍一个产品,如果我们只存最终结果(在这种情况下是update Auction表里的winner),在高并发的情况下会一直修改同一个数据,这要比往bid table里不停append给bid table的的性能要差很多。 Lease机制 Lease机制是facebook设计memcached的时候,为了解决数据一致性的问题解决的,非常适合高并发场景。那么是如何工作的呢?– 同一个cache key,memcached维护一个当前有效的lease token,不管多少请求都拿到这个token– server A和server B都来读取数据,拿到相同token,然后server […]

interview-skills

搜索

什么情况下用BFS? 什么情况下用DFS? 练习题 https://leetcode.com/problems/combination-sum/description https://leetcode.com/problems/combination-sum-ii/description https://leetcode.com/problems/palindrome-partitioning https://leetcode.com/problems/permutations/description https://leetcode.com/problems/permutations-ii/description

interview-skills

动态规划

什么题适合动态规划? 什么题不适合动态规划? 动规四要素 顺带回忆一下递归三要素 动态规划只能记录一种最优方案 练习题目: https://leetcode.com/problems/triangle/description https://leetcode.com/problems/minimum-path-sum/description https://leetcode.com/problems/unique-paths/description https://leetcode.com/problems/climbing-stairs/description https://leetcode.com/problems/longest-increasing-subsequence/description https://leetcode.com/problems/perfect-squares/description https://leetcode.com/problems/largest-divisible-subset/description https://leetcode.com/problems/russian-doll-envelopes/description https://leetcode.com/problems/frog-jump/description

interview-skills

Server-to-Server常用认证方式

API key 放在请求头里,例如 Token(jwt) 先调用登录api来获得token 然后得到相应: 然后带上这个token在请求头里: OAuth2 1. 用户点击“用 Google 登录” 2. 前端拿到 Google 的 ID Token 3. 前端把

interview-skills

Software Test

There’re different test types across software testing. Unit testing Unit testing means writting automated tests for the smallest testable parts

Scroll to Top