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. (?)

 

 

 

 

 

Posted in Uncategorized | Leave a comment

paschimbangla

Kolkata – the city still gave me the same feeling as Howrah station did when I first arrived in that part of the country over ten years ago – the yellow Ambassador cars, chaos and disorder. I did like the fact, that despite the dilapidated buildings, it still has vast green patches, open spaces and a nice tree cover. People looked quite relaxed. Some parts of the city actually looked quite nice, at least from a distance ( Park Street and Esplanade ) and I regretted the fact that I hadn’t explored eastern India (specially the North East) one bit despite staying there. Fortunately I haven’t made that mistake again and have always made sure to fully explore the places around me.

Part of me wished that I could have included a quick trip to KGP. Another part of me wanted to steer clear of all awry memories of a stressful episode where little seemed to go right. Though I never visited the place after finishing my final year project, it would probably be interesting to go and see all that has changed over the years and to meet my guide. Anyway, life has become much better after gaining moksha from a soul draining cycle of examinations.

Posted in Uncategorized | Tagged , | Leave a comment

The Viralness of Facebook – all within minutes and seconds

Posted in Uncategorized | Leave a comment

If someone told me that AirSpace was half as crowded as this I’d think twice before flying

Ship, ships and more ships.

Posted in Uncategorized | Leave a comment

Uncertainty and the real world

Bangalore in the early nineties. A garden city, a peaceful retirement town with a hill station’s climate. People begin to discover this nice little town and migrate there. That can be surely expected in a country where for some reason, urbanization has so far been concentrated in areas with the harshest weather conditions on the planet; hot and humid. Coming back to those migrating to Bangalore. Initially the flow of people to the city begins as a trickle and  that trickle quickly becomes a flow ( as more and more MNCs establish base there ) . The arrival of people over there makes it an even more crowded and congested place than the cities where the people originally came for. The same story holds true for Pune as well.

Google in 2002-2004.  A small company, very much a startup. Provided a welcome escape to people at the Empire – Microsoft ( which was also an agile startup somewhere in the distant past ).  Google provided that “startup-y” feeling to people who wished to escape the role of being shiny cogs in the wheels of  corporate giants. Fast forward to 2011 and Googlers are heading to Facebook and Twitter for that “startup feeling”. What itself started as a startup is no longer one.

21/22 year old starry eyed college graduate with that prized job.  Wants to be a millionaire before thirty. By the time that million or crore or whatever … is finally in sight, it no longer seems as much as it did at 22. Many others around were on a similar agenda. Now that so many are equally rich, you don’t feel all that rich. What you feel is the inflation.

In short, whenever you make a transition to experience a change,  you negate the change you intend to experience, specially when you are part of a crowd making a similar transition. Heisenberg’s uncertainty principle was not just applicable to electrons jumping orbits.

Posted in Uncategorized | 1 Comment

Unlucky Trains

Of late the papers have been flooded with accident ( or sabotage ) cases related to our Indian trains.  I was just sitting and thinking about all the trains I’ve travelled on ( in India ) and how most of them have been involved in some of the worst accidents ( or blasts) in the country . Not on the days I’ve travelled on them, unlikely to be even the same rake – but still…  . I now wonder – is it the case that I have travelled on a very unlucky sample set of trains and routes – or is it that pretty much all important trains in India have been involved in major accidents ?

Just for the record, here are the trains I’ve travelled on – and the accidents/sabotage cases related to them. It is a very “jinxed” record for sure.

[ Delhi - Pune/Ahmednagar trips, late-eighties and early nineties]

Jhelum Express : Major bomb blast in Jhelum Express in 1997. http://www.railissues.info/bomb-kills-12-on-indian-train

 

New Delhi – Bangalore Karnataka Express :

1989 April 18th. India, Uttar Pradesh, near Lalitpur: Karnataka Express derailed; at least 75 people died.

1991 October 31st. India, Karnataka, near Makaligurga: Karnataka Express derailed; 30 people died.

28 July 1997: Twelve people killed in a collision involving Karnataka Expressand Himsagar Express near Faridabad on the outskirts of Delhi.

 

[ Delhi - Mumbai , 1996/97   ]  Frontier / Golden Temple Mail 

Nov 26, 1998: Over 200 people die as Jammu Tawi-Sealdah Express rams into three derailed bogies of Amritsar-bound Frontier Golden Temple Mail near Ludhiana in Punjab.

 

May 15, 2003:   38 Killed in Frontier Mail Fire. 

http://www.rediff.com/news/2003/may/15fire.htm

 

Mumbai Rajdhani,   Mumbai – AK – Rajdhani 

No disaster thankfully.

 

[ New Delhi - Howrah/Kharagpur, 2001 - 2006 ]  

Those were the days when seventeen hour journeys had to be made six to eight times a year. The life of a college student on a shoestring budget … air travel was out of question.

Calcutta Rajdhani Exp. Lots of trips and memories on this train. Both my first and last journeys to/from KGP were on this.

http://en.wikipedia.org/wiki/Rafiganj_train_disaster

Involved in a major accident( or sabotage ) case, derailed and fell off a bridge – estimated toll around 200.

BBS Rajdhani Express.  No accident- but this train has the dubious distinction of being the first Indian train to be hijacked by Maoists, near Kharagpur.

This was the train I travelled on, for more than half of my trips to/from college.  After a lot of delay ( and laziness) the ticket would be bought just a week before I had to travel. It would invariably be a <nice big> wait listed number.  And then, it would magically get confirmed a few hours before departure and I would board an almost empty coach most of the time. I used to always wonder what kind of logic or manipulation was going on in the computerized railway system.

http://news.rediff.com/report/2009/oct/27/maoists-had-carefully-planned-rajdhani-hijack.htm

Purushottam Express :  Made a few trips on this.  I think took much more time to reach Delhi/Ghaziabad than the other trains.

This had its own terrible rail disaster somewhere in the mid-nineties.

20 Augus1995: Firozabad rail disaster, 358 killed as Delhi-bound Purushottam Express rams into the stationary Kalindi Express near Firozabad in Uttar Pradesh.

 

——————-

Long distance train journeys came to an end once I passed out of college; except for one trip when I left Mumbai and was coming back with a lot of luggage – and almost missed this train .  And there have been a couple of  instances where I booked a train ticket and ended up being unable to board the train, but those have been shorter journeys :-)

Anyway, coming back to the Railway Accidents I think this is one ministry which needs to be headed by a technically aware person who has some idea of safety standards, modern instrumentation and also has idea about the kind of high speed railways and maglev trains which Japan, China, EuroZone etc have developed. For safety, just as much as the trains it is also the track which matters. Importing LHB coaches from Germany and running them at 150 kmph on railway tracks which are poorly designed and maintained ; is  recipe for disaster.

The average ignorant voter will applaud Lalu Yadav for turning around the railway in terms of profit but any reasonably informed person will be aghast at the (increased) frequency at which trains run on certain key routes – which makes it impossible for the tracks to get their scheduled periodic maintenance. What a way to double rail traffic without laying more parallel tracks  – at the cost of hundreds of lives.  Double lines have been only double – for decades now.

Given that railways are so important for India someone should make sure technically qualified or aware people get those posts and definitely not people like Lalu, Mamta , ……….< pretty much everyone who had the ministry>   who are best left to take care of the flower and vegetable gardens in Rashtrapati Bhavan . I was about to add Nitish to the list of prospective gardeners as well when I remembered he’s taking decent care of Bihar :-)

Do you see the correlation between the increased frequency of trains in the Eastern Section ( Delhi – Howrah ) , the place9s) of origin of successive railway ministers and the rate of increase of accidents on this line ? I do.

 

 

 

 

Posted in Uncategorized | Leave a comment

Some more “Three Idiots” whining

http://timesofindia.indiatimes.com/home/sunday-toi/Beautiful-World-of-the-Backbenchers/articleshow/2947772.cms

Manu Joseph has once again cashed in on the perpetual whining and cribbing which Three Idiots induced amongst cry babies . Once again he has cashed in on a sprinking of Those Three Letters in a couple of paragraphs to promote his hyper-dramatic articles and get it more search engine hits .

I see a funny mix of irony and hypocricy in the fact that -

a) So many people are cheering for his story .

b) Barely 1 or 2 of my posts on this blog have  Those Three Letters in them and they get 75% of the search engine traffic .

There are two sets of cry babies .

a) The first set , which was desperate to get into engineering ( for reasons they themselves didn’t know probably ) and didn’t ( probably good for them ) . You see them cheering articles like the grossly exaggerated piece of literature Mr Manu Joseph has produced .

b) The second set is a bit less fortunate . At 17 years of age, they weren’t smart enough to figure out what they wanted in life, but they were smart enough to ace the entrance exams .

This is the group which pretends to be “Victims of Social Pressure” who were “forced into Engineering” ( by whom – other than their own selves , I am yet to figure out ) . They then cook up a very very melodramatic story and exit the tech-coporate stage by finding their so called True Calling in life which could vary from writing some shallow, giggly book to producing some photoshopped photographs . Which is perfectly fine till the point they start projecting themselves as Martyrs who were unable to pursue their passion because they were “forced” into a rat race .

Ya go cry me a river . Rats have no one to blame but themselves for being in a rat race .

http://www.thelearningpoint.net/home/examination-results-2014/top-cbse-affiliated-schools

Posted in Uncategorized | 1 Comment