Interview Question


Country: India




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

a trie of numbers seems to be a better option than external sorting

- anonymous1 May 17, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

external merge sort.

- Anonymous May 09, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

i told the same..but he said time complexity of this will be large..

- shine May 09, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Radix sort with bit array

- gevorgk May 09, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

It says long. So I presume you don't have enough memory in RAM for doing this... Care to elaborate?

- Anonymous May 09, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

It didn't say that there will be ALL long numbers in file. Need to be more clear about possible number of elements and amount of memory. Anyways,if bit array wouldn't fit into memory as well, we may use trie with string representation of those numbers, which I presume should take a lot less memory, since a lot of numbers would have long common prefixes.

- gevorgk May 09, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

use hash to divide the whole large file into many small file,make sure that the same number are in the same small file,then handle the small file independently...

- kurskk141 May 10, 2012 | 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