Amazon Interview Question for Interns


Country: India
Interview Type: Phone Interview




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

Construct a graph and see whether it is bipartite or not.

Let us say u represent a developer node by red color and tester by green color, walls as edges . If no two adjacent nodes have same color then Answer to the manager question is YES or else it is a NO

- Pras January 25, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

How it is yes in your example ? You cannot sit anybody in cubicle 2 as every cubicle is adjacent to it, then how will place them in cubicle 2 ?

- Coder January 24, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

this is typical two colors problem. You can start at any office with for example tester in it, then check all directly connect offices, if there is one that has tester, then report no. Otherwise, assign all the neighbor offices with mark developer, so on and forth. Time complexity is O(E), space complexity is O(V).

- Anonymous January 28, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

This is simply a 2 coloring theorem. A graph is 2 colorable if and only if it has no circuit of odd length. Finally if it is a tree it is obviously 2 colorable.

- Anjan January 30, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

This is can be done in two ways:
1. Check if there is odd number of cycle. If it is then it is NO
2. If it is even number of cycle the print yes
3.If it doesn't contain cycle print yes.

-This is a bi-partite graph.

Second method:
DFS
Check if there is an edge from child to parent. If it is then check whether the parent is "Tester or Developer". If it is same as child then Print NO. Otherwise "Yes".

- yagamiram February 09, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I don't know how to solve this, can anyone share the code and approach they used, Thanks.

- User July 25, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

can anyone share the code for this ?

- User July 25, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
-1
of 1 vote

its not required... :)

- vinod January 24, 2014 | 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