When writing code in an interview, I've seen people advising to write code as simple as possible. So, when in an interview, which of the following should I choose?
if(i % 2 == 1) vs if( i& 1)
i * 2 vs i << 1
i /= 2 vs i >>= 1The left counterparts are easier to read and the intent is clear. But sometimes when I submit solution in leetcode, I find it very strange that my solutions runs in 0ms (or faster than 100% submissions) just changing the left counterparts to the right counterparts. Shouldn't they offer the same performance in a modern compiler? And with which style am I better of using in an interview?