Showing posts with label Amazon. Show all posts
Showing posts with label Amazon. Show all posts

Tuesday, January 1, 2013

Question 4


Given a Family Tree, (not necessarily a Binary Tree) print the details of all person in order of generation level.

                                         Jim
                                    /              \

                                /                     \

                             /                          \

                          /                                \

                       /                                     \
                  Martha                                Joe
                 /   |  \                                   /      \
            Sally Andrew Stewart       Kimmel   Walsh
            /
         Peter
       /   |   \
    Meg  Chris  Stewie

Note:[ There's no sibling pointer, each node points to its children]

Expected O/p:
Gen 1: Jim
Gen 2: Martha
       Joe
Gen 3: Sally
       Andrew
       Stewart
       Kimmel
       Walsh
Gen 4: Peter
Gen 5: Meg
       Chris
       Stewie

Friday, December 28, 2012

Question 3:

Given a text file that contains millions of (x,y) Co-ordinates, write an algorithm to find the 100 closest points to the origin.


Saturday, December 22, 2012

Question 2

What happens when you type in a url in your browser ?

http://interactioncloud.blogspot.com/2012/12/behind-browser.html