Safenet Interview Question for Developer Program Engineers






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

7|1|6|4
-------
5|3|8|2

- red-cheeks November 11, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Great !!
Thanks !!
Can u generalize the solution or is it hit and trial thing.

- gamodg November 11, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

There can actually be many solutions:

7|1|8|4
-------
5|3|6|2

7|3|6|4
-------
5|1|8|2

Only thing i can guess is that 1 and 8 should occupy those middle four square as they just have affinity for single number.

- JoshMachine November 11, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I'll try a heuristic,
the middle boxes are surrounded with more number boxes, our goal is to not to have neighbors. so lets take a number from 1 to 8 that has less neighbors which is either 1 or 8.
place it in the middle 4 boxes then alternatively place continuous elements

- 1 - -        - 1 - 2            - 1 - 2          - 1 - 2
- - - -        - - - -            - 3 - -          - 3 - 4

and then

5 1 - 2        5 1 6 2            5 1 6 2          5 1 6 2        
- 3 - 4        - 3 - 4            7 3 - 4          7 3 8 4

you could try selecting different box for 1 as below:

- - - -        - - - -            - - 3 -          4 - 3 -
- - 1 -        2 - 1 -            2 - 1 -          2 - 1 -

and then

4 - 3 -        4 - 3 -            4 - 3 7          4 8 3 7 
2 - 1 5        2 6 1 5            2 6 1 5          2 6 1 5

feel free to suggest advanced heuristics. thanks

- chennavarri November 11, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Let me try to formalize it
1. Divide even and odd in halfs
Since any pair of consecutive number consists of an even and an odd
number hence these two cannot be in the same half.
2 Place 1 and 8 on the separation line between even and odd.
Since 1 and 8 have affinity for one number only hence solution is
possible.
Comments and inputs are welcome

- gamodg November 12, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Another way could be: 1-5-4-8
in second line: 3-7-2-6

- Anonymous November 15, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Wrong. 4 and 5 are next to each other.

- JoshMachine November 15, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Arrange odd number on left four block and even number on right four block and vice versa. And try to do some manupulation.
e.g
7 5 8 2
3 1 6 4

7 3 8 2
5 1 6 4

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

Can it be also this:
1 5 2 6
3 7 4 8

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

How abt this?
1625
3847

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

It can be
1 5 8 4
7 3 2 6

- Piyush March 10, 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