Technical Interviews: Difference between revisions

No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
==Algorithms==
==Algorithms==
{{main | Interview Algorithms}}
{{main | Interview Algorithms}}
In general, consider the following approaches
* Brute-force and searching
* Dynamic Programming
* Greedy (sorting + take the best at each step)
* Linear searching (with 2 pointers or sliding window)
** Usually the answer if you're searching for a connected segment along an array or string
** E.g. max contiguous subarray
Be familiar with common algorithms and data structures:
;Sorting
* Merge sort
* Quicksort
* Quickselect
* Counting sort
* Radix sort
* Binary search
;Linked-lists
* Doubly linked list, circular linked list
;Trees
* Preorder, inorder, postorder traversal
* AVL rotations
* Union-Find
* Heaps
* Using <code>std::set</code>, <code>std::map</code>, <code>std::priority_queue</code>
;Graphs
* DFS, BFS
* Minimum spanning tree (Prim's or Kruskal's algorithm)
;Hashing
* Using <code>std::unordered_set</code> and <code>std::unordered_map</code>


==Computer Systems==
==Computer Systems==