VMWare Inc Interview Question for Software Engineer / Developers






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

for case 1 the answer is pretty simple and straightforward: Use mergesort...

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

what about case 2 ?
can you explain your approach to case 1.

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

add the element using binary search ...........may be it might not efficient solution.

list one 2 8 5 10
list two 12 5 78 34
take 2,12 compare add so 2, 12
next compare 8,5 and use binary search to add this elements
2 5 8 12 .....

- try for solution August 21, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Are we sure this is an algorithmic question ? May be *nix Operating systems may come handy with its paste and/or join & sort commands. Any suggestions ?

- amit September 25, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

More precisely,
paste -s file1 file2 >file3
sort -k <positionOfWordColumn> file3

could possibly get us sorted data from the two files

- amit September 25, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

1. For case 2, Read all the words into an array
2. Sort the array using quick sort
3. Open a handler to empty file 3, Read words sequentially from file 1.
4. Locate the word using binary search in the sorted array.
5. Copy the line from the file and write it into file 3 at line = array index. i.e if the word is found at array index 25, the line read from file must be written at the 25th line in file 3.

- Suchin October 21, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

thanx for description of an algo

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

Since they are large files there are chances that all the words itself dont fit into memory. So for case 1 you would do just a external merge while for case 2 you would do an external merge sort with the word as the key.

- Anonymous January 07, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

yes we have to use external sort , which divides data in chunks sort it and finally merges it. refer wiki

- raj January 10, 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