Adobe Interview Question for Software Engineer / Developers






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

a 2 dimensional array can store where flags, etc. are. you can consider a 3 dimensional array as well - the third dimension can have the bomb/no bomb information as well as store a visible/flagged/hiding state.

you could also store two 2 dimension arrays i suppose, but that would take up more space.

- woohoo February 28, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

2d array of square objects

square
{
    enum state={revealed,flagged,questioned,untouched};
    state my_state;
    int value; // -1 is a bomb, 0-8 represent number of neighboring bombs
}

- KMD March 22, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I suppose you could describe more than that even:

class mineBoard
{
   class square
   {
        enum state{revealed,flagged,questioned,untouched};
        enum state my_state;
        int bomb_value;  // -1 for bomb, 0-8 for number of neighboring bombs
   };
   int width;
   int height;
   int num_bombs;
   square *board;
};

- KMD March 22, 2011 | 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