Yahoo Interview Question for Software Engineer / Developers






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

Magic square solution.
you can use magic squares and when a player inserts into a position just add it to previous sum. if sum == n(n^2+1)/2 then the player has won. the only problem is how to construct a magic square.
Ex for a 3x3 tic-tac-toe

8 1 6
3 5 4
4 9 2

when a player makes a move just add the value at that position. whenever the sum of three positions is 15 then the player won.

- chennavarri October 08, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

can you explain it with an example !

- Aditya October 12, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

MATRIX should b like

816 
357
492

- Aditya October 12, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Ya that was a typo.

- Chenna October 12, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@chennavari: Not correct. What if player wins in fifth move?

- Tulley January 06, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Whenever player places a coin, check for that particular row and column cell for the same coin. If the cell position is i == j, then the cell is in diagonal, then check for the diagonal. If the cell position is center then check both the diagonals.

- Ram October 08, 2010 | 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