Bubble for sorting!?

Shortly after Barack Obama announced he was running for president in the fall of 2007, Google’s CEO, Eric Schmidt, interviewed him in front of a large audience of Google employees. The hall was full of fresh and experienced tech graduates with tech knowledge tsunami! 

In that tense situation, as a joke, Schmidt’s first question was, “What is the most efficient way to sort a million 32- bit integers?” 

If you were a presidential candidate but have limited knowledge of computers and algorithms then this question would have confounded you! Now of course no one expects you to answer the question in a technical manner but still whatever you answer would make or break you or your run to the election! 

Obama with his calm mind and demeanor answered confidently and boldly: “Well, I think the bubble sort would be the wrong way to go,”! 

Schmidt slapped his forehead in astonishment, and the room broke out in thunderous applause. This particular interview is available online and is mentioned in the Book Algorithms to live by; the computer science of Human Decisions by Brian Christian and Tom Griggiths!

Now you would ask the wrong question what is Bubble sort? Well, Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in the wrong order. This makes it easy to understand and implement, it also does not require any additional memory space and it is a stable sorting algorithm, meaning that elements with the same key value maintain their relative order in the sorted output!

That is not the real deal! Even Obama may have only a passing knowledge of Bubble sort but he knew where it could not be used! Bubble sort has a time complexity of O(N2) which makes it very slow for large data sets! That means this algorithm is not suitable for large data sets as its average and worst-case time complexity is quite high!

The relevance here is not that Obama knew Bubble sort! He knew how to handle any questions with just basic knowledge of the tech terms or references! Just how Leil Lowndes mentions in her book. “How to talk anyone 92 little tricks for big success in relationship”!

In the present era of the internet in your palm, information is not far! No one knows everything! But if you prepare yourself with some key points then you can handle any situation! Even if it is a hall full of tech wizards! And you do not have to say or feel sorry! Just thankful! No sorry and no thank you reminds me of birthday celebrity Sooraj R. Barjatya and his numero uno Maine Pyar Kiya!

By the way what would you have answered!?

I would have told, “I will Google!”

Now wrap yourself in the bed and sleep!

Good night!

Leave a comment