VANS Interview Question for Developer Program Engineers


Country: United States




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

its a dynamic problem..

1. Let the source be grid[0][0] if it is not Zero. then keep on adding max(left,right,up,down) and change the visited grid[i] [j] to zero..so that it cannot be visited again..

2. if you cant move further store the temporary sum say 'temp_sum' in a separate variable say 'max_sum' and start check the other non-zero grid..

3. if the temp_sum becomes greater than max_sum, then max_sum = temp_sum

is my idea right?

- cobra July 14, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I can't tell exactly what you're proposing. That doesn't sound like dynamic programming; it sounds like backtracking.

Success on this problem probably depends on how exactly you go about using this backtracking.

- eugene.yarovoi July 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

this Que. was asked in interviewstreet.com ->EKO. I tried to solve it but could not.
Please reply the code with efficient algorithm

- Mukeem July 14, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Yeah, sounds like a simple backtracking solution is likely to time out. I'm guessing you need to exploit the fact that the order in which items are visited doesn't matter.

- eugene.yarovoi July 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Actually the order in which items are visited does matter here.
A particular choice of direction can leave some of the other cells unvisited.

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

That's not what I meant. I meant that, provided you manage to visit the same cells, the order in which you visit doesn't matter. But yes, the order may affect which cells you are ultimately able to visit.

I'm saying that the fact that we only have to track which combinations of cells can be visited and that we don't have to track all the ways in which identical combinations can be visited may reduce complexity.

- eugene.yarovoi July 15, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

'

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

and 1=

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

' and 1=

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

\'

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

'''

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

ookjk85h74

- Anonymous November 03, 2012 | 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