Does solution runtime and memory mean much for interview preparations?

I am wondering if I have to pay significant attention to whether my solution is ~100% in both time and memory. I'm not even sure if 100% for both can be achieved for all problems. It seems these can change significantly even if I remove a local variable, reducing readability, not to mention the different results for identical code.

Do the interviewers at top tech companies really care about this? If my solution is O(nlogn) in time and O(n) in space, as is the ideal solution, will they care if I have a couple of extra variables here and there? Should I always try to get the top results on Leetcode?

Comments (2)