[Solved] Difference between i++ and i– [closed]


This is an excellent interview question because any answer you give is likely to be wrong and more importantly be something you never previously thought seriously about.

The whole point is to throw you off your game. They want to see how you react when you’re pushed into an area that you feel like you should be expert in yet find something about which you are not. Knowing the perfect answer to this question doesn’t help you because they’ll have 12 more questions lined up to throw you off.

What they want is to see how you respond to this situation. Do you make stuff up? Do you think about it carefully? Can you justify why it’s not an important concern? Do you insist your way of looking at it is the only valid way? Do you listen when told of another way? Are you a pain to deal with if told to do it another way?

They will care so much more about the answers to this than whether or not you can save them a CPU clock tick.

But if it turns out you are an expert in this one dusty arcane corner you might earn a point.
If that is your real question then it’s a duplicate of this question: Which of these pieces of code is faster in Java?

2

solved Difference between i++ and i– [closed]