Google Interview Question for Software Engineer / Developers






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

I guess useful questions would also be :
is the graph directed?
is it sparse or dense?
and depending on that choose either adjacency list or adjacency matrix

- Anonymous February 05, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Good idea to ask questions. Here are some more.
Does the graph datatype contain information that could be discarded?
Is it necessary to code for minimum size of serialized representation?

One solution is to use industry standard like @XmlRootElement on the graph data type. You can set to ignore variables for json or xml serialization with appropriate annotations as well.

If the tree is binary, you could serialize the objects in an array to get rid of some of the bloat.

- Ben October 29, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I do not get it, why do we need a "class"

the graph can be represented in a 2D array easily.

- Anonymous March 08, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Graph could be represented as an adjacency-matrix (2d array) or adjacency-list.

- Maxim Stepanenko March 09, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Just put the graph in the XML.. with some root node

- Anonymous March 26, 2011 | Flag Reply


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