Notes for JS based data structures, algorithms, and technical interviews.
4/13/22
4/14/22
4/18/22
4/19/22
4/20/22
5/22/22
Don’t forget that when checking for existence! You need to account for the possibility that the value will be zero and therefore return a falsy value.
Every detail of a problem is in there for a reason. Make sure you’re considering all details. They are all hints towards the solution.
You can use the in
operator to check for existence to avoid the problem mentioned above.
5/24/22
9/25/22
ALWAYS ALWAYS use a comparison function with Array.sort() it will return some screwy answers if you don’t!
[-1, 3, -4, 0, 2].sort()
will return [-1, -4, 0, 2, 3]
[[-1, 3, -4, 0, 2].sort((a, b) => a - b)
will return [-4, -1, 0, 2, 3]
Break problems down into their sub-parts. What variables will you need? What logic? What pointers? etc…
10/18/22
Difference between Objects, Maps, and Sets in JS
10/19/22