If you can't give me the o(n) performance of the algorithm that you just wrote, this is a pretty serious red flag about your ability to understand what you are writing.
I'm going to blow your mind but a ton of important software was written by people who have a hard time explaining these things.
Also a ton of important software was written as a giant mess of spaghetti code, or with horrible security vulnerabilities.
I've never been tested on my ability to not write spaghetti code or write security vulnerabilities in my 15 years doing many many interviews.
Unless you're suggesting that knowing the performance of a loop helps with that?
What I'm suggesting is that "Important software has been written by people who couldn't/didn't do X" is not a very strong indication that X is not a valuable quality that employers should want in their engineers.
Except for the fact that using foreach instead of for has no impact on your O(n) performance.
What would you do if a candidate said with a smile "I'm pretty sure it is O(n!)"?
Parent commenter asked for little o, not for big O. So to be safe, better say n^o(n^2).
Hah this is the best comment.
“So you want to put code into production without having a better estimation of its time complexity than O(n!)?”