I know you probably know the Merge Sort theory really well. But can you code it up to a working state rn without looking up hints on Google? If yes, please specify your YoE and company name in the comments. TC: 460K
If you can't write a merge sort within a few minutes or so of being told how the algorithm works then wew lad
Lol I'd bet that lots of meta engineers would fail it if it's not tagged meta top 100
Ok
Top down? Easy Bottom up? Nah fuck that
It’s not really related to top down vs. bottom up as there’s no cache or base cases. I believe the words you’re looking for here are recursive vs. iterative.
Can you post TC or GTFO right now without looking it up on Google?
Edited!
If both of these weren’t tattooed into your brain during school, something went wrong
What if you didn’t go to school for cs
What if you are a normal person and forget things?
Those who answered yes, Can you do Shell sort too?
Yes
Nope. The thing about learning sorts is that the ones that are emphasized tend to be used in mainstream programming langauges. Python, java, and c++ actually use variants of merge sort, heap sort, insertion sort, and quick sort, so that's why those 4 tend to be focused. Of course, it's not a coincidence that the selected sorts also tend to be the most useful. https://www.geeksforgeeks.org/know-sorting-algorithm-set-1-sorting-weapons-used-programming-languages/
Merge sort is straightforward. Quicksort is cringe tho
I mean after having to use quickselect so many times in leetcode that one kinda gets imprinted in memory too, innit?
I think for most people quicksort is on the easy side, however if they haven’t gone through the math proof for its complexity that’ll trip some people up explaining why it’s n log(n)
Merge sort is a basic algo you need to be able to do in your sleep.
Joining Amazon and I am a bit worried now.
Yes. Any standard sorting algorithm. Because taking interviews regularly and preparing for taking interviews regularly. L64, MS, 14 yoe
This question should have been for quick sort (YOE 11)
Quicksort heapsort and mergesort are all possible to implement on the fly as long as you have an idea what they are, as the actual code isn’t that bad. I think most people would be likely to miss something like radix or bucket sort due to them not being a part of more common topics.