Archives
74 posts total • Showing page 1 of 4
2017 (3 posts)
Interview Note - Union Find
Union Find From wiki: In computer science, a disjoint-set data structure, also called a union–find data structure or merge–find set, is a data structure that keeps track of a set of elements...
2016 (3 posts)
PowerMockito -- Mock and Spy
A bad system design can lead to much hard work. In order to increase the unit tests coverage, I recently started to work on writing unit tests for some classes. One of the case is I want to test a...
Memory Leak in Docker Container
Since we recently start using docker for product release, I'm dealing with a lot of problems related with docker. One of the headache is sometimes, the running application performs different in...
2015 (10 posts)
Update Hexo 3.0
Spend a whole night working on updating Hexo. It is much more complicated than I expected. For anyone's convenience, I record some key points when migrate from Hexo 2.x to 3.0 besides the official...
Character Encoding - ASCII, Unicode & UTF-8
| --- | --- 1 | 0000 0000 to 0000 007F | 0xxxxxxx 2 | 0000 0080 to 0000 07FF | 110xxxxx 10xxxxxx 3 | 0000 0800 to 0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx 4 | 0001 0000 to 0010 FFFF | 11110xxx 10xxxxxx...
Interview Note - Examples
Single Number XOR features: a ^ b = c a ^ c = b b ^ c = a a ^ 0 = a a ^ a = 0 (a ^ b) ^ c = a ^ (b ^ c) - I: all the numbers appear twice except one XOR all the numbers, and the result is the one -...
Interview Note - Data Structure
Data Structure is a way to organize data. It provides some methods to handle data stream, e.g. insert, delete, etc. Linear Data Structure Queue & Stack Min Stack Use two stacks, one is storing the...
Interview Note - Graph & Search
Clone Graph ` java /** * Definition for undirected graph. * class UndirectedGraphNode { * int label; * ArrayList neighbors; * UndirectedGraphNode(int x) { label = x; neighbors =...
Interview Note - Dynanmic Programming
1. Dynamic Programming A method for solving a complex problem by breaking it down into a collection of simpler sub-problems. 1.1 When to use 1. One of the following three: - Maximum/Minimum Problem -...
Interview Note - Linked List
1. Introduce Dummy Node When the head of the target list we want to return may be different from the original given list, we can use a dummy node linked to the result so that we can get what we want...
Interview Note - Binary Tree
1. Binary Tree DFS Traversal 1.1 Recursion This method will cost O(n) time with no extra space. The space is assigned by system(which could be O(1) or O(h), h is the height of the tree). ` java...
Interview Note - Binary Search & Sorted Array
Binary Search For a given sorted array (ascending order) and a target number, find the first index of this number in O(log n) time complexity. If the target number does not exist in the array, return...
Interview Note - Intro
Coding Style 1. Leave blank space around each operations 2. Give meaningful names to parameters 3. Add space line between two logic blocks For example, Implement strStr(): ` java public class...
2014 (4 posts)
Markdown Reference
This template is used for later markdown reference. Fonts: ` bash Italics Bold Italics and Bold ~~Scratch~~ It also works if you change the star(*) into underline(_). ` Italics, Bold, Italics and...
24
身在异国的第二个生日,也是自己本命年的日子,总觉得应该说些什么,但又没什么好讲的。 如果说去年的生日,主题是放肆,那今年的一定就是平淡了。跟mm和xs三个人出去吃饭打牌看电影,一句话说完了,仅此而已。...
记下那些刷题的日子
朋友们都不在身边了,喜欢热闹的人,有时不得不学会安静的一个人,慢慢思考,慢慢成长。6月2号到7月27号(暂定),56个日子,写下自己是如何度过的,毕竟,也是对自己意义不凡的一段时光。 GitHub(InterviewPreparation) 6.2: 开始刷题啦,兴奋起来! 6.3: 刷完前120题,要花两天时间按类型整理下才行啊,DP总是想不到,还有系列问题要系统的再过一遍才行。 6.4:...
写在五月
// 本文逼格颇高,熟人请慎入 // 说我逗比的,快command+w // 最后一次机会了,小心眼瞎 怎么说起。 以为一年的生活,不会给我什么感情,但真的到了这天,却格外泛滥。 去年八月来到康村,新鲜,明媚,好奇着当前,期待着未来。那个张晨没有烦恼,没有压力。转眼一年过去,许多事情摆在眼前,现在的我已经不再去回忆,不是不愿,而是不敢。...