Monday, May 26, 2008

Interview programming challenge 5#

This post gives you answer for the question posted at

http://www.dev102.com/2008/05/26/a-programming-job-interview-challenge-5-records-sorting/

You are asked to sort a collection of records. The records are stored in a file on the disk, and the size of the file is much bigger than available memory you can work with. Assume a record size is 10 bytes and file size is 1GB. you read and write data to/from disk in units of pages where each page is 1KB big. You have few (less than 10) available pages of physical memory. Assume you are given a method to compare two records.

How can you sort the records under the described conditions?

* Hint - Using the virtual memory is not the correct answer.


The appropriate solution for this problem would be to use algorithm based on Insertion Sort



Interview programming challenge 4#

This current post give the solution for a problem given in the following URL,

http://www.dev102.com/2008/05/19/a-programming-job-interview-challenge-4/

How would you implement the following method: Foo(7) = 17 and Foo(17) = 7. Any other input to that method is not defined so you can return anything you want. Just follow those rules:

  • Conditional statements (if, switch, …) are not allowed.
  • Usage of containers (hash tables, arrays, …) are not allowed.
The solution for this question would be as following, the following code is written in java

public int Foo(int x){
return 22^x;
}

Tuesday, May 20, 2008

Buggy Firefox 3.0

There is no question about which is the best browser on the earth, it is obviously, as you know Firefox, at least in the developer point of view. There is no question again about other browser like Opera and Safari, they do better too. It just depends on user's preferences. Here I intentionally left out Internet Explorer. It hurts me a lot daily. Whenever I have to open a link in Outlook 2003, when I click on it, always Internet Explorer tends to pop up, which I really hate.

When Firefox 1.5 was released, I was so excited to see some browser out there to help overcome some grievances that Internet Explorer brought. That was the time, Firefox was the best browser. My happy browsing days started. I recommended all my friends and colleagues to use Firefox browser. My friends who are developers really started liking the way the Firefox behaved. My friends who are not computer literates didn't like the Firefox, the reason is this, they got very much used to Internet Explorer. Anyways, they've got used to Firefox now. It was a kinda sense of achievement that I could influence whole of my developer community to use Firefox browser, including .Net Professionals. :)

Then Firefox 2.0 was released. It introduced few new features, It came with bugs too. None of my friends really liked Firefox 2.0. The reason could be that it brought in few new features, usability was not that great. It was sluggish too. I had to use lot many add-ons to enjoy browsing. There came a sad new that Mozilla is going drop the support for Firefox 1.5. Then all of my colleagues were forced to move to Firefox 2.0.

After few weeks, Mozilla announced Firefox 3.0, it included lot many changes in the browser. Most of them were user friendly features. I was so excited to introduce my friends about Firefox 3.0, There are excited about it too. Now almost all of my friends are using Firefox 3.0. Furthermore Firefox 3.0 boasts to be a fastest browser available on earth. It is 70% faster than the previous version. It uses little memory footprint too. I guess Firefox has sticked to its basics.

Since the introduction of beta version of Firefox 3.0, it seems to be targetting much on Windows Vista while ignoring Windows XP, (Here I am ignoring other than Windows platforms). So many features that work on my vista lappy :), doesn't work on my office windows XP desktop. For example, if I have more than one tabs open, and if I close the browser, it just closes silently in XP desktop. But in vista, it gives options like save and quit, etc. Since the delivery of Firefox 3.0 RC1, it is supposed to make Firefox a default browser too, if you click on an option to make it a default browser.

Here are my questions,

1. Has Microsoft signed a deal with Mozilla corporation to make better browser for Windows Vista, Considering the fans of Firefox 3.0, like the way Mozilla signed a $55 million deal with Google for making it a default search provider?

2. How much Google paid Apple for making Google default search provider?

3. Is Mozilla on the way to endorsing the Vista for Firefox fans?

I am looking forward to answers from you...