We pay for user submitted tutorials and articles that we publish. Anyone can send in a contributionLearn More
The sixth of the series of programming job interview challenge is out. Other then commenting the solution, I remind you that you can post the solution on your blog and get a link next week!
Here is the solution to the previous challenge:
Two-way merge sort (External Sorting) : The idea is breaking the big file into subfiles, sorting them and than merging them back together. In the first pass read one page at a time, the records in the page are sorted (quicksort for example) and the page is written back to disk. in subsequent passes, each pair of sorted output from the previous pass are read and merged to produce sorted subfile twice as long:
1. Read each page, Sort it, Write it back
2. while more than one sorted subfile:
while subfiles from previous pass left to merge:
- Choose next two subfiles from previous pass
- Read each subfile into a memory page (one page at a time)
- Merge the subfiles (remember each of them is already sorted), write output to a memory page
- Write output page to disk when needed.
This is the fifth challenge in the series of programming job interview challenge. As usual, we’ll provide an answer to the previous challenge and give you a new challenge to keep you busy this week. Other then commenting the solution, I remind you that you can post the solution on your blog and let us know about it [...]
This is the fourth post in the series of programming job interview challenge. Today, I will provide the answer to job interview challenge #3, talk about readers answers (all of the comments are now approved) and give you a new challenge. So, lets get into business:
The correct answer to challenge #3:
This post is third in the series of programming job interview challenge, if you are not yet familiar with these series please take your time and read:
Well, last weeks challenge was very successful, all of the comments which contain answers to the question are now approved and can be viewed in challenge #2 post.
Last week I posted A Programming Job Interview Challenge which was very successful, both in the amount of page views and, in the amount of comments and mails we received. This fact made us (the Dev102 team) decide to add a weekly programming job interview challenge column to www.Dev102.com.
Copyright © 2012 Dev102.com
Breeze : Designed by Amit Raz and Nitzan Kupererd