You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure you know Computer science [basic data structures](#data-structures-you-should-know). Also you should be aware of [fundamental algorithms](#fundamental-algorithms-you-should-know).
4
+
5
+
### Ask Questions before coding
6
+
7
+
Once they give you problem, don't start coding. Ask clarifying questions to make sure you understand the problem.
8
+
9
+
Example:
10
+
- Will there be null/empty values on input?
11
+
- Will all numbers in a binary tree integers?
12
+
-
13
+
14
+
## What you should prepare?
15
+
16
+
### Big O
17
+
Learn Big O. Make sure you give what would be the `runtime complexity` and `memory complexity`.
18
+
19
+
`Iterative functions` take no extra memory and therefore, `memory complexity` is `constant` O(1).
20
+
`Recursive functions` take extra on the stack therefore, `memory complexity` is `lograrithmic` O(_logn_)
21
+
22
+
### Data Structures you should know
23
+
24
+
- Hash Table
25
+
- Linked List
26
+
- Stack
27
+
- Queue
28
+
- Tree
29
+
- Tries
30
+
- Graphs
31
+
- Vectors
32
+
- Heaps
33
+
34
+
### Fundamental algorithms you should know
35
+
36
+
- Breadth-first search
37
+
- Depth-first search
38
+
- Merge sort
39
+
40
+
## While solving problem
41
+
1
42
## Arrays
2
43
3
44
### Implement Binary Search on a Sorted Array
4
45
46
+
Given a sorted array of integers, return the index of the given key. Return -1 if the key is not found.
47
+
5
48
Run below script
6
49
7
50
```
8
51
node .\src\arrays\binary-search.mjs
9
52
```
10
53
11
54
### Find Maximum in Sliding Window
55
+
56
+
Given a large array of integers and a window of size w, find the current maximum value in the window as the window slides through the entire array.
0 commit comments