Research in Motion Interview Question
166 Interview Reviews |
Back to all Research in Motion Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Software Engineer at Research in Motion:
How would you draw an "X" on a screen made from smaller "x"s?
See more for this Research in Motion Software Engineer Interview
Helpful Question?
Yes |
No
Inappropriate?



1 of 1 people found this helpful
by Anonymous:
char[][] Xs = new char[MAX_ROW][MAX_COL];
for(int row = 0; row < MAX_COL / 2; row++) {
Xs[row][row] = 'x' ;
Xs[row][MAX_COL - row] = 'x' ;
}
Xs[MAX_COL / 2][MAX_COL / 2] = 'x' ;
for(int row = MAX_COL / 2 + 1; row < MAX_COL; row++) {
Xs[row][row] = 'x' ;
Xs[row][MAX_COL - row] = 'x' ;
}
draw(Xs);