Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

I would like to submit the following question I was asked
recently during my technical interview at Google.
I'm rephrasing the question to make it clear for everyone
to understand:

- You are going on a one-way flight trip that includes
billions of layovers.
- You have 1 ticket for each part of your trip (i.e: if
your trip is from city A to city C with a layover in city
B, then you will have 1 flight ticket from city A to city
B, and 1 flight ticket from city B to city C.
- Each layover is unique. You are not stopping twice in the
same city.
- You forgot the original departure city.
- You forgot the final destination city.
- All the tickets you have are randomly sorted.

Question are:
- Design an algorithm to reconstruct your trip with minimum
complexity.
- How would you improve your algorithm.

Example:
- randomly sorted:
New York->London
San Francisco-> Hong Kong
Paris->New York
London->San Francisco

- sorted:
Paris->New York
New York->London
London->San Francisco
San Francisco-> Hong Kong

Answer Posted / samir

Find the ticket which has a unique TO destination. That
destination should not occur in FROM field in any ticket

:)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What may be the different component of Build phase? Build is not directly phase in SDLC, but its major part of SDLC, so need to know the different components for this including dcoument process.

2225


why is testing neccessary?

2111


what are the stages of software system engineering process?

2540


Write a command to find all of the files which have been accessed within the last 30 days. Output should be stored in a file “December.files”

3394


Explain various phases of the SDLC.

1015


Explain how object-oriented analysis and design differ from the traditional approach.

3938


What are the Rules of Desktop Publishing?

2106


Where we have to use RCVF and where we have to use SNDRCVF. Basically what is difference between RCVF and SNDRCVF?

1762


What are the best tools available now for creation of accessible Web sites?

2113


Discuss operations of CAD and CAM system.

933


How to Design a Good Ad?

1998


vendor out going payment suppose is 10000/- and after some time vendor returned 2000/- as it is excess where this transaction to be posted in fi/ap

2272


What is Make to Order, and what is the difference between Make to order and Make to Cash

2680


What is platform-driven design?

2256


What are the advantages Information System Architecture Framework in term of analysis and system design

2521