personally I think it's more important to know datastructures and their implicit algorithmic constraints.
For example: time ranges what is the most efficient datastructure and why ?
A sorted Array with binary search has O(log(n)) for lookup O(1) to check it's siblings but the insert will take O(n). To understand those basics in a common app scenario is more important that knowing the huffman compression.
So the next thing should be sorting algorithms but not by heart more about space and time complexity and that there is a difference.
And after that you have A* path finding ofc and so on but those are specialized ones the datastructures are basics and the sorts are basics.
Even Sort we could argue about if we need to know all of their attributes. But still you're more likely to get confronted with those than with others.
As soon as we go to graphs things get more interesting but this already breakes the scope of 10 because every datastructure has at least CRUD so there are 4 algorithms per structure. > 10
I reckon there is no need to know algorithms by heart, I mean its rather good to know which algorithm you need to use for the particular issue. If you know that you can look up easier in the search engines for your solution.
Honestly, there is no need to by heart any algorithm. Certainly, you must know them but, its OK if you forget some. The important part is to know data structures and given a question i.e. now you have to write an algorithm, you must, exactly know, which is the most efficient data structure for this problem. Once you solve the problem you can verify your algorithm (for complexity analysis) with an existing solution.
Marco Alka
Software Engineer, Technical Consultant & Mentor
I do not think that you should know any algorithm by heart.
1) The algorithms would heavily depend on your day-to-day business &
2) We have google.
Additionally, someone might come up with a better algorithm, or you might know an algorithm, which kinda fits the problem, but there is one out there in the internet which fits your problem 100%. That's why I think, when you need an algorithm, you should always first consult the internet and books, make a list with all applicable algorithms and then decide based on advantages, disadvantages, complexity and benchmarks.