Pythagorean Triplets

An interview question which I’ll never forget. One of those obvious things which were always staring at you in the face except that you didn’t notice them.

Faced this soon after B.Tech. – when (many of us) were trying to run away, as far as possible from India, and as quickly as possible.

Bloomberg Financials, London; Role : Quant Dev; Date: Sometime within six months of graduation

I went into the interview, after revising probability, statistics & machine learning, numerical techniques – and trying to package the formulas and cheat sheets as nicely as possible. And the question I get is this –

Prove that every Pythagorean triplet includes a multiple of five.

Eh ? It took me 30 seconds to realize that I had never noticed this very obvious property of Pythagorean triplets. All the more shameful given that I’d award the Pythagoras theorem the prize for being the most useful theorem ever in euclidean geometry. After a couple of minutes of being dumbstruck, I finally threw together a straightforward solution to it, though it wasn’t really an algebraic solution. The interviewer seemed okay with it. They asked a few interesting statistics questions as well.

By the time Bloomberg called me for the next round, I no longer needed the job and I politely excused myself out of the interview process, but I was tempted to go into the next interview just to solve their interesting problems.

Which brings me to yet another point.

What you are often asked in programming interviews :

Given an acyclic graph .. x y z x y z … complexity .. a b c a b c … Amortized Analysis ..

Come up with a dynamic programming formulation for ….

Calculate the conditional probability for ….

What should be asked in most of those programming interviews specially true for most big company jobs (anywhere on the planet) and India offices in particular

Given a buggy and broken code base on an unknown machine and an incomplete set of requirements what exactly are you going to do with it to keep yourself busy enough to be eligible for a paycheck,

How often have you hooked up a debugger ? That’s what you’ll be doing for most of your life going forward.

I see you did an Algorithm Design course. Did you learn something about Button and Toolbar design ?

And the final compatibility question in the HR round :

We hope, you do realize that your formal CS Degree is to Software Engineering what a Physics degree is to building bridges. (?)

 

 

 

 

 

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s