Interview Question


Country: United States




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

Which company?

- Anonymous September 12, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

It might not be possible for certain inputs. Consider, a graph like:

O----O----O

- Anonymous September 12, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think this problem can be solved if we have a tree where no vertice has more than two edges, something like a link list perhaps. But a for a general tree it would depend on the kind of way the tree's edges and vertices are spread out. I can't be sure about it though. Please help if anyone ha a better answer

- vabhdman September 12, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1. every node should have at least one node associated with it.
2. say m = roof(n/2). max no of edges should be m+(m-1)+(m-2) .....1.
2. min can be n/2.
these are some observations of mine
seems to be necessary to make such combination but not sufficient.

- Anonymous September 12, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

here is the solution... noob-g4ur4v.blogspot.in/2012/08/interviewstreet-even-tree.html

- h4ck4r September 12, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

can u pls explain the algo a bit..??

- ashish September 24, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I solved this on interviewstreet.com using the following algo..
make a map of a node vs the no. of nodes connected to it..
iterate over the map
if for the ith node, the no. of nodes connected == even
-- then iterate over the nodes list connected to this node.
now for every connected jth node, again get the no. of nodes connected this jth node
if the no. of nodes connected to jth node == odd,
cut the edge ( increement the counter of cut edges )

- Krishna September 16, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

{{

}}

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

{{
{}{}{}
}}

- adam August 03, 2015 | 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