HCL America Interview Question for Software Engineer in Tests






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

it would depend on what you would like to sort/resources available etc..

- Anonymous August 10, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

heapsort O(n*log(n)) and it is in place

but the most practical one is quicksort: worst case O(n*n), average O(n*log(n)). It is in place and the costant factor is very small

- karate August 11, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

i think it's merge sort because its complexity is O(n*log(n)) and we need O(n+m) time to merge two sorted vectors

- Anonymous August 12, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think Bubble Sort is the best! Teaches you to be patient. Go Bubble!

Seriously: this is an idiotic question. It all depends on the context, i.e there is no best which works everytime.

- LOLer August 13, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

ABCsort is blazing fast (O(n), and never moves records or keys); its output is an index table of pointers to records. The algorithm is patented by the author, however, who sells examples. It runs about 3* as fast as QuickerSort for 30-character records, for example, and is even faster when implemented in Field Programmable Gate Array HW. Check out my writeup via any search on 'ABCsort'. And oh, yes: sorting on multiple keys at once works nicely on a multiprocessor like a Sparc.

- Lynn Yarbrough February 25, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

quick sort is the best sorting method.

- Anonymous May 22, 2011 | 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