You are on page 1of 2

# Task Types

1. Array
2. String
- use array or dicts for keeping the count
- use 2 pointers - eg for reversing the string or checking if it is a
palindrome
- char A into int (order in alphabet), convert str number into int
- sliding window
-
3. Hash Table
4. Dynamic Programming
5. Math?
6. Depth-First Search
7. Sorting
8. Greedy?
9. Breadth-First Search
10. Database?
11. Tree
12. Binary Search
13. Matrix

24. Heap (Priority queue)


25. Graph
26. Backtracking
27. Simulation
28. Prefix Sum

# Top Interview Questions

- array
- strings
- linked list
- trees
- sorting and searching
- dynamic programming
- design
- math
- other

# Approaches

## Sliding window pattern

### Static size


- fixed size
- both right and left pointers are moving

### Dynamic size


- right pointer is moving while left one is fixed
- until we reach max size of window
- then right pointer is fixed
- left one is moving - the window shrinks

```
find max sum sequence of size 3 in array
```

## Kadane's algorithm - maximum sum subarray


## Backtracking
https://leetcode.com/problems/target-sum/discuss/455024/DP-IS-EASY!-5-Steps-to-
Think-Through-DP-Questions.

Types of backtracking:
- 0/1 Knapsack
- Unbounded Knapsack
- Shortest Path (eg: Unique Paths I/II)
- Fibonacci Sequence (eg: House Thief, Jump Game)
- Longest Common Substring/Subsequeunce

## Union find
## depth first search
## breadth first search

You might also like