Microsoft Interview Question for Software Engineer in Tests






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

(x*# of columns) + y

- anon November 20, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Assumptions:

1. x represents the columns and y represents the rows.
2. Maximum number of columns: x_len.
3. Numbering of rows and columns begins with 1.

Then,

1_D_index(x,y) = (y-1) * x_len + x [if y > 1]
1_D_index(x,y) = x [otherwise]

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

I have been asked the same question, be careful guys, as coordinate (x,y) is represented by one bit and in C, minimum that we have is character array. So you need to convert your position to correct array element first and then you have to apply bit wise operation to set the correct bit

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

int c[10][10];

int *p;

p = *c;

*(p + ( ( x * screenwidth ) + y ) ) = 1;

- SK January 03, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

How will do the bit wise operation once you have the correct array position.

- Nishant January 18, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think this is how it will be done

position in 1_D array = (x*no of columns)+y which is let say 'pos'.
and then you just have to do arr[pos] = 1<<0.

- Nishant January 18, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

can you please explain what you did there?

- Dude November 02, 2010 | 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