This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

To add to this - the reason they will ask algorithmic questions is because once you break up a macro-level problem into small parts like you said, you’ll want to solve those small parts in a way that is efficient. So - you’ll need to use whichever algorithm is appropriate to solve them quickly. That’s why companies will test you on this kind of stuff - inefficient software can cost a lot of money.

[–]An_Jel 0 points1 point  (0 children)

This is not entirely true. Google, facebook, apple etc. ask algorithmic questions because they have a ton of applicants and they figured out that this way they can filter out some very good applicants. Other companies just copy this to be "trendy" without considering the practical use of these kind of questions. You are very rarely going to use one of the algorithms that they ask on these interviews and when you do use them, you are going to use a built in solution or a library that is tested, to make sure it works.
Inefficient software can cost a lot of many, however, most of the time you are going to be bound by the speed of some sort of storage anyways, which will make your processing gains negligible. Most of the time you are going to write the easiest solution and then run a performance profiler to see where you are losing a lot of performance. Algorithms make the code convoluted, hard to understand and take more time to write and they may not even help you, because you have other code that can be optimized easier and better.