Apple Question:

Download Job Interview Questions and Answers PDF

Do you know Which sorting algo you would like to implement as unix library and why?

Apple Interview Question
Apple Interview Question

Answer:

I think more than the answer, the reason would be important. Quick sort for example is important because its average runtime is O(nlog(n)) and in most cases its better than other logarithmic algorithms ( Merge Sort and Heap Sort ). I would ask him though, why would you want to stop at implementing just one algorithm. How about an API that can use sort based on input size ( strategy design pattern ); because for different values of n different sorting algorithms can be usefule

Download Apple Interview Questions And Answers PDF

Previous QuestionNext Question
How to design spotlight search feature in Mac OS?Write a function:
char * CreateEmptyString(int len);

function should return an pointer to an empty string of length len