Friday, April 29, 2011

Open source and Facebook

Facebook is becoming more and more the champion of large scale open source adoption. Traditionally, this was a Yahoo! prerogative but now Facebook is using a good combination of Hadoop, Hbase, and Lucene for their

Facebook Messages' Application Server

Wednesday, April 27, 2011

easy one: PMs keep asking for meetings

Identify conflicting ones and just decline them.

PS: dedicated to the other side of the moon

Tuesday, April 26, 2011

Broke a circle which become a cage

what was the complexity

Bing or Google?

“So in this battle, who won? And then I am off course speaking of the battle between Bing and Google. In my personal opinion I get a much better feeling from Bing compared to Google. Even though Bing has nothing Social in it.
The look and feel is much better, with the big image on top. You immediately feel you are “into the news”. Even though Google has relevant information on it, they fail to actually make it really useful for the user.
But the main no-go for Google in this case for me is the lack of videos. I can not understand why there are not more videos there. If you put up a live channel, make sure it shows up in the SERPS.
For me this one goes to Bing. How about for you?”

Saturday, April 23, 2011

Balance a single linked list of integers

In other words transform the list into a balanced Binary Search Tree

Friday, April 22, 2011

120 G cables

Typical G. question. here is a bunch of 120 electrical cables laid under the ground. The cables are 10 KM in length and both ends of each wire are out in open.

We need to identify and label the cables 1-120. As you might have guessed, the only way to gain information in this setup is to connect some set of wires at one end, walk up to the other end, and test for conductivity. The process may have to be repeated many times before a complete labeling can be constructed. And since each such step involves walking across 10 KM, we wish to solve the problem with the least number of trips.

How would you identify each cable in minimum number of trips?

Thursday, April 21, 2011

Launched Deep Links in 8 countries

STC-E London launched DL in 8 international countries

Tuesday, April 19, 2011

Cyclic strings

how do understand whether a string is the cyclic string of another (e.g. 12345, 23451)

Monday, April 18, 2011

4 numbers and 4 operations

You have 4 numbers, and 4 operations (+, -, -, /) can you combine the 4 numbers with the 4 operations and check whether the final result is equal to the number X.

Sunday, April 17, 2011

Two array

You have two arrays of characters, find whether they overlaps.

Saturday, April 16, 2011

Numbers on the phone

You have a traditional phone with numbers 0-9, *, #. how many different words can you compose selecting 10 digits?

Friday, April 15, 2011

Select the less expensive flight going and return

Given two locations A, B there are K flights going A -> B and H flights A <- B each one with a cost. Select the less expensive combination assuming that the flights can be fully booked.

Thursday, April 14, 2011


Mary comes and buys half of my roses, plus I give her one rose as gift. Then, Sally comes and buys half of my remaining roses and i give her 2 roses as a gift. Then Molly comes and she buys all the remaining roses. How many roses did I have at the beginning?

Wednesday, April 13, 2011

check a tree

Write a function that returns true if given binary tree the value of each node is equal to sum of the nodes present in its left subtree and right subtree.

Tuesday, April 12, 2011

Inversion pairs

Given an array of n integers find all the inversion pairs in O(n).

Sunday, April 10, 2011

Check the validity of an arithmetic expression with parenthesis

Having the standard operators +, -, x, /, and three different types of parenthesis

Saturday, April 9, 2011

Maximum number of trains in the station

You are given a collection of trains C. each train t_i  will enter the station at time t_i_0 and will leave the station at time t_i_1. How many trains do you have in the train station at a given moment in time t? What is the maximum number of trains you have during a day?

Friday, April 8, 2011

How do you invoke a callback using a predefined method but passing parameters?

function callback(a){


function b( ...., callback(data))


what is the problem with the above code snippet?

Thursday, April 7, 2011

Array problem

Given an array A of n integers, find two indexes i, j such that  j > i and maximize (j - i) with A[j] - A[i] > 0

Tuesday, April 5, 2011

A feature suggestion for Facebook: increasing Facebook monetization for mobile payments

In my posting "A feature suggestion for Skype: turning skype in a cash-cow machine for mobile payments I suggested a new model of payments for Skype. The same one can be adopted by Facebook mobile on a larger scale and adopting the same principle. Wouldn't mind if they finance the idea.

Monday, April 4, 2011

Classical yahoo question

You are on a strict medical regimen that requires you to take two types of pills each day. You must take exactly one A pill and exactly one B pill at the same time. The pills are very expensive, and you don't want to waste any. So you open the bottle of A pills, and tap
one out into your hand. Then you open the bottle of B pills and do the same thing -- but you make a mistake, and two B pills come out into your hand with the A pill. But the pills are all exactly identical. There is no way to tell A pills apart from B pills. How can you satisfy your regimen and take exactly one of each pill at the same time, without wasting any pills?

Sunday, April 3, 2011

A feature suggestion for Skype: turning skype in a cash-cow machine for mobile payments

Mobile payments is an hot area, with startup like Square. This company is based on the very simple idea of plugging a low cost little device to a normal mobile phone for reading traditional credit cards. So your mobile will turn into a credit card reader. Not all the platforms are supported (just Iphone & Android), but the company got around 1M users in a short amount of time, $37M in funding and an evaluation of about $200M. Sequoia is one of the investor. Their business model is to take around 2-3% for each transaction. What I don't like about Square is that it is still not working with all the mobile platforms, and that you need to have an external little device for reading the cards.

I was considering how to use Skype to make mobile payments with no external accessories. A couple of considerations. First, Skype is installed on several mobile phones because users likes to make (video) calls at very low fare rates. Second, Skype has already a working billing system for each Skype account. The billing system is currently used for paying calls from skype to traditional phone numbers.   So, why don't they use this credit for making mobile payments?

This can work in a very easy way. Suppose that a Skype account A decides to accept Skype payments. A should register some identity/billing information (name, company, address, and so on and so forth). When a customer B wants to make a payment to A  for a given amount of money, the only thing that B should know is the login name for A. Skype will present to B all the already registered information for A, so that B can verify the identity of A and authorize the money transfer.

For example, say that Ely wants to transfer $10 to Lucy. Ely will start a request to Skype which will answer with all the registered information for Lucy (her address, her age, her town and so and so forth). Ely recognizes Lucy and authorizes the money transfer. Similarly, if Lucy wants to pay the company ACME.COM, skype will provide all the registered data for ACME and will transfer the money if Lucy recognizes ACME billing information.

Simply enough and already working. No external accessories, no need of having a new distribution platform, no need of creating a new billing system. The idea is already there and can be easily implemented by the way of Skype.

I would not mind if they will fund me with $37M for the idea itself ;-)

Friday, April 1, 2011

It's official, I am now working for Crop

It's official! I am now working for Crop a new Social Search Startup, as Director of our cool search project codename "Circle". Currently, we are in private beta. IM me if you want an invitation. Oak and U-Combinator are the investors and we are currently hiring.

Crop (Beta), Create your Personal Social Circle