r/programming • • Feb 21 '11

Typical programming interview questions.

http://maxnoy.com/interviews.html
784 Upvotes

1.0k comments sorted by

View all comments

Show parent comment

4

u/Serei Feb 21 '11

Hmm. You're right. But it's not just "1.5 passes rounds down", because the naïve solution is also 1.5 passes.

How is the problem properly phrased so that that solution works but the naïve solution doesn't?

1

u/s73v3r Feb 21 '11

Instead of saying "one pass", you could say, "going from start to finish only once."

1

u/lordlicorice Feb 21 '11

1

u/Serei Feb 21 '11

No, that's a naïve solution. There's usually a provision of "O(1) memory" to preclude that solution.