Skip to content

Commit 1e63a36

Browse files
authored
Update README.md
1 parent 40183cd commit 1e63a36

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,16 @@
2424
multipleSelect
2525
/>
2626

27+
Technical Chellenge
28+
Initially I used recursion and this was the biggest mistake since js doesn't support tail optimization. When the data becomes too big with many nested level of data. The browser actually will crash.
29+
30+
Solved by:
31+
-> Instead of using recursion, use iteration.
32+
-> To reference node faster, instead of doing a binary search the entire tree, we use hash map with key as id of the node
33+
-> When update state, instead of creating a new version of the data we use the hashmap to update ( since in js object is referenced not copied )
34+
35+
I know this is against data mutation best practice but for performance we must mutate all the way.
36+
37+
38+
39+

0 commit comments

Comments
 (0)