๊ณต๋ถ ๋ชฉ๋ก
coding-interview-university/README-ko.md at main ยท jwasham/coding-interview-university ยท GitHub
์๊ณ ๋ฆฌ์ฆ ๋ณต์ก๋ / Big-O / ์ ๊ทผ์ ๋ถ์ยถ
- Harvard CS50 - Asymptotic Notation (video)
- Big O Notations (general quick tutorial) (video)
- Big O Notation (and Omega and Theta) - best mathematical explanation (video)
- Skiena:
- ๋์์
- ์ฌ๋ผ์ด๋ ์๋ฃ
- A Gentle Introduction to Algorithm Complexity Analysis
- Orders of Growth (video)
- Asymptotics (video)
- UC Berkeley Big O (video)
- UC Berkeley Big Omega (video)
- Amortized Analysis (video)
- Illustrating โBig Oโ (video)
- TopCoder (includes recurrence relations and master theorem):
- Computational Complexity: Section 1
- Computational Complexity: Section 2
- Cheat sheet
์๋ฃ๊ตฌ์กฐยถ
๋ฐฐ์ดยถ
- ์๋ ๋ฆฌ์ฌ์ด์ง ๋ฒกํฐ ๊ตฌํํ๊ธฐ
- ์ค๋ช :
- ๋ฒกํฐ ๊ตฌํํ๊ธฐ (์๋ ๋ฆฌ์ฌ์ด์ง์ ํฌํจํ ๋์ ๋ฐฐ์ด):
- ๋ฐฐ์ด, ํฌ์ธํฐ ๋ฐ ์ธ๋ฑ์ฑ ๋์ ํ์ฌ ํน์ ์ธ๋ฑ์ค์ ์ ๊ทผํ๋ ํฌ์ธํฐ ์ฐ์ฐ์ ํตํ ์ฝ๋ฉ ์ฐ์ต
- ๋ฉ๋ชจ๋ฆฌ ํ ๋น์ ํฌํจํ ์ ๋ฐฐ์ด
- ๋ฐฐ์ด ๋ฉ์๋ ๋ฑ์ ๊ธฐ๋ฅ์ ํ์ฉํ์ง ์์ผ๋ฉด์ ์ ์ ๋ฐฐ์ด์ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ํ ๋นํ ์ ์์ด์ผ ํจ
- 16์ผ๋ก ์์ํ๊ฑฐ๋ ์์ํ๋ ์ซ์๊ฐ ํฌ๋ค๋ฉด 2์ ์ ๊ณฑ์(16, 32, 64, 128)๋ก ์์
- size() - ํญ๋ชฉ์ ๊ฐ์
- capacity() - ๋ค์ด๊ฐ ์ ์๋ ํญ๋ชฉ์ ์ต๋ ๊ฐ์
- is_empty()
- at(index) - ์ธ๋ฑ์ค์ ์๋ ํญ๋ชฉ์ ๋๋ ค์ฃผ๊ณ , ์ธ๋ฑ์ค๊ฐ ๋ฒ์ ๋ฐ์ด๋ฉด ์๋ฌ๋ฅผ ๋
- push(item)
- insert(index, item) - index์ item์ ์ฝ์ ํ๊ณ ๊ธฐ์กด ์ธ๋ฑ์ค์ ๊ฐ๋ถํฐ ์ญ ์ค๋ฅธ์ชฝ์ผ๋ก ์ฌํํธ
- prepend(item) - ๋งจ ์์ ์์๋ฅผ ์ฝ์
- pop() - ๋ง์ง๋ง ์์๋ฅผ ์ญ์ ํ๊ณ ๊ฐ์ ๋๋ ค์ค๋ค
- delete(index) - delete item at index, shifting all trailing elements left
- remove(item) - looks for value and removes index holding it (even if in multiple places)
- find(item) - looks for value and returns first index with that value, -1 if not found
- resize(new_capacity) // private ํจ์
- ์ฉ๋์ด ๊ฝ ์ฐจ๋ฉด, ๊ทธ ๋๋ฐฐ๋ก ํฌ๊ธฐ๋ฅผ ์กฐ์ ํ๋ค.
- item์ ํ๋ ๊บผ๋ผ ๋, ์ฉ๋์ด 1/4์ด๋ผ๋ฉด, ์ฉ๋์ ์ ๋ฐ์ผ๋ก ์ค์ธ๋ค.
- ์๊ฐ ๋ณต์ก๋
- ์ ๊ทผ, ์์ , ๋์ ์ถ๊ฐ/์ญ์ ํ๋ ๋ฐ O(1)
- ๋ค๋ฅธ ๊ณณ์ ์ถ๊ฐ/์ญ์ ํ๋ ๋ฐ O(n)
- ๊ณต๊ฐ ๋ณต์ก๋
- ๋ฉ๋ชจ๋ฆฌ์ ์ฐ์์ ์ผ๋ก ์์ด์, ๊ทผ์ ์ฑ์ด ์ฑ๋ฅ์ ํฅ์์ํจ๋ค.
- ํ์ํ ๊ณต๊ฐ = (n ์ด์์ธ ๋ฐฐ์ด์ ์ฉ๋) * item์ ํฌ๊ธฐ, ํ์ง๋ง 2n ํฌ๊ธฐ์์๋ ์ฌ์ ํ O(n)
๋งํฌ๋ ๋ฆฌ์คํธยถ
- ์ค๋ช :
- C Code (video)
- ์ ์ฒด ์์์ ์๋๊ณ , ๋ ธ๋ ๊ตฌ์กฐ์ ๋ฉ๋ชจ๋ฆฌ ํ ๋น์ ๋ํ ๋ถ๋ถ์ ๋๋ค. - ์ฐ๊ฒฐ ๋ฆฌ์คํธ vs ๋ฐฐ์ด:
- ์ ์ฐ๊ฒฐ ๋ฆฌ์คํธ๋ฅผ ๊ธฐํผํด์ผ ํ๋์ง (์์)
- ์ง๊ณ ๊ฐ๊ธฐ: ์ด์ค ํฌ์ธํฐ์ ๋ํ ์ง์์ด ํ์ํ๋ค๋ฉด:
(for when you pass a pointer to a function that may change the address where that pointer points)
์ด ํ์ด์ง๋ ํฌ์ธํฐ๊ฐ ํฌ์ธํฐ๋ฅผ ๊ฐ๋ฆฌํค๋ ๊ฒ์ ํ์ ํ๋ ์ ๋์ ๋๋ค. ์ ๋ ์๋ ๋ชฉ๋ก์ ์์๋๋ก ์ฝ์ง ์๊ธฐ๋ฅผ ๊ถ์ฅํฉ๋๋ค. ๊ฐ๋ ์ฑ๊ณผ ์ ์ง ๋ณด์์ฑ์ด ๋ ์ข๊ธฐ ๋๋ฌธ์ ๋๋ค. - ๊ตฌํ (์ ๋ tail ํฌ์ธํฐ๊ฐ ์๋ ๊ฒ๊ณผ ์๋ ๊ฒ ๋ชจ๋ ๊ตฌํํ์์ต๋๋ค.):
- size() - ๋ฆฌ์คํธ ์์ ๋ฐ์ดํฐ ๊ฐ์๋ฅผ ๋ฐํํ๋ค.
- empty() - ๋ฆฌ์คํธ๊ฐ ๋น์ด์๋ค๋ฉด true๋ฅผ ๋ฐํํ๋ค.
- value_at(index) - index๋ฒ์งธ ์์น์ value์ ๋ฐํํ๋ค. (๊ฐ์ฅ ์์ 0๋ถํฐ ์์ํ๋ค.)
- push_front(value) - ๊ฐ์ฅ ์์ value๋ฅผ ์ถ๊ฐํ๋ค.
- pop_front() - ๊ฐ์ฅ ์์ ์๋ ๊ฒ์ ์ ๊ฑฐํ๊ณ , ๊ทธ value๋ฅผ ๋ฐํํ๋ค.
- push_back(value) - ๊ฐ์ฅ ๋์ value์ ์ถ๊ฐํ๋ค.
- pop_back() - ๊ฐ์ฅ ๋์ ์๋ ๊ฒ์ ์ ๊ฑฐํ๊ณ , ๊ทธ value๋ฅผ ๋ฐํํ๋ค.
- front() - ๊ฐ์ฅ ์์ ์๋ ๊ฒ์ value๋ฅผ ๊ฐ์ ธ์จ๋ค.
- back() - ๊ฐ์ฅ ๋์ ์๋ ๊ฒ์ value๋ฅผ ๊ฐ์ ธ์จ๋ค.
- insert(index, value) - index๋ฒ์งธ ์์น์ value๋ฅผ ์ถ๊ฐํ๋ค. ์ฆ, index๋ฒ์งธ์ ์๋ก ์ถ๊ฐ๋ ๊ฒ์ด ๊ธฐ์กด์ index๋ฒ์งธ์ ์๋ ๊ฒ์ ๊ฐ๋ฆฌํจ๋ค.
- erase(index) - index๋ฒ์งธ์ ์๋ ๋ ธ๋๋ฅผ ์ญ์ ํ๋ค.
- value_n_from_end(n) - ๋ค์์๋ถํฐ n๋ฒ์งธ์ ์๋ ๋ ธ๋์ value๋ฅผ ๋ฐํํ๋ค.
- reverse() - ๋ฆฌ์คํธ๋ฅผ ๋ค์ง๋๋ค.
- remove_value(value) - value์ ๊ฐ์ ๊ฐ์ ๊ฐ์ง๋ ์ฒซ ๋ฒ์งธ ๋ ธ๋๋ฅผ ์ ๊ฑฐํ๋ค.
- ์ด์ค ์ฐ๊ฒฐ ๋ฆฌ์คํธ
- ์ค๋ช (์์)
- ๊ตฌํํ ํ์๋ ์์ต๋๋ค.
์คํยถ
- Stacks (video)
- Will not implement. Implementing with array is trivial.
ํยถ
- Queue (video)
- Circular buffer/FIFO05_04-priorityQueuesAndDeques.mp4)
- tail ํฌ์ธํฐ๊ฐ ์๋ ์ฐ๊ฒฐ ๋ฆฌ์คํธ๋ฅผ ์ฌ์ฉํ์ฌ ๊ตฌํํ๊ธฐ:
- enqueue(value) - tail์ด ๊ฐ๋ฆฌํค๋ ๊ณณ์ value๋ฅผ ์ถ๊ฐํ๋ค
- dequeue() - value๋ฅผ ๋ฐํํ๊ณ ๊ฐ์ฅ ์ต๊ทผ์ ์ถ๊ฐ๋ ์์(front)๋ฅผ ์ ๊ฑฐํ๋ค.
- empty()
- ๊ณ ์ ๊ธธ์ด ๋ฐฐ์ด์ ์ฌ์ฉํ์ฌ ๊ตฌํํ๊ธฐ:
- enqueue(value) - ์ฌ์ฉ ๊ฐ๋ฅํ ์ ์ฅ ๊ณต๊ฐ์ ๋์ item์ ์ถ๊ฐํ๋ค.
- dequeue() - value๋ฅผ ๋ฐํํ๊ณ ๊ฐ์ฅ ์ต๊ทผ์ ์ถ๊ฐ๋ ์์๋ฅผ ์ ๊ฑฐํ๋ค.
- empty()
- full()
- ๋น์ฉ:
- a bad implementation using linked list where you enqueue at head and dequeue at tail would be O(n)
because youโd need the next to last element, causing a full traversal each dequeue - enqueue: O(1) (amortized, linked list and array [probing])
- dequeue: O(1) (linked list and array)
- empty: O(1) (linked list and array)
- a bad implementation using linked list where you enqueue at head and dequeue at tail would be O(n)
ํด์ ํ ์ด๋ธยถ
-
๋์์๋ค:
-
์จ๋ผ์ธ ๊ฐ์๋ค:
-
Linear probing์ ์ฌ์ฉํ์ฌ ๋ฐฐ์ด๋ก ๊ตฌํํด๋ณด๊ธฐ
- hash(k, m) - m์ ํด์ ํ ์ด๋ธ์ ํฌ๊ธฐ
- add(key, value) - ํค๊ฐ ์ด๋ฏธ ์กด์ฌํ๋ค๋ฉด, ๊ฐ์ ๊ฐฑ์ ํ๋ค.
- exists(key)
- get(key)
- remove(key)
์ถ๊ฐ ์ง์ยถ
์ด์ง ํ์ยถ
- Binary Search (video)
- Binary Search (video)
- ์์ธํ ๋ด์ฉ
- ๊ตฌํ:
- (์ ์๊ฐ ์ ๋ ฌ๋ ๋ฐฐ์ด์์) ์ด์ง ํ์
- ์ฌ๊ท๋ฅผ ์ฌ์ฉํ ์ด์ง ํ์
๋นํธ ์ฐ์ฐยถ
- Bits cheat sheet - you should know many of the powers of 2 from (\(2^1\) to \(2^{16}\) and \(2^{32}\))
- ๋นํธ ์ฐ์ฐ์(&, |, ^, ~, >>, <<) ์ ๋๋ก ์ดํดํ๊ธฐ
- 2์ ๋ณด์์ 1์ ๋ณด์
- Count set bits
- Swap values:
- Absolute value:
ํธ๋ฆฌยถ
ํธ๋ฆฌ - ๋ฐฐ๊ฒฝ ์ง์ยถ
- Series: Trees (video)
- ํธ๋ฆฌ ๊ธฐ์ด ํํ ๋ง๋ค๊ธฐ
- ์ํ
- ์๊ณ ๋ฆฌ์ฆ ๋ค๋ฃจ๊ธฐ
- BFS(๋๋น-์ฐ์ ํ์;breadth-first search) and DFS(๊น์ด-์ฐ์ ํ์;depth-first search)
- BFS ๋ ธํธ:
- level order (BFS, ํ ์ฌ์ฉ)
- ์๊ฐ ๋ณต์ก๋: O(n)
- ๊ณต๊ฐ ๋ณต์ก๋:
์ต๊ณ : O(1)
์ต์ : O(n/2)=O(n) - DFS ๋ ธํธ:
- ์๊ฐ ๋ณต์ก๋: O(n)
- ๊ณต๊ฐ ๋ณต์ก๋:
์ต๊ณ : O(log n) - ํ๊ท ์ ์ผ๋ก, ํธ๋ฆฌ์ ๋์ด์ด๋ค.
์ต์ : O(n) - ์ค์(inorder) (DFS: ์ผ์ชฝ, ์์ , ์ค๋ฅธ์ชฝ)
- ํ์(postorder) (DFS: ์ผ์ชฝ, ์ค๋ฅธ์ชฝ, ์์ )
- ์ ์(preorder) (DFS: ์์ , ์ผ์ชฝ, ์ค๋ฅธ์ชฝ)
์ด์ง ํ์ ํธ๋ฆฌ (BST)ยถ
- Binary Search Tree Review (video)
- Introduction (video)
- MIT (video)
- C/C++:
- ์ด์ง ํ์ ํธ๋ฆฌ - C/C++๋ก ๊ตฌํํ๊ธฐ (์์)
- BST ๊ตฌํ - ์คํ๊ณผ ํ์ ๋ฉ๋ชจ๋ฆฌ ํ ๋น (์์)
- ์ด์ง ํ์ ํธ๋ฆฌ์์ ๊ฐ์ฅ ์์ ์์์ ๊ฐ์ฅ ํฐ ์์ ์ฐพ๊ธฐ (์์)
- ์ด์ง ํธ๋ฆฌ์ ๋์ด ๊ตฌํ๊ธฐ (์์)
- ์ด์ง ํธ๋ฆฌ ์ํ - ๋๋น-์ฐ์ ๊ณผ ๊น์ด-์ฐ์ ์ ๋ต (์์)
- ์ด์ง ํธ๋ฆฌ: Level Order Traversal (video)
- ์ด์ง ํธ๋ฆฌ ์ํ: ์ ์, ์ค์, ํ์ (์์)
- ์ด์ง ํธ๋ฆฌ๊ฐ ์ด์ง ํ์ ํธ๋ฆฌ์ธ์ง ์๋ ์ง ํ์ธํ๊ธฐ (์์)
- ์ด์ง ํ์ ํธ๋ฆฌ์์ ๋ ธ๋ ์ญ์ ํ๊ธฐ (์์)
- Inorder Successor in a binary search tree (video)
- ๊ตฌํ:
- insert // ํธ๋ฆฌ์ ์ด๋ค ๊ฐ์ ์ฝ์
- get_node_count // ์ ์ฅ๋ ๊ฐ๋ค์ ๊ฐ์ ์ธ๊ธฐ
- print_values // ํธ๋ฆฌ ์์ ๊ฐ๋ค์ ์ต์๋ถํฐ ์ต๋๊น์ง ์ถ๋ ฅ
- delete_tree
- is_in_tree // ์ฃผ์ด์ง ๊ฐ์ด ํธ๋ฆฌ ์์ ์๋ ์ง๋ฅผ ๋ฐํ
- get_height // ์ด๋ค ๋ ธ๋์ ๋์ด๋ฅผ ๋ฐํ (๋ ธ๋ ํ๋์ ๋์ด๋ 1์ด๋ค.)
- get_min // ํธ๋ฆฌ์ ์ ์ฅ๋ ๊ฐ ์ค ๊ฐ์ฅ ์์ ๊ฐ์ ๋ฐํ
- get_max // ํธ๋ฆฌ์ ์ ์ฅ๋ ๊ฐ ์ค ๊ฐ์ฅ ํฐ ๊ฐ์ ๋ฐํ
- is_binary_search_tree
- delete_value
- get_successor // ๊ฐ์ด ์ฃผ์ด์ง๋ฉด, ๋ค์์ผ๋ก ๊ฐ์ฅ ํฐ ๊ฐ์, ์์ผ๋ฉด -1์ ๋ฐํ
ํ / ์ฐ์ ์์ ํ / ์ด์ง ํยถ
- ํธ๋ฆฌ์ฒ๋ผ ๋ณด์ฌ์ง์ง๋ง, ๋ณดํต์ ์ ํ์ผ๋ก ์ ์ฅ๋ฉ๋๋ค. (๋ฐฐ์ด, ๋งํฌ๋๋ฆฌ์คํธ์ฒ๋ผ)
- ํ(Heap)
- ์๊ฐ (์์)
- Naiveํ ๊ตฌํ๋ค (์์)
- ์ด์ง ํธ๋ฆฌ (์์)
- Tree Height Remark (video)
- ๊ธฐ๋ณธ ์ฐ์ฐ๋ค (์์)
- ์์ ์ด์ง ํธ๋ฆฌ (์์)
- ์์ฌ ์ฝ๋(Pseudocode) (์์)
- ํ ์ ๋ ฌ - ์์ํ๊ธฐ (์์)
- ํ ์ ๋ ฌ (์์)
- ํ ๋ง๋ค๊ธฐ (์์)
- MIT: ํ๊ณผ ํ ์ ๋ ฌ (์์)
- CS 61B Lecture 24: ์ฐ์ ์์ ํ (์์)
- ์ ํ ์๊ฐ์ ํ ๋ง๋ค๊ธฐ (max-heap)
- max-heap ๊ตฌํํ๊ธฐ:
- insert
- sift_up -
insertํ๋ ค๋ฉด ํ์ - get_max - ์ต๋ ์์๋ฅผ ๋ฐํํ๋, ์ญ์ ๋ ํ์ง ์๋๋ค.
- get_size() - ์ ์ฅ๋ ์์๋ค์ ๊ฐ์๋ฅผ ๋ฐํ
- is_empty() - ํ์ ์์๋ฅผ ํ๋๋ ์๋ ์ง ๋ฐํ
- extract_max - ์ต๋ ์์๋ฅผ ๋ฐํํ๊ณ , ๊ทธ๊ฑธ ์ญ์ ํ๋ค.
- sift_down -
extract_maxํ๋ ค๋ฉด ํ์ํ๋ค - remove(x) - x๋ฒ์งธ ์์๋ฅผ ์ญ์
- heapify - ๋ฐฐ์ด์ ์๋ ์์๋ค๋ก ํ์ ๋ง๋ ๋ค.
heap_sortํ๋ ค๋ฉด ํ์ - heap_sort() - ์ ๋ ฌ๋์ง ์์ ๋ฐฐ์ด์ ๋ฐ์์ ์ ๋ ฌ๋ ๋ฐฐ์ด๋ก ๋ง๋ ๋ค. ์ถ๊ฐ ๋ฉ๋ชจ๋ฆฌ ์์ด ์ ์๋ฆฌ์์ max-heap์ ์ฌ์ฉํ๋ค.
- ๋ ธํธ: min-heap์ ์ฌ์ฉํ๋ฉด ์ฐ์ฐ์ ์ค์ผ ์ ์์ง๋ง, ๊ณต๊ฐ์ด ๋ ๋ฐฐ๋ก ํ์ํฉ๋๋ค. (์ ์๋ฆฌ์์ ๋ชป ํ๊ธฐ ๋๋ฌธ์)
์ ๋ ฌยถ
- Notes:
- ์ ๋ ฌ๋ค ๊ตฌํ & ๊ฐ ์ ๋ ฌ์ ์ต์ ์ ๊ฒฝ์ฐ/์ต์
์ ๊ฒฝ์ฐ, ํ๊ท ์ ์ธ ๋ณต์ก๋๋ฅผ ์๊ธฐ:
- ๋ฒ๋ธ ์ํธ ์ฐ์ง ๋ง์ธ์ - ๋์ฐํ๋๊น์ - n์ด 16์ดํ ์ ์ธํ๊ณ O(n^2)
- ์ ๋ ฌ ์๊ณ ๋ฆฌ์ฆ๋ค์ ์์ ์ฑ (โํต์ํธ๋ ์์ ์ ์ธ๊ฐ?โ)
-
์ด๋ค ์๊ณ ๋ฆฌ์ฆ๋ค์ ์ฐ๊ฒฐ ๋ฆฌ์คํธ๋ฅผ ์ธ ์ ์๋๊ฐ? ๋ฐฐ์ด์? ๋ ๋ค๋?
- ์ฐ๊ฒฐ ๋ฆฌ์คํธ๋ฅผ ์ ๋ ฌํ๋ ๊ฒ์ ์ถ์ฒํ์ง ์์ง๋ง, ๋ณํฉ ์ ๋ ฌ์ ๊ฐ๋ฅํฉ๋๋ค.
- ๋งํฌ๋ ๋ฆฌ์คํธ๋ก ๋ณํฉ ์ ๋ ฌ
-
ํ์ํธ์ ๊ฒฝ์ฐ, ์์ ํ ๋ฐ์ดํฐ ๊ตฌ์กฐ๋ฅผ ๋ณด์ธ์. ํ ์ ๋ ฌ์ ํ๋ฅญํ์ง๋ง ์์ ์ ์ด์ง ๋ชปํฉ๋๋ค.
- 1. Mergesort
- 2. Bottom up Mergesort
- 3. Sorting Complexity
- 4. Comparators
- 1. Quicksort
- 2. Selection
- 3. Duplicate Keys
-
UC Berkeley:
- CS 61B Lecture 29: Sorting I (video)
- CS 61B Lecture 30: Sorting II (video)
- CS 61B Lecture 32: Sorting III (video)
- Analyzing Bubble Sort (์์)
- ์ฝ์ ์ ๋ ฌ๊ณผ ๋ณํฉ ์ ๋ ฌ (์์)
- ์ฝ์ (์์)
- ๋ณํฉ ์ ๋ ฌ (์์)
- ํต ์ ๋ ฌ (์์)
-
๋ณํฉ ์ ๋ ฌ ์ฝ๋:
- Using output array (C)
- Using output array (Python)
- In-place (C++)
- ํต ์ ๋ ฌ ์ฝ๋:
- ๊ตฌํ (C์ธ์ด)
- ๊ตฌํ (C์ธ์ด)
-
๊ตฌํ:
- ๋ณํฉ ์ ๋ ฌ: ํ๊ท ๊ณผ ์ต์ ์ ๊ฒฝ์ฐ O(n log n)
- ํต ์ ๋ ฌ: ํ๊ท ์ ์ธ ๊ฒฝ์ฐ O(n log n)
- ์ ํ ์ ๋ ฌ๊ณผ ์ฝ์ ์ ๋ ฌ์ ๋ ๋ค ํ๊ท ๊ณผ ์ต์ ์ ๊ฒฝ์ฐ์ O(n^2)
-
ํ ์ ๋ ฌ์ ๊ฒฝ์ฐ, ์์ ํ ๋ฐ์ดํฐ ๊ตฌ์กฐ๋ฅผ ๋ณด์ธ์.
-
ํ์ํ ๊ฑด ์๋์ง๋ง, ์๋๋ ์ถ์ฒํฉ๋๋ค:
- Sedgewick - ๊ธฐ์ ์ ๋ ฌ(Radix Sorts) (6 videos)
- Radix Sort
- Radix Sort (video)
- Radix Sort, Counting Sort (linear time given constraints) (video)
- Randomization: Matrix Multiply, Quicksort, Freivaldsโ algorithm (video)
- Sorting in Linear Time (video)
๊ฐ๋ต์ ์ผ๋ก ๋ณด์๋ฉด, ์ฌ๊ธฐ์ ์๊ฐ์ ์ผ๋ก ๋ํ๋ธ 15๊ฐ์ง ์ ๋ ฌ ์๊ณ ๋ฆฌ์ฆ๋ค์ ๋ณด์ธ์.
์ด ์ฃผ์ ์ ๋ํด์ ๋ ์์ธํ ์๊ณ ์ถ๋ค๋ฉด, ๋ช๋ช ์ฃผ์ ์ ๋ํ ์ธ๋ถ์ฌํญ์์ โ์ ๋ ฌโ ์น์
๋ฅผ ๋ณด์ธ์.
๊ทธ๋ํยถ
๊ทธ๋ํ๋ ์ปดํจํฐ ๊ณผํ์ ์ฌ๋ฌ ๋ฌธ์ ๋ค์ ํํํ๋ ๋ฐ ์ฌ์ฉํ ์ ์๋ค. ๋๋ฌธ์ ์ด ์น์ ์ ํธ๋ฆฌ๋ ์ ๋ ฌ ์น์ ์ฒ๋ผ ๊ธธ๋ค.
- ๋ ธํธ:
- ๋ฉ๋ชจ๋ฆฌ์ ๊ทธ๋ํ๋ฅผ ํ์ํ๋ ๋ค ๊ฐ์ง ๊ธฐ๋ณธ ๋ฐฉ๋ฒ์ด ์๋ค:
- ์ค๋ธ์ ํธ์ ํฌ์ธํฐ
- ํ๋ ฌ
- ์ธ์ ๋ฆฌ์คํธ
- ์ธ์ ๋งต
- ๊ฐ๊ฐ์ ํํ๊ณผ ์ฅ๋จ์ ์ ์์งํ๋ผ.
- ๋์ด ์ฐ์ ํ์(BFS)์ ๊น์ด ์ฐ์ ํ์(DFS) - ๊ณ์ฐ์์ ๋ณต์ก์ฑ, ์ฅ๋จ์ , ์ค์ ์ฝ๋๋ก ๊ตฌํํ๋ ๋ฐฉ๋ฒ์ ์์์ผ ํ๋ค.
-
์ง๋ฌธ์ ๋ฐ์ ์ ๋จผ์ ๊ทธ๋ํ ๊ธฐ๋ฐ ์๋ฃจ์ ์ ์ฐพ๊ณ , ์์ ๊ฒฝ์ฐ์ ๋ค๋ฅธ ์๋ฃจ์ ์ผ๋ก ๋์ด๊ฐ๋ผ.
-
MIT(์์):
- ๋๋น ์ฐ์ ํ์(BFS;Breadth-First Search)
-
Skiena์ ๊ฐ์ข - ์์ํ๊ธฐ ์์ฃผ ์ข์ต๋๋ค:
- CSE373 2012 - Lecture 11 - Graph Data Structures (video)
- CSE373 2012 - Lecture 12 - Breadth-First Search (video)
- CSE373 2012 - Lecture 13 - Graph Algorithms (video)
- CSE373 2012 - Lecture 14 - Graph Algorithms (conโt) (video)
- CSE373 2012 - Lecture 15 - Graph Algorithms (conโt 2) (video)
-
CSE373 2012 - Lecture 16 - Graph Algorithms (conโt 3) (video)
-
๊ทธ๋ํ (๊ฒํ , ๊ทธ ์ธ ์ฌ๋ฌ๊ฐ์ง):
- 6.006 Dijkstra (video)
- 6.006 Bellman-Ford (video)
- 6.006 Speeding Up Dijkstra (video)
- Aduni: Graph Algorithms I - Topological Sorting, Minimum Spanning Trees, Primโs Algorithm - Lecture 6 (video)
- Aduni: Graph Algorithms II - DFS, BFS, Kruskalโs Algorithm, Union Find Data Structure - Lecture 7 (video)
- Aduni: Graph Algorithms III: Shortest Path - Lecture 8 (video)
- Aduni: Graph Alg. IV: Intro to geometric algorithms - Lecture 9 (video)
-
CS 61B 2014 (starting at 58:09) (video) - CS 61B 2014: Weighted graphs (video)
- Greedy Algorithms: Minimum Spanning Tree (video)
-
Strongly Connected Components Kosarajuโs Algorithm Graph Algorithm (video)
-
Full Coursera Course:
-
๋ด๊ฐ ๊ตฌํํ ๊ฒ:
- DFS with ์ธ์ ๋ฆฌ์คํธ (์ฌ๊ท)
- DFS with ์ธ์ ๋ฆฌ์คํธ (์คํ์ ์ด ๋น์ฌ๊ท)
- DFS with ์ธ์ ํ๋ ฌ (์ฌ๊ท)
- DFS with ์ธ์ ํ๋ ฌ (์คํ์ ์ด ๋น์ฌ๊ท)
- BFS with ์ธ์ ๋ฆฌ์คํธ
- BFS with ์ธ์ ํ๋ ฌ
- ๋จ์ผ ์ถ๋ฐ์ง ์ต๋จ ๊ฒฝ๋ก (๋ค์ต์คํธ๋ผ)
- ์ต์ ์ ์ฅ ํธ๋ฆฌ (MST;minimum spanning tree)
- DFS-๊ธฐ๋ฐ ์๊ณ ๋ฆฌ์ฆ๋ค (์์ Aduni ์์๋ค์ ๋ณด์ธ์):
- ์ฌ์ดํด ๊ฒ์ฌ/ํ์ธ (์์ ์ ๋ ฌํ ๋ ํ์ํฉ๋๋ค. ์์ํ๊ธฐ ์ ์ ๊ฒ์ฌํด์ผ ํ๊ฑฐ๋ ์.)
- ์์ ์ ๋ ฌ
- ๊ทธ๋ํ ๋ด์ ์ฐ๊ฒฐ ์์(Connected Component)๋ค ๊ฐ์
- ๊ฐ์ฐ๊ฒฐ์์(SCC;Strongly Connected Component)๋ค ๋์ดํ๊ธฐ
- ์ด๋ถ ๊ทธ๋ํ ํ์ธํ๊ธฐ
Skiena์ ์ฑ (์๋์ ์ฑ ์น์ ์ฐธ์กฐ)๊ณผ ์ธํฐ๋ทฐ ์ฑ ์์ ๋ ๋ง์ ๊ทธ๋ํ ์ค์ต์ ํ ์ ์์ต๋๋ค.
๋ ๋ง์ ์ง์ยถ
์ฌ๊ท (recursion)ยถ
- ์ฌ๊ท์ ๋ฐฑํธ๋ํน์ ๋ํ ์คํ ํฌ๋ ๋ํ ๊ฐ์:
- ์ฌ๊ท๋ ์ธ์ ์ฌ์ฉํด์ผ ํ๋ ์ง
- ๊ผฌ๋ฆฌ ์ฌ๊ท๋ฅผ ์ฌ์ฉํ๋ ๊ฒ ๊ทธ๋ ์ง ์์ ๊ฒ๋ณด๋ค ์ผ๋ง๋ ๋์๊ฐ์?
๋์ ํ๋ก๊ทธ๋๋ฐ (Dynamic Programming)ยถ
- ์ธํฐ๋ทฐ์์ DP ๋ฌธ์ ๋ฅผ ์ ํ์ง ์์ ์๋ ์์ต๋๋ค. ํ์ง๋ง ์๊ณ ์๋๊ฒ ๋ฏธ๋ค๋๋ ๊ฒ ๋ณด๋ค ๋ซ์ต๋๋ค.
- ์ด ์ฃผ์ ๋ ์์ฃผ ์ด๋ ต์ต๋๋ค. DP๋ก ํ๋ฆฌ๋ ๊ฐ ๋ฌธ์ ๋ง๋ค ์ด๋ค ์ ํ์์ ์ ์ํด์ผ ํ๋๋ฐ ๊ทธ๊ฒ ๊น๋ค๋กญ์ต๋๋ค.
- ์ฝํ์๋ ํจํด๋ค์ ํ์คํ ์ดํดํ ๋๊น์ง, ๋ง์ DP ์์ ๋ฌธ์ ๋ค์ ์ฐพ์๋ณด๊ธฐ๋ฅผ ๊ถํฉ๋๋ค.
- Videos:
- Skiena์จ์ ์์๋ค์ ๋ฐ๋ผ๊ฐ๊ธฐ ํ๋ญ๋๋ค. ๊ฐ๋ ํ์ดํธ๋ณด๋๋ฅผ ์ฌ์ฉํ์๋ ๋ฐ ๋๋ฌด ์์์ ๋ณด๊ธฐ๊ฐ ํ๋ค๊ฑฐ๋ ์.
- Skiena: CSE373 2012 - Lecture 19 - ๋์ ํ๋ก๊ทธ๋๋ฐ ์๊ฐ (์์)
- Skiena: CSE373 2012 - Lecture 20 - Edit Distance (video)
- Skiena: CSE373 2012 - Lecture 21 - ๋์ ํ๋ก๊ทธ๋๋ฐ ์์ ๋ค (์์)
- Skiena: CSE373 2012 - Lecture 22 - ๋์ ํ๋ก๊ทธ๋๋ฐ์ ํ์ฉ (์์)
- Simonson: Dynamic Programming 0 (59:18๋ถํฐ ์์) (์์)
- Simonson: Dynamic Programming I - Lecture 11 (์์)
- Simonson: Dynamic programming II - Lecture 12 (์์)
- List of individual DP problems (each is short):
Dynamic Programming (video)
- Yale Lecture notes:
- Coursera:
๋์์ธ ํจํดยถ
- Quick UML review (video)
- ์๋ ํจํด๋ค์ ๋ฐฐ์๋ด
์๋ค:
- strategy
- singleton
- adapter
- prototype
- decorator
- visitor
- factory, abstract factory
- facade
- observer
- proxy
- delegate
- command
- state
- memento
- iterator
- composite
- flyweight
- Chapter 6 (Part 1) - Patterns (video)
- Chapter 6 (Part 2) - Abstraction-Occurrence, General Hierarchy, Player-Role, Singleton, Observer, Delegation (video)
- Chapter 6 (Part 3) - Adapter, Facade, Immutable, Read-Only Interface, Proxy (video)
- Series of videos (27 videos)
- Head First Design Patterns
- I know the canonical book is โDesign Patterns: Elements of Reusable Object-Oriented Softwareโ, but Head First is great for beginners to OO.
- Handy reference: 101 Design Patterns & Tips for Developers
- Design patterns for humans
์กฐํฉ๊ณผ ํ๋ฅ ยถ
- Math Skills: How to find Factorial, Permutation and Combination (Choose) (video)
- Make School: Probability (video)
- Make School: More Probability and Markov Chains (video)
- Khan Academy:
- Course layout:
- Basic Theoretical Probability
- Just the videos - 41 (each are simple and each are short):
- Probability Explained (video)
NP, NP-์์ , ๊ทผ์ฌ ์๊ณ ๋ฆฌ์ฆยถ
- Know about the most famous classes of NP-complete problems, such as traveling salesman and the knapsack problem,
and be able to recognize them when an interviewer asks you them in disguise. - Know what NP-complete means.
- Computational Complexity (video)
- Simonson:
- Skiena:
- Complexity: P, NP, NP-completeness, Reductions (video)
- Complexity: Approximation Algorithms (video)
- Complexity: Fixed-Parameter Algorithms (video)
- Peter Norvig discusses near-optimal solutions to traveling salesman problem:
- Pages 1048 - 1140 in CLRS if you have it.
์ปดํจํฐ๊ฐ ํ๋ก๊ทธ๋จ์ ์ฒ๋ฆฌํ๋ ๋ฐฉ์ยถ
- How CPU executes a program (video)
- How computers calculate - ALU (video)
- Registers and RAM (video)
- The Central Processing Unit (CPU) (video)
- Instructions and Programs (video)
์บ์ยถ
- LRU cache:
- CPU cache:
ํ๋ก์ธ์ค์ ์ฐ๋ ๋ยถ
- Computer Science 162 - Operating Systems (25 videos):
- for processes and threads see videos 1-11
- Operating Systems and System Programming (video)
- What Is The Difference Between A Process And A Thread?
- ์์ ๋์ด์ผ ํ ๊ฒ:
- ํ๋ก์ธ์ค, ์ฐ๋ ๋, ๋์์ฑ ๋ฌธ์ ๋ค
- ํ๋ก์ธ์ค์ ์ฐ๋ ๋์ ์ฐจ์ด์
- ํ๋ก์ธ์ค
- ์ฐ๋ ๋
- ๋ฝ(Locks)
- ๋ฎคํ ์ค(Mutexes)
- ์ธ๋งํฌ์ด(Semaphores)
- Monitors
- ๊ฐ๊ฐ์ด ์ด๋ป๊ฒ ๋์ํ๋์ง?
- ๋ฐ๋๋ฝ(Deadlock)
- ๋ผ์ด๋ธ๋ฝ(Livelock)
- CPU activity, ์ธํฐ๋ฝํธ(interrupts), ๋ฌธ๋งฅ ๊ตํ(context switching)
- Modern concurrency constructs with multicore processors
- Paging, segmentation and virtual memory (video)
- Interrupts (video)
- Process resource needs (memory: code, static storage, stack, heap, and also file descriptors, i/o)
- Thread resource needs (shares above (minus stack) with other threads in the same process but each has its own pc, stack counter, registers, and stack)
- Forking is really copy on write (read-only) until the new process writes to memory, then it does a full copy.
- Context switching
- How context switching is initiated by the operating system and underlying hardware?
- threads in C++ (series - 10 videos)
- CS 377 Spring โ14: Operating Systems from University of Massachusetts
- concurrency in Python (videos):
ํ ์คํธยถ
- ์์ ๋์ด์ผ ํ ๊ฒ:
- ์ ๋ ํ ์คํธ๋ ์ด๋ป๊ฒ ์๋ํ๋์ง
- mock object ๋ ๋ฌด์์ธ์ง
- ํตํฉ ํ ์คํธ๋ ๋ฌด์์ธ์ง
- ์์กด์ฑ ์ฃผ์ ์ ๋ฌด์์ธ์ง
- James Bach๊ณผ ํจ๊ปํ๋ ์ ์์ผ ์ํํธ์จ์ด ํ ์คํธ (๋น๋์ค)
- ์ํํธ์จ์ด ํ ์คํธ์ ๋ํ James Bach์ ๋ฌด๋ฃ ๊ฐ์ (๋น๋์ค)
- Steve Freeman - Test-Driven ๊ฐ๋ฐ (์ด๊ฒ์ ์ฐ๋ฆฌ๊ฐ ์๋ฏธํ๋ ๊ฒ์ ์๋๋ค) (๋น๋์ค)
- ์์กด์ฑ ์ฃผ์ :
- ํ ์คํธ ์ด๋ป๊ฒ ์์ฑํ๋์ง
๋ฌธ์์ด ๊ฒ์ & ์กฐ์ยถ
- Sedgewick - Suffix Arrays (video)
- Sedgewick - Substring Search (videos)
-
Search pattern in text (video)
์ด ์ฃผ์ ๋ฅผ ๋ ์์ธํ ์๊ณ ์ถ์ผ์๋ค๋ฉด, ๋ช๋ช ์ฃผ์ ์ ๋ํ ์ธ๋ถ์ฌํญ์์ โ๋ฌธ์์ด ๋งค์นญโ ์น์ ์ ์ฝ์ด๋ณด์ธ์.
ํธ๋ผ์ดยถ
- ํธ๋ผ์ด์๋ ์ฌ๋ฌ ์ข ๋ฅ๊ฐ ์๋ค๋ ๊ฒ์ ์ ์ํ๋ผ. ์ด๋ค ๊ฑด ์ ๋์ฌ๊ฐ ์๋ ๋ฐ, ์ด๋ค ๊ฑด ๊ทธ๋ ์ง ์๊ณ ๋ ์ด๋ค ๊ฒ์ ๊ฒฝ๋ก ์ถ์ ์ ์ํด ๋นํธ ๋์ ์ ๋ฌธ์์ด์ ์ฌ์ฉํ๋ค.
- ๋๋ ์ฝ๋๋ง ์ฝ์๊ณ , ๊ตฌํ์ ์ ํ๋ค.
- Sedgewick - Tries (3 videos)
- Notes on Data Structures and Programming Techniques
- Short course videos:
- The Trie: A Neglected Data Structure
- TopCoder - Using Tries
- Stanford Lecture (real world use case) (video)
- MIT, Advanced Data Structures, Strings (can get pretty obscure about halfway through)
๋ถ๋ ์์์ ยถ
- simple 8-bit: Representation of Floating Point Numbers - 1 (video - there is an error in calculations - see video description)
- 32 bit: IEEE754 32-bit floating point binary (video)
์ ๋์ฝ๋ยถ
- The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets
- What Every Programmer Absolutely, Positively Needs To Know About Encodings And Character Sets To Work With Text
Endiannessยถ
- Big And Little Endian
- Big Endian Vs Little Endian (video)
- Big And Little Endian Inside/Out (video)
- Very technical talk for kernel devs. Donโt worry if most is over your head.
- The first half is enough.
๋คํธ์ํฌยถ
- ๋ง์ฝ ๋น์ ์ด ๋คํธ์ํฌ์ ๋ํ ๊ฒฝํ์ด ์๊ฑฐ๋ operations engineer ๋๋ ๋ฏฟ์์งํ ์์ง๋์ด๊ฐ ๋๊ณ ์ถ๋ค๋ฉด ๋ฐ์ ์ ์๋ ์ง๋ฌธ๋ค
- ์ฆ, ์๋ฉด ์ข์ ๊ฒ๋ค์ด๋ค.
- Khan Academy
- UDP and TCP: Comparison of Transport Protocols
- TCP/IP and the OSI Model Explained!
- Packet Transmission across the Internet. Networking & TCP/IP tutorial.
- HTTP
- SSL and HTTPS
- SSL/TLS
- HTTP 2.0
- Video Series (21 videos)
- Subnetting Demystified - Part 5 CIDR Notation
- ์์ผ:
์์คํ ๋์์ธ, ํ์ฅ์ฑ, ๋ฐ์ดํฐ ํธ๋ค๋งยถ
- 4๋ ์ด์์ ๊ฒฝ๋ ฅ์๋ผ๋ฉด ์ด๋ฐ ์์คํ ๋์์ธ ์ง๋ฌธ๋ค์ ๋ฐ์ ์ ์๋ค.
- Scalability and System Design are very large topics with many topics and resources, since
there is a lot to consider when designing a software/hardware system that can scale.
Expect to spend quite a bit of time on this. - ๊ณ ๋ ค์ฌํญ:
- scalability
- Distill large data sets to single values
- Transform one data set to another
- Handling obscenely large amounts of data
- system design
- features sets
- interfaces
- class hierarchies
- designing a system under certain constraints
- simplicity and robustness
- tradeoffs
- performance analysis and optimization
- ์ฌ๊ธฐ์ ์์ํ์ธ์: The System Design Primer
- System Design from HiredInTech
- How Do I Prepare To Answer Design Questions In A Technical Inverview?
- 8 Things You Need to Know Before a System Design Interview
- Algorithm design
- Database Normalization - 1NF, 2NF, 3NF and 4NF (video)
- System Design Interview - ์ฌ๊ธฐ์ ๋ฆฌ์์ค๊ฐ ์ ๋ง ๋ง์ด ์์ต๋๋ค. ๊ธ๊ณผ ์์ ๋ค์ ์ดํด๋ณด์ธ์. ์ผ๋ถ๋ ์๋์๋ ์ ์ด๋์์ต๋๋ค.
- How to ace a systems design interview
- Numbers Everyone Should Know
- How long does it take to make a context switch?
- Transactions Across Datacenters (video)
- A plain English introduction to CAP Theorem
- Consensus Algorithms:
- Paxos - Paxos Agreement - Computerphile (video)
- Raft - An Introduction to the Raft Distributed Consensus Algorithm (video)
- Consistent Hashing
- NoSQL Patterns
- Scalability:
- Great overview (video)
- Short series:
- Scalable Web Architecture and Distributed Systems
- Fallacies of Distributed Computing Explained
- Pragmatic Programming Techniques
- Jeff Dean - Building Software Systems At Google and Lessons Learned (video)
- Introduction to Architecting Systems for Scale
- Scaling mobile games to a global audience using App Engine and Cloud Datastore (video)
- How Google Does Planet-Scale Engineering for Planet-Scale Infra (video)
- The Importance of Algorithms
- Sharding
- Scale at Facebook (2009)
- Scale at Facebook (2012), โBuilding for a Billion Usersโ (video)
- Engineering for the Long Game - Astrid Atkinson Keynote(video)
- 7 Years Of YouTube Scalability Lessons In 30 Minutes
- How PayPal Scaled To Billions Of Transactions Daily Using Just 8VMs
- How to Remove Duplicates in Large Datasets
- A look inside Etsyโs scale and engineering culture with Jon Cowie (video)
- What Led Amazon to its Own Microservices Architecture
- To Compress Or Not To Compress, That Was Uberโs Question
- Asyncio Tarantool Queue, Get In The Queue
- When Should Approximate Query Processing Be Used?
- Googleโs Transition From Single Datacenter, To Failover, To A Native Multihomed Architecture
- Spanner
- Machine Learning Driven Programming: A New Programming For A New World
- The Image Optimization Technology That Serves Millions Of Requests Per Day
- A Patreon Architecture Short
- Tinder: How Does One Of The Largest Recommendation Engines Decide Who Youโll See Next?
- Design Of A Modern Cache
- Live Video Streaming At Facebook Scale
- A Beginnerโs Guide To Scaling To 11 Million+ Users On Amazonโs AWS
- How Does The Use Of Docker Effect Latency?
- A 360 Degree View Of The Entire Netflix Stack
- Latency Is Everywhere And It Costs You Sales - How To Crush It
- Serverless (very long, just need the gist)
- What Powers Instagram: Hundreds of Instances, Dozens of Technologies
- Cinchcast Architecture - Producing 1,500 Hours Of Audio Every Day
- Justin.Tvโs Live Video Broadcasting Architecture
- Playfishโs Social Gaming Architecture - 50 Million Monthly Users And Growing
- TripAdvisor Architecture - 40M Visitors, 200M Dynamic Page Views, 30TB Data
- PlentyOfFish Architecture
- Salesforce Architecture - How They Handle 1.3 Billion Transactions A Day
- ESPNโs Architecture At Scale - Operating At 100,000 Duh Nuh Nuhs Per Second
- See โMessaging, Serialization, and Queueing Systemsโ way below for info on some of the technologies that can glue services together
- Twitter:
- For even more, see โMining Massive Datasetsโ video series in the Video Series section.
- Practicing the system design process: Here are some ideas to try working through on paper, each with some documentation on how it was handled in the real world:
- review: The System Design Primer
- System Design from HiredInTech
- cheat sheet
- flow:
1. Understand the problem and scope:
- define the use cases, with interviewerโs help
- suggest additional features
- remove items that interviewer deems out of scope
- assume high availability is required, add as a use case
2. Think about constraints:
- ask how many requests per month
- ask how many requests per second (they may volunteer it or make you do the math)
- estimate reads vs. writes percentage
- keep 80/20 rule in mind when estimating
- how much data written per second
- total storage required over 5 years
- how much data read per second
3. Abstract design:
- layers (service, data, caching)
- infrastructure: load balancing, messaging
- rough overview of any key algorithm that drives the service
- consider bottlenecks and determine solutions - Exercises:
์ต์ข ๊ฒํ ยถ
์ด ์น์
์๋ ์ค์ํ ๊ฐ๋
๋ค์ ๋น ๋ฅด๊ฒ ๊ฒํ ํ ์ ์๋ ์งง์ ์์๋ค์ด ํฌํจ๋์ด ์๋ค.
๋ณต์ต์ ํ๊ณ ์ ํ๋ค๋ฉด, ์ด ์์๋ค์ด ๋์์ด ๋ ๊ฒ์ด๋ค.
- 2-3๋ถ ๋ถ๋์ ์ฃผ์ ๋ณ ์งง์ ์์ ์๋ฆฌ์ฆ (23 videos)
- Videos
- 2-5๋ถ ๋ถ๋์ ์ฃผ์ ๋ณ ์งง์ ์์ ์๋ฆฌ์ฆ - Michael Sambol (38 videos):
- Videos
- Sedgewick Videos - Algorithms I
- Sedgewick Videos - Algorithms II
Additional Booksยถ
์๋๋ ๋น์ ์ด ํฅ๋ฏธ๋ก์ํ๋ ์ฃผ์ ์ ๋ํด ๊ณต๋ถํ ์ ์๋ ์๋ฃ๋ค์
๋๋ค.
- The Unix Programming Environment
- an oldie but a goodie
- The Linux Command Line: A Complete Introduction
- a modern option
- TCP/IP Illustrated Series
- Head First Design Patterns
- a gentle introduction to design patterns
- Design Patterns: Elements of Reusable Object-Orienteโd Software
- aka the โGang Of Fourโ book, or GOF
- the canonical design patterns book
- UNIX and Linux System Administration Handbook, 5th Edition
- Algorithm Design Manual (Skiena)
- As a review and problem recognition
- The algorithm catalog portion is well beyond the scope of difficulty youโll get in an interview.
- This book has 2 parts:
- class textbook on data structures and algorithms
- pros:
- is a good review as any algorithms textbook would be
- nice stories from his experiences solving problems in industry and academia
- code examples in C
- cons:
- can be as dense or impenetrable as CLRS, and in some cases, CLRS may be a better alternative for some subjects
- chapters 7, 8, 9 can be painful to try to follow, as some items are not explained well or require more brain than I have
- donโt get me wrong: I like Skiena, his teaching style, and mannerisms, but I may not be Stony Brook material.
- algorithm catalog:
- this is the real reason you buy this book.
- about to get to this part. Will update here once Iโve made my way through it.
- Can rent it on kindle
- Answers:
- Errata
- Write Great Code: Volume 1: Understanding the Machine
- The book was published in 2004, and is somewhat outdated, but itโs a terrific resource for understanding a computer in brief.
- The author invented HLA, so take mentions and examples in HLA with a grain of salt. Not widely used, but decent examples of what assembly looks like.
- These chapters are worth the read to give you a nice foundation:
- Chapter 2 - Numeric Representation
- Chapter 3 - Binary Arithmetic and Bit Operations
- Chapter 4 - Floating-Point Representation
- Chapter 5 - Character Representation
- Chapter 6 - Memory Organization and Access
- Chapter 7 - Composite Data Types and Memory Objects
- Chapter 9 - CPU Architecture
- Chapter 10 - Instruction Set Architecture
- Chapter 11 - Memory Architecture and Organization
- Introduction to Algorithms
- Important: Reading this book will only have limited value. This book is a great review of algorithms and data structures, but wonโt teach you how to write good code. You have to be able to code a decent solution efficiently.
-
aka CLR, sometimes CLRS, because Stein was late to the game
-
Computer Architecture, Sixth Edition: A Quantitative Approach
-
For a richer, more up-to-date (2017), but longer treatment
- The first couple of chapters present clever solutions to programming problems (some very old using data tape) but
that is just an intro. This a guidebook on program design and architecture.
Additional Learningยถ
๋๋ฃจ ๊ฐ์ถ ์ํํธ์จ์ด ์์ง๋์ด๊ฐ ๋๋๋ฐ ๋์์ด ๋ ๋งํ ๊ฒ๋ค์ ์ถ๊ฐํ์ต๋๋ค. ์ด๋ฅผ ํตํด ๋ ํฐ ๋๊ตฌ๋ค์ ๋ค๋ฃจ์ค ์ ์๊ฒ ๋์ค ๊ฒ๋๋ค.
-
Compilersยถ
- How a Compiler Works in ~1 minute (video)
- Harvard CS50 - Compilers (video)
- C++ (video)
-
Emacs and vi(m)ยถ
- Familiarize yourself with a unix-based code editor
- vi(m):
-
emacs:
- Basics Emacs Tutorial (video)
- set of 3 (videos):
- Emacs Tutorial (Beginners) -Part 1- File commands, cut/copy/paste, cursor commands
- Emacs Tutorial (Beginners) -Part 2- Buffer management, search, M-x grep and rgrep modes
- Emacs Tutorial (Beginners) -Part 3- Expressions, Statements, ~/.emacs file and packages
- Evil Mode: Or, How I Learned to Stop Worrying and Love Emacs (video)
- Writing C Programs With Emacs
-
Unix command line toolsยถ
- I filled in the list below from good tools.
- bash
- cat
- grep
- sed
- awk
- curl or wget
- sort
- tr
- uniq
- strace
-
Information theory (videos)ยถ
- Khan Academy
- More about Markov processes:
-
See more in MIT 6.050J Information and Entropy series below.
-
Parity & Hamming Code (videos)ยถ
- Intro
- Parity
- Hamming Code:
-
Entropyยถ
- also see videos below
- make sure to watch information theory videos first
-
Information Theory, Claude Shannon, Entropy, Redundancy, Data Compression & Bits (video)
-
Cryptographyยถ
- also see videos below
- make sure to watch information theory videos first
- Khan Academy Series
- Cryptography: Hash Functions
-
Compressionยถ
- make sure to watch information theory videos first
- Computerphile (videos):
- Compressor Head videos
-
Computer Securityยถ
-
Garbage collectionยถ
- GC in Python (video)
- Deep Dive Java: Garbage Collection is Good!
-
Parallel Programmingยถ
- Coursera (Scala)
-
Efficient Python for High Performance Parallel Computing (video)
-
Messaging, Serialization, and Queueing Systemsยถ
- Thrift
- Protocol Buffers
- gRPC
- Redis
- Amazon SQS (queue)
- Amazon SNS (pub-sub)
- RabbitMQ
- Celery
- ZeroMQ
- ActiveMQ
- Kafka
- MessagePack
-
A*ยถ
- A Search Algorithm
- A* Pathfinding Tutorial (video)
-
Fast Fourier Transformยถ
- An Interactive Guide To The Fourier Transform
- What is a Fourier transform? What is it used for?
- What is the Fourier Transform? (video)
- Divide & Conquer: FFT (video)
-
Bloom Filterยถ
- Given a Bloom filter with m bits and k hashing functions, both insertion and membership testing are O(k)
- Bloom Filters
- Bloom Filters | Mining of Massive Datasets | Stanford University
- Tutorial
-
HyperLogLogยถ
-
How To Count A Billion Distinct Objects Using Only 1.5KB Of Memory
-
Locality-Sensitive Hashingยถ
- used to determine the similarity of documents
- the opposite of MD5 or SHA which are used to determine if 2 documents/strings are exactly the same.
-
van Emde Boas Treesยถ
- Divide & Conquer: van Emde Boas Trees (video)
-
Augmented Data Structuresยถ
-
Balanced search treesยถ
- ์ ์ด๋ ํ๋์ ํ์ ์ ๊ท ํ ์ด์ง ํธ๋ฆฌ์ ๋ํ์ฌ ์๊ณ ๊ณ์๋ ๊ฒ ์ข์ต๋๋ค (๊ทธ๋ฆฌ๊ณ ์ด๋ป๊ฒ ์ ์ฉ๋๋์ง๊น์ง์):
- โAmong balanced search trees, AVL and 2/3 trees are now passรฉ, and red-black trees seem to be more popular.
A particularly interesting self-organizing data structure is the splay tree, which uses rotations
to move any accessed key to the root.โ - Skiena - Of these, I chose to implement a splay tree. From what Iโve read, you wonโt implement a
balanced search tree in your interview. But I wanted exposure to coding one up
and letโs face it, splay trees are the beeโs knees. I did read a lot of red-black tree code.- splay tree: insert, search, delete functions
If you end up implementing red/black tree try just these: - search and insertion functions, skipping delete
- splay tree: insert, search, delete functions
- I want to learn more about B-Tree since itโs used so widely with very large data sets.
- Self-balancing binary search tree
AVL treesยถ
- In practice:
From what I can tell, these arenโt used much in practice, but I could see where they would be:
The AVL tree is another structure supporting O(log n) search, insertion, and removal. It is more rigidly
balanced than redโblack trees, leading to slower insertion and removal but faster retrieval. This makes it
attractive for data structures that may be built once and loaded without reconstruction, such as language
dictionaries (or program dictionaries, such as the opcodes of an assembler or interpreter). - MIT AVL Trees / AVL Sort (video)
- AVL Trees (video)
- AVL Tree Implementation (video)
- Split And Merge
Splay treesยถ
- In practice:
Splay trees are typically used in the implementation of caches, memory allocators, routers, garbage collectors,
data compression, ropes (replacement of string used for long text strings), in Windows NT (in the virtual memory,
networking and file system code) etc. - CS 61B: Splay Trees (video)
- MIT Lecture: Splay Trees:
- Gets very mathy, but watch the last 10 minutes for sure.
- Video
2-3 search treesยถ
- In practice:
2-3 trees have faster inserts at the expense of slower searches (since height is more compared to AVL trees). - You would use 2-3 tree very rarely because its implementation involves different types of nodes. Instead, people use Red Black trees.
- 23-Tree Intuition and Definition (video)
- Binary View of 23-Tree
-
2-3-4 Trees (aka 2-4 trees)
- In practice:
For every 2-4 tree, there are corresponding redโblack trees with data elements in the same order. The insertion and deletion
operations on 2-4 trees are also equivalent to color-flipping and rotations in redโblack trees. This makes 2-4 trees an
important tool for understanding the logic behind redโblack trees, and this is why many introductory algorithm texts introduce
2-4 trees just before redโblack trees, even though 2-4 trees are not often used in practice. - CS 61B Lecture 26: Balanced Search Trees (video)
- Bottom Up 234-Trees (video)
- Top Down 234-Trees (video)
- In practice:
-
N-ary (K-ary, M-ary) trees
- note: the N or K is the branching factor (max branches)
- binary trees are a 2-ary tree, with branching factor = 2
- 2-3 trees are 3-ary
- K-Ary Tree
-
B-Trees
- ์ฌ๋ฐ๋ ์ฌ์ค: itโs a mystery, but the B could stand for Boeing, Balanced, or Bayer (co-inventor)
- In Practice:
B-ํธ๋ฆฌ๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ๊ด๋ฒ์ํ๊ฒ ์ฌ์ฉ๋ฉ๋๋ค. ๊ฐ์ฅ ํ๋์ ์ธ ํ์ผ์์คํ ์ B-ํธ๋ฆฌ๋ฅผ ์๋๋ค (or Variants).
๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ฌ์ฉ๋ ๋ฟ๋ง ์๋๋ผ, B-ํธ๋ฆฌ๋ ํน์ ํ ํ์ผ์ ์์์ ๋ธ๋ก์ โ๋น ๋ฅธ ๋ฌด์์ ํ์โ์ ๊ฐ๋ฅํ๊ฒ ํฉ๋๋ค.
๊ธฐ๋ณธ์ ์ธ ๋ฌธ์ ๋ ํ์ผ๋ธ๋ก ์ฃผ์ i๋ฅผ ํ๋์ ๋์คํฌ ๋ธ๋ก(๋๋ ์๋ง๋ ์ค๋ฆฐ๋-ํค๋-์นํฐ) ์ฃผ์๋ก ๋ฐ๊พธ๋ ๊ฒ์ ๋๋ค. - B-Tree
- B-Tree Definition and Insertion (video)
- Introduction to B-Trees (video)
- B-Tree Deletion (video)
- MIT 6.851 - Memory Hierarchy Models (video)
- covers cache-oblivious B-Trees, very interesting data structures
- the first 37 minutes are very technical, may be skipped (B is block size, cache line size)
-
k-D Treesยถ
- great for finding number of points in a rectangle or higher dimension object
- a good fit for k-nearest neighbors
- Kd Trees (video)
-
Skip listsยถ
- โThese are somewhat of a cult data structureโ - Skiena
- Randomization: Skip Lists (video)
-
Network Flowsยถ
- Ford-Fulkerson in 5 minutes โ Step by step example (video)
- Ford-Fulkerson Algorithm (video)
-
Disjoint Sets & Union Findยถ
- UCB 61B - Disjoint Sets; Sorting & selection (video)
-
Math for Fast Processingยถ
- Integer Arithmetic, Karatsuba Multiplication (video)
-
The Chinese Remainder Theorem (used in cryptography) (video)
-
Treapยถ
- Combination of a binary search tree and a heap
- Treap
- Data Structures: Treaps explained (video)
-
Linear Programming (videos)ยถ
- Linear Programming
- Finding minimum cost
- Finding maximum value
-
Geometry, Convex hull (videos)ยถ
- Graph Alg. IV: Intro to geometric algorithms - Lecture 9
- Geometric Algorithms: Graham & Jarvis - Lecture 10
-
์ด์ฐ์ํยถ
-
์๋์ ์๋ ์์์ ํ์ธํ์ธ์.
-
๊ธฐ๊ณํ์ตยถ
- ์ ๊ธฐ๊ณํ์ต์ด ์ค์ํ์ฃ ?
- Googleโs Cloud Machine learning tools (video)
- Google Developersโ Machine Learning Recipes (Scikit Learn & Tensorflow) (video)
- Tensorflow (video)
- Tensorflow Tutorials
- Practical Guide to implementing Neural Networks in Python (using Theano)
- ๊ฐ์๋ค:
- Great starter course: Machine Learning
- videos only
- see videos 12-18 for a review of linear algebra (14 and 15 are duplicates) - Neural Networks for Machine Learning
- Googleโs Deep Learning Nanodegree
- Google/Kaggle Machine Learning Engineer Nanodegree
- Self-Driving Car Engineer Nanodegree
- Great starter course: Machine Learning
- ์๋ฃ๋ค:
๋ช๋ช ์ฃผ์ ์ ๋ํ ์ธ๋ถ์ฌํญยถ
์ด๋ฏธ ์ธ๊ธํ ๋ช๋ช์ ๊ฐ๋
์ ๋ํ ์ค๋ช
์ ์ข ๋ ๋ณด๊ฐํ๊ธฐ ์ํด์ ์ ์์ต๋๋ค.
ํ์ง๋ง ๋ํ๊ธธ ์ํ์ง ์์์ด์. ์๋๋ฉด ๊ทธ ์์ด ๋๋ฌด๋ ๋ฐฉ๋ํ๊ธฐ ๋๋ฌธ์ด์ง์.
ํ๋์ ์ฃผ์ ์ ๋ํ์ฌ ์ง๋์น๊ฒ ๊น๊ฒ ํ๊ณ ๋๋ ๊ฒ์ ์ฌ์ด ์ผ์
๋๋ค.
์ด๋ฒ ์ธ๊ธฐ์ ์ง์ฅ์ ๊ตฌํ๊ณ ์ถ์ผ์์์์, ๋ง์ฃ ?
- SOLID
- Bob Martin SOLID Principles of Object Oriented and Agile Design (video)
- S - Single Responsibility Principle | Single responsibility to each Object
- O - Open/Closed Principal | On production level Objects are ready for extension but not for modification
- L - Liskov Substitution Principal | Base Class and Derived class follow โIS Aโ principal
- I - Interface segregation principle | clients should not be forced to implement interfaces they donโt use
-
D -Dependency Inversion principle | Reduce the dependency In composition of objects.
-
Union-Find
- Overview
- Naive Implementation
- Trees
- Union By Rank
- Path Compression
-
More Dynamic Programming (videos)
- 6.006: Dynamic Programming I: Fibonacci, Shortest Paths
- 6.006: Dynamic Programming II: Text Justification, Blackjack
- 6.006: DP III: Parenthesization, Edit Distance, Knapsack
- 6.006: DP IV: Guitar Fingering, Tetris, Super Mario Bros.
- 6.046: Dynamic Programming & Advanced DP
- 6.046: Dynamic Programming: All-Pairs Shortest Paths
-
Advanced Graph Processing (videos)
- Synchronous Distributed Algorithms: Symmetry-Breaking. Shortest-Paths Spanning Trees
-
Asynchronous Distributed Algorithms: Shortest-Paths Spanning Trees
-
MIT Probability (mathy, and go slowly, which is good for mathy things) (videos):
- MIT 6.042J - Probability Introduction
- MIT 6.042J - Conditional Probability
- MIT 6.042J - Independence
- MIT 6.042J - Random Variables
- MIT 6.042J - Expectation I
- MIT 6.042J - Expectation II
- MIT 6.042J - Large Deviations
-
**๋ฌธ์์ด ๋งค์นญ
- ๋ผ๋น-์นดํ(Rabin-Karp) (๋์์):
- Knuth-Morris-Pratt (KMP):
- ๋ณด์ด์ด-๋ฌด์ด(BoyerโMoore) ๋ฌธ์์ด ๊ฒ์ ์๊ณ ๋ฆฌ์ฆ
-
Coursera: Algorithms on Strings
- starts off great, but by the time it gets past KMP it gets more complicated than it needs to be
- ํธ๋ผ์ด(tries)์ ๋ํด์ ์ ์ค๋ช ํ๊ณ ์๋ค.
- ์ด๊ฑด ์๋ต ๊ฐ๋ฅ
-
์ ๋ ฌ
-
์คํ ํฌ๋ ๋ํ์ ์ ๋ ฌ ๊ฐ์๋ค:
- Shai Simonson, Aduni.org:
- Steven Skiena lectures on sorting:
Video Seriesยถ
ํธํ๊ฒ ๋ณด์ธ์. โNetflix and skillโ์ด๋ผ๋๊น์ :P
-
List of individual Dynamic Programming problems (each is short)
-
Excellent - MIT Calculus Revisited: Single Variable Calculus
-
Computer Science 70, 001 - Spring 2015 - Discrete Mathematics and Probability Theory
-
CSE373 - Analysis of Algorithms (25 videos)
-
UC Berkeley CS 152: Computer Architecture and Engineering (20 videos) -
Carnegie Mellon - Computer Architecture Lectures (39 videos)
-
MIT 6.042J: Mathematics for Computer Science, Fall 2010 (25 videos)
-
MIT 6.050J: Information and Entropy, Spring 2008 (19 videos)
์ปดํจํฐ ๊ณผํ ๊ฐ์๋คยถ
ํ์ ์๋ฃ๋คยถ
- Love classic papers?
- 1978: Communicating Sequential Processes
- implemented in Go
- 2003: The Google File System
- replaced by Colossus in 2012
- 2004: MapReduce: Simplified Data Processing on Large Clusters
- mostly replaced by Cloud Dataflow?
- 2006: Bigtable: A Distributed Storage System for Structured Data
- An Inside Look at Google BigQuery
- 2006: The Chubby Lock Service for Loosely-Coupled Distributed Systems
- 2007: Dynamo: Amazonโs Highly Available Key-value Store
- The Dynamo paper kicked off the NoSQL revolution
- 2007: What Every Programmer Should Know About Memory (very long, and the author encourages skipping of some sections)
- 2010: Dapper, a Large-Scale Distributed Systems Tracing Infrastructure
- 2010: Dremel: Interactive Analysis of Web-Scale Datasets
- 2012: Googleโs Colossus
- paper not available
- 2012: AddressSanitizer: A Fast Address Sanity Checker:
- paper
- video
- 2013: Spanner: Googleโs Globally-Distributed Database:
- paper
- video
- 2014: Machine Learning: The High-Interest Credit Card of Technical Debt
- 2015: Continuous Pipelines at Google
- 2015: High-Availability at Massive Scale: Building Googleโs Data Infrastructure for Ads
- 2015: TensorFlow: Large-Scale Machine Learning on Heterogeneous Distributed Systems
- 2015: How Developers Search for Code: A Case Study
- 2016: Borg, Omega, and Kubernetes
์์ฑ์ผ : 2023๋ 4์ 2์ผ