I've been doing a lot of leetcode and sometimes bump into questions like #41 that pose a problem to be solved with constant space and (usually) linear time. I have done quite a few interviews over my career, but I've never actually encountered one of these in an interview. They're usually pretty trivial questions to answer if you can use linear space but tricky to figure out in constant space.
I'm wondering if anyone has actually encountered one of these in an actual interview. If you have, and were unable to come up with the O(1) space solution, do you think it ruined your chances?
If you're someone who is good at these questions, do you have any tips or tricks to suggest?
Thanks for reading.