Skip to content

Commit 9ee861a

Browse files
committed
updated readme
1 parent bdfcf10 commit 9ee861a

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,56 @@
1+
### What you should know before coding interview?
2+
3+
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+
142
## Arrays
243

344
### Implement Binary Search on a Sorted Array
445

46+
Given a sorted array of integers, return the index of the given key. Return -1 if the key is not found.
47+
548
Run below script
649

750
```
851
node .\src\arrays\binary-search.mjs
952
```
1053

1154
### 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

Comments
 (0)