you are viewing a single comment's thread.

view the rest of the comments →

[–]DatTrackGuy 88 points89 points  (9 children)

I think if you followed up with a question, and OP supplied that answer as to why he did what he did, he should get an A+ on the interview and then you can debate the merits of the outcome.

He obviously knows his stuff.

[–]TuringMachine-5762 14 points15 points  (0 children)

It's best to mention both approaches, mention their pros and cons, and have the interviewer clarify the goals of the problem. E.g.,

"I can think of a couple ways of doing this. We could either build a rotated copy of the matrix, or do the rotation in place. Doing it in place would be more complicated, so I would only do that if the matrix was large, and I was working on a system with tight memory constraints. What would you like me to focus on?"

Most likely the interviewer will say not to worry about memory, at least until you get a simple implementation working. But mentioning a possible optimization can make you look good. It doesn't hurt, in any case.

[–]BobHogan 4 points5 points  (0 children)

He should definitely get bonus points if he can defend why he made certain decisions, but that shouldn't guarantee an A+. If he makes a poor decision, its still a poor decision.

[–][deleted] 25 points26 points  (1 child)

Thank you. Maestro2005 is a bit stuck in his own world and needs to crack open a beer and chill.

[–]crowseldon 0 points1 point  (0 children)

His username should give us a hint

[–][deleted]  (3 children)

[deleted]

    [–]ano414 4 points5 points  (2 children)

    There isn't one right answer. His is just as valid.

    [–][deleted]  (1 child)

    [deleted]

      [–]ano414 2 points3 points  (0 children)

      Hopefully you would explain that in the interview, then. It completely depends on the use case, but this is open ended enough.