Google Interview Question for Software Engineer / Developers






Comment hidden because of low score. Click to expand.
1
of 1 vote

Dijkstra and A*, both would give the cheapest path between the two nodes. The question though remains as to which one will do it in the least possible time.

Given good heuristics, A* will consider the fewest nodes to find the shortest path and as a result take the "least possible time".

- Anonymous August 13, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

TSP

- Anonymous July 30, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

LOL

- LOLer July 30, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

hahahaha....

- code.monkey July 30, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

lol

- Anonymous July 30, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

lol !!!

- Anonymous August 03, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

If you mean give the routing between two random cities A and B. Then first construct a graph of all of the cities, then find the shortest path using A*.

- Anonymous July 30, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Why Dijkstra is not allowed? Why always people use A*? What kind of weight is -ve here?

- Lord Darth Plagueis August 08, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

This is not TSP. Its a minimal spanning tree formation and kruskal's algorithm will provide the cheapest route for the weighted, directed graph.
read up both TSP and Minimal spanning tree on wikipedia or your favorite algorithms text book to know the difference.

- hgk August 18, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

my bad. its not MST. my comment was in haste. did not read the problem fully. A* or Dijkstra's work just fine.

- hgk August 20, 2009 | Flag


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More