In a past few years I've participated as an interviewer in many technical interviews.



Most of them were for engineering positions(In some cases I needed a new engineer for my team and most of the time I was simply asked to help to another PM/TL).



One of our colleagues has initially set a sort of tradition, which we used to follow, that we should ask a person, who was being interviewed, to write some code using a pen and a sheet of paper.



In most of the cases the guest was asked to write a program, which sorts an incoming array and explain the complexity of the chosen algorithm and provide some thoughts on making it better.



The most interesting thing is that quite a lot of people(especially junior/mid developer and even seniors sometimes) had a problem with accomplishing this task quickly. Some of them even didn't manage to write any workable solution at all.



In the cases when the solution was provided, the person usually had a problem telling pros and cons of the chosen algorithm and explaining the possible alternatives.



The guy, who initially invented asking this question, used to complain after the end of each interview that the invited engineer didn't write QuickSort algorithm and said nothing about the complicity(e.g. O(n^2) for bubble sort).



Well. You know how it is often said that you should never try to reinvent the wheel and must always use the provided by the platform libraries(e.g. Arrays.sort). I think this idea in many cases made some of the developers lazy(or even stupid) and now they are only capable of combining the existing components and tend to forget about the true programming.



I hope I'll never have to work in the same team with developers who can't write their own version of sorting algorithm without touching the computer/asking the Internet.



After a while I decided to refresh my memories in this area and created a simple project to implement several sorting algorithms. This move was also inspired by reading “Effective Java” by Joshua Bloch(I wanted to exercise some of the concepts from the book).


If you are interested, you can find my repo by the following link(I’ve also decided to play with GIT a little bit):


BTW In my opinion, it’s not fair to ask someone to write QuickSort on the interview since this algorithms in not so trivial as it sounds.