Wednesday, October 20, 2010

wireless, you always perplex me

Wireless has always been a problem for me. For example, at Atul/Snehal's place I accessed wireless for the first time in last 5 years, although every other laptop worked there. I cannot connect my laptop to EPFL's wireless, all wireless experts failed trying to debug that. These are all different networks, and different laptops, I think I am the only constant in these problems.

Now that I am working from home for ArcSight. I see this strange thing. If I connect my laptop with wireless, then all day it works fine. But from 6-9 (my peak office time), I see about 40% dropped packet to San Jose. The local servers are all accessible perfectly.

Now, when I switch to the wired connection from my router to the laptop, all problems go away. So... how the trans-atlantic link knows that I switched from wired to wireless I will never know...

Wireless is so weird.. no wonder my ex-landlord used to switch it off at 10PM.

Tuesday, January 12, 2010

Google Interview

I had Google interview yesterday. Apparently everyone posts about the questions in their blogs, so here I go, for the benefit of the posterity. BTW, most of the things that people give as hint for interviews are useless. So, I wasted lots of time following those suggestions, and you shouldn't. There is no need to read descrete mathematics books, or statistics books. The maths and the stats are very basic. Even the algorithms book is not really needed, as you can guess from the problems below. And don't spend time on the puzzles either, I didn't get any of those.

Also, the office they have here is like Disney Land for programmers. Coffee makers available not more than 100 ft away from each programmer. Slides from upper level to the lower levels, egg shaped cubicles for private phone calls/meetings. Free breakfast, lunch, dinner, coffee, and coke. Every floor has a game room and a library. Free massage, and the most interesting one... a nap room :) No wonder programmers are happy there.

1st Phone Interview:
The phone keypad has more than one letter associated with each digit. But more often than not, the digit combination map to one word in dictionary. How would you write a program to suggest a set of words from the dictionary, given a prefix of digits.

2nd Phone Interview:
they gave me a pass on this one.

3rd Interview:
Q1. Given an array 1000 elements containing integers 1..1000. One element of the array is set to 0. how will you find that element?
What is there are two elements missing?
What if k elements are missing?
Q2. How would you design a database for gmail?
Q3. In a list, there are integers of unknown range. How would you find the first element in the list which does not repeat?

4th Interview:
Given a graph, of ancestors of a person, write a program to find all ancestors who have the same first name as a given person.
Given a dictionary and a word, how would you find the all anagrams of the word in a dictionary.
How would you design google map api?

5th Interview:
How would to write a shell script to replace all GoogleMail or GMail to Gmail in a directory full of html text.
How would you write an API for version control system.
Given two arrays, one containing characters and the other one containing indexes, how would you rearrange them so that the characters appear in the order of indexes?

6th Interview:
For a 64 bit integer, how would you compute the parity?
In a web server, you receive legitimate request and bogus ones from robots. How would you build a system which identifies the requests which are from a robot and ones which are from a legitimate user.
Given an array of size n, how would you take random sample of k elements?
What would you do if the array is replaced by a stream?

7th Interview:
How would you encode a number n, so that it takes the least amount of bits?
Find the valid parantheses prefix in a string. i.e. ((() is valid, and ()) is not. How would you parallelize it?
Find the bugs in the following code, which matches the string "AAAAB".

boolean match(char str[]) {
int count = 0;
for(chr : str) {
if(chr == 'A') {
count ++;
else {
count = 0;
}

if(chr == 'B' && count == 4) {
return true;
}
}

return false;
}

Sunday, May 10, 2009

shame

I met a Russian girl today. She learnt hindi in 6 months, learnt Kathak in less than that. She had a performance in Delhi last week... She knew more about Odissi dance than me, or for that matter Chhau dance... wow! I feel ashamed of myself now, she has probably more respect and attachment to the Indian culture than me...

http://blogs.thehindu.com/delhi/?p=19143

Wednesday, May 6, 2009

when is a problem a solved-problem?

Sometimes I think about an area and say.. oh, that is a solved problem and there is nothing left in it to work on and I go for a new one.

So, the question is, is there any area that is really solved? Let's say Physics... at the end of 19th century, everyone thought Physics is a solved problem. We knew how things work, the only thing left to be explained was the results from Michelson-Morley experiment. After just 20 years, physics had theory of relativity, quantum physics, big-bang theory... etc. etc. which completely changed the way we think about nature. In 1980s, people thought, if only we find the unifying force, we can solve all that is there to solve in physics and physics will be a solved problem. Well, then they discovered dark energy, dark matter, and a slew of other stuff that cannot be explained at all...

The reason I thought of this is: I went to meet with some researchers yesterday, who work with cement. I thought to myself, what can be left in cements to be researched on? It is a 2000 year old technology, and people have worked on it since the days of the Romans... So I go in with a skeptic's mind, and there I was blown away by the amount of research they do.. Right now, cement is the most produced matter in the world, and they produce about few quintals of cements for every living person in the world. It is the most artificially produced substance in the world. I never knew how cement works, and for the first time saw in a microscope the various stages of cement reacting and forming the bonds. I saw the microscopic holes in the concrete, that seep the water in and corrode the steel inside it...

So what research is left to be done on cements? They want to predict the structural properties of buildings/dams using a certain cement processing method. The reason it is hard to predict is... cement reacts with water in many possible ways... and for years... It is not possible to keep doing experiments for that many years. The cement technology changes every year, so it is not possible to study the earlier structures to find out how they behave. Unfortunately, the concretes are made to last for centuries... then the question is: how does one predict the property of the structure after a century from the mixture, temperature, and the weather of the place at the time of creation? Sounds eerily like astrology, and fortunately that is a data-problem, so we can do something :)

Saturday, April 18, 2009

Movie recommendations

Since half of my blog readers want me to recommend movies...

watch Firaaq --> very nice movie..

Don't watch Irreversible --> no matter how much anyone recommends to you :(

Edit: also I will recommend places to visit, eventhough no one wants it :)

http://benjamin-meyer.blogspot.com/2008/07/adventure-to-trolltunga.html

Norway is great man.. deserves the award for its coast line..

http://www.mudcrutch.com/forum/showthread.php?p=70391

and victoria fall.. those kids are brave indeed.

Thursday, March 26, 2009

face of a boy



This photo can be often be seen hanging on the wall of many otorhinologist's offices as a poster. It was shot by photographer Jack Bradley, and depicts the exact moment this boy, Harold Whittles, hears for the very first time ever. The doctor treating him has just placed an earpiece in his left ear.


anything, I add to this will ruin it.

Wednesday, February 25, 2009

Anatomy of a scam

How do scammers make money? The only reason is our greed...

I almost got scammed today. I have been thinking of buying a DSLR since I don't have a camera with me. I am going to Geneva Motor Show next week, so want it fast...

After some search I found the best price in Switzerland, and thought of looking outside.. sure enough I got igooshop.com, which was selling cameras at unbelievable price (50% discount!). I guess I forgot the rule--if something is too good to be true, it probably is--promptly added the camera to the shopping cart and proceeded with checkout.

First warning bell was when there was no credit card option, only bank transfer. Then the bank to be transfered was in China. hmm... I thought I had seen the the "verisign trusted" sign on the webpage... sure enough it was there, but it was just copied from another website. Verisign itself didn't have any record of this website. Then I started checking their whois information, and it was just garbage. Few links on their site pointed to something called "miooshop.com". These guys even posted "questions/answers" on their website, to make it more believable. Then I went to another site called "syndeck.co.uk"... similar website, with lots of cheap stuff.. and the only catch is bank transfer, no credit cards.

So, I was this close to getting scammed, by a modern version of nigerian scam. I guess the principle in both the places was greed, sometimes people think they will get money for nothing, and I thought I will get an incredible deal just by looking around. How do you prevent being scammed? -- always pay by credit card.

Time for some revenge. The only way they can attract a victim's attention is through google's advertising, since they cannot last long enough for pagerank to pick them up. So, I kept searching for different cameras using similar keywords and started clicking on their advertising links... They must lose some money for each of my click... Sure enough, after sometime both those sites stopped showing up in the google advertising... at least I made them lose their advertising money and prevented some other greedy guy like me to get to that site...