Intuit Interview Question for Senior Software Development Engineers


Country: United States




Comment hidden because of low score. Click to expand.
1
of 1 vote

I was asked the same question in some other interview recently. The above answer won't nearly answer what the interviewer might be looking for. Merge Sort is a stable algorithm where as Quick Sort is not a stable algorithm.

The new point I learnt from the interviewer was, in Java, Collections.sort() method uses both Merge and Quick sort depending on what it's sorting. For example, if Integers are being sorted, then it seems Quick Sort is invoked. If object references are being sorted, then Merge Sort is invoked. And the pattern used here is Delegate.

- None April 03, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

merge sort reserves some space by default. which is not the case with quick sort.
but there is no best case scenario in quick sort. even when the list is sorted the time complexity would be nlog(n).

The choice of algorithm depends on the scenario. If we expect the values to be nearly sorted and space is not a constraint, heap sort it is, else quick sort.

- Anvesh Kumar Mallick September 19, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1.Quick sort is better than Merge sort in terms of space. It does not use additional storage space to perform sorting. In merge sort, to merge the sorted arrays it requires a temporary array means extra storage space.
2. Quick sort 2 3 times faster than any other sorting algo. Even though it's worst case is O(n^2) , it can be easily avoided by choosing right pivot.

- Priyanka K April 20, 2017 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More