Skip to content

Comment on Which is faster? while(1) {} or while(2) {}

Comments

This question was asked to me in a major MNC by a senior manager, after 4 technical round. He started off by asking how do I manage conflict in team and went on to say "for example, if you write while (2) { // some code } and someone in code review suggests that replace this with while (1) or vice-versa, then how do you handle the conflict and how do convince him". I said both are same speed. he interuppted and said "check your basics, while (1) is faster " and moved on to next set of questions. He was not testing my confidence. He actually bilived that while 1 is faster.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.