Wednesday, August 18, 2010

Campus knack at Flipkart

Its time for on-campus hiring at Flipkart.com. Come Friday, and student at NIT Surathkal, would be (supposedly!) hitting their heads on gritty problems posed by the Flipkart.com at the event of On-Campus Hiring. I recently joined Flipkart, and essentially I am not a part of the recruitment team, but yeah! I am a part of Flipkart.com and I am excited :) I guess everyone would be!! Good luck guys! We would like to see a bunch of you here, and I am sure, you would love working in here.

Well, yeah! I have been and perhaps would be away from some algorithm/analytical problems, working on some real-life problems at Flipkart but it has been interesting, and if I come across something that should be shared with you, yours truly would do the service.
Recently, I have been working on some basic utils at the Flipkart, that makes life easier, faster and efficient for other teams. So if I am not over-estimating, I am a part of the OS team for the instance Flipkart.com (Can you guess which technology I am working on rite now by my statements :P :P).

Well, yeah I have a news. I have started learning perl, and I have started liking the MacOS terminal. I never knew it was so damn powerful, and I would like to share some of the hacks that I come across to make your life easier on the terminal. And if you are not using it still, well then do get used to it! In industry, the terminal is your only and sufficient help.

And problem lovers, well dont worry, if I do come vis-a-vis with a new/interesting problem , I wouldn't delay posting it here on the blog.

Till Then,
Enjoy, and Keep computing :)
Vivek
nitkkr.vivek@gmail.com



Monday, July 26, 2010

Yahoo Hack Day @ Bangalore

Hey folks,

Last weekend, I was at the Taj Residency. Now before you jump to any conclusions (as my PG room mate did :P ) , it was the Open Hack, Bangalore 2010, organized by Yahoo. It was series of tech-talks on Yahoo tools on YDN, followed by a 24 hour over-nite, hack development contest. For those who might be confused by the overloaded term "hack", it is in simple terms any application which is build on something, to add a feature or make it better and simpler to be used.

We saw a lot of new applications and ideas coming up, along with a sleepless virtual two day, 1 night stay at Taj Residency's Vijaynagar and Trinity Hall. Yours truly also tried a hand at developing a hack over PayPal API which gives you real time updates in your mail-box over changing Forex rates. Well anyone wants to keep a check over the foreign exchange rates and get a notification over the same in his mail-box can mail me and we can try and work something out.

Over all it was a great experience, with real good info on the Yahoo tools like YAP, YQL and YUI, and I hope to work on some of them soon. Would keep you'll updated though.

Ok, for those who are looking for the solution of the last week's puzzle, I am sure it would have been a good experience and although till now we dont have a concrete proof, what we do have is a strong and almost logically convincing solution from Kapil Garg. As Kapil puts in, if Alladin just moves diagonally opposite to the point where Roger is heading, Alladin would end up leaving the circle. People who love calculus may try writing some differential equations which may help them get a concrete proof. Its not hard to visualise that Alladin would follow a out-spreading spiral-kind path from the centre of the circle while Roger would keep revolving through the circumference in one direction. This reminds me of a similar problem from previous IIT-JEE papers with three people at the three ends of equilateral triangle, start moving towards each other continuously, where would they eventually meet.

For this post, I don't have a puzzle yet but I am sure you would be interested in Yahoo tools if you go on YDN. For a lead, I would ask you to visit YQL and see what all data you can access. It really seemed magical to me that YQL includes almost everything on the earth and web in the YQL and helps you extract info from it. Also, you can think of a hack that you would have made had you been here in Bangalore at the Open Hack. Do share your ideas with us, and who knows you may end up be on the stage with Yahoo Unique Hack prizes (they had almost 7 categories of prizes :) ).

Meanwhile, i would work on ideas/puzzles and would try keeping you a brain-knacker soon.

Cheers , (Yahoo??)
Vivek
nitkkr.vivek@gmail.com

Monday, July 12, 2010

Str8 from the most happening place in Bangalore

Hey amigos,
Hope you'll are doing well at your new job/higher study course.

I am writing this mail straight from Koramangala, supposed to be the most happening place of Bangalore. I joined Flipkart.com two weeks back, and it has been an awesome experience since then. Great Co-workers! Friendly environment and working on deeper real life problems. Being a fresher, I can't ask for a much. Its 3:20 pm on my MacBook ( yeah, I work on a MacBook now, thanks to Flipkart ), and as I turn my head around, I see someone struggling with debugging on her MacBook, someone surfing topcoder.com, yet another co-worker relaxing with a glass which supposedly contains coffee and yet another fresher relaxing on a beanbag and pondering over a problem which might have appeared on his MacBook.

Now, I have been away from blogging for a long time just cause I haven't had a good problem to start off with. But while I was talking to an old friend Raunak, I came across a nice mathematics problem which I thought would be a nice one to kick start my blog again.

So, we have a circle of radius R. Our fast, smart and intelligent dog, Roger is on the circumference at some point. Roger is restrained to move on and only on the circumference of the circle. Our hero, Alladin, is standing on the centre of the circle and wants to get out of the circle as soon as possible. Speed of Roger is 4 times that of speed of Alladin. Now, as Alladin starts moving out intelligent dog Roger calculates his direction and moves towards the point of exit. Alladin cannot make an exit from the point if Roger is standing there. So is it possible for our hero to evade the dog and break the "Ring" to come out?

Do pour in with queries and answers and suggestions. I have some ideas on the problem, but I am still searching for a particular solution with proof.

Cheers,
Vivek
nitkkr.vivek@gmail.com

Wednesday, May 19, 2010

Are yoou'll on?

Well I guess it has been a week, and I still don't have any entry. Looks like the puzzle stumped people! Ohk, for people who have not noticed, I would like to give you'll a hint:
1. You can use prime number theory. That will help you in a great way.
2. Go by limiting the maximum possible value for the product, and then eliminate some cases. You would be left with very less numbers.
3. And takes the lines of both the students very seriously :P. Those are the only and sufficient hints.
4. If you still can't get it, drop me a mail and I would like to help you get closer to the solution.

Ohk, well I have a lead on the greatest integer function solution for finding the maximum of the two numbers, given by Sarvana. Although it works only for numbers with same sign , but then it is a great find indeed. And as you will see its simple yet elegant.

let x = a * [ a / b ] + b * [b / a], that would be equal to
max ( a , b ) * ( max / min ) .

now, either of [ a / b ] or [ b / a ] would be zero or both would be 1.

in any case, lets divide x by y = [ a / b ] + [ b / a ] .

This cancels out the multiplicant with the max(a,b) you get the required answer.

Well, I think this is completely see through and doesn't requires explanation. And please drop in our comments and views about the solution. :)

People, do get your brains working for the number guessing problem. Its tough, but I am sure you'll can crack it once you set on it.

Cheers,
Vivek
nitkkr.vivek@gmail.com

Thursday, May 13, 2010

How did they know the numbers?

Well, this has been a happening week. With the most dreaded teacher setting one of toughest paper for the final year guys, to extending of date sheet insanely, I would say NIT Kurukshetra final year guys would have had a tough time digesting all the flash news.

Anyways, lets get back to the solution for previous week's puzzle. Well lot of entries this week. Shashank, Sarvana, Pradeep and Pulkit Sir chipping with a great way.

The essence of the solution being :

max ( a , b ) = (a + b ) /2 - | a - b |/2.
Now, before you say modulus is not a mathematical operator, I would quote Pulkit Sir's way of seeing this " absolute value is just the distance from 0 on a number line". Now, this is perfectly mathematical and its just the way you percieve it.

Still, if for hard-core exrepssion lovers, |a| is sqrt ( x**2).
I have a hint that this problem may be solved by another method of using greatest integer function ( [ ] ). Well, I will keep trying, and if you get a solution on this thread, do drop me a mail.

This week, we have a puzzle contributed by Pulkit Sir again, and i thoroughly enjoyed solving the puzzle owing to the careful drafting of the puzzle wordings. I am sure you would enjoy it :)

A teacher says: I'm thinking of two natural numbers greater than 1.
Try to guess what they are.
The first student knows their product and the other one knows their
sum.
First: I do not know the sum.
Second: I knew that. The sum is less than 14.
First: I knew that. However, now I know the numbers.
Second: And so do I.
What were the numbers?

So drop me a mail as soon as you find the numbers.

Cheers,

Vivek,
nitkkr.vivek@gmail.com

Tuesday, May 4, 2010

Max with Maths

Hey folks,

Well, this has been a super fundoo week. Last working day at college, scribble day and followed by a sleepy lazy preparatory leave. Its time to gear up for the final end semesters (phew!) of my B.Tech degree.

So, as you may assume I haven't been able to prepare a challenging puzzle for you'll. But then, you'll must be busy with exams too, and so I would let this week pass by with a simple puzzle again. Well before that, lets see the solution to previous week's puzzle. Shashank Srikant from NITK was the first one to chip in with the solution after a small discussion. And we had a really good entry from IIIT Allahabad, by Siddharth Shankar, who takes on the problem with a approach which was new for me as well.

Well, if you remember the basic formula of area of the triangle .5 * base * height, this problem could not have taken more than 2 minutes of deep thinking. Divide the base of the triangle into 9 equal parts and now join those points with the third vertex. Now height of each of the triangle is same and as base is 1/9th of the original triangle, you end up with each area 1/9th of the original triangle.

What Siddharth came up with was based on similarity of triangles, which he eventually extends to equal triangles. Lets see the diagram he attached:


I hope this makes it very clear, although I would like to discuss if anyone has any doubts.

Ok, now the puzzle for this week. Well, computer programmers have a very easy way to find the maximum or minimum of a number. Just include a math library and you have a direct function. Or else, you can use a if loop or much better, use a conditional operator.

What about people who dont know programming but only know math. So this week we sought to help those people. Give me an expression involving only mathematical operators and 'a', and 'b', which finds the maximum of 'a' and 'b'.
Your expression can contain any mathematical operator like !,-,+,/,* etc etc.., besides 'a' and 'b' but no programming constructs.

Cheers,
Good luck for your exams
Vivek Agarwal
nitkkr.vivek@gmail.com

Tuesday, April 27, 2010

Equal Division

Hey folks,
Since I am in a mess of sessional (last of my college life.. phew! ), I would straight away go to the question for this post. This one was asked to one of my friends in an interview lately. And believe me, its easier than i may appear at the first go.

How do you divide a triangle (any valid triangle), into 9 equal parts.
Edit: By equal parts, I mean the triangle should have equal areas. Apologies if that small miss from my side messed up your head a bit 2 much.

Well, I dont have much to say, except that at this point of time, Compiler Design has blown me off! So while I find the chapters, you can ponder over the problem, and yeah mail me the solution as soon as you get a leaf on it. :)

C ya,
Vivek
nitkkr.vivek@gmail.com