It may be stressful, but I would not sweat it. In my experience, the only way to get better at interviews is to do more interviews. Then the random questions start becoming more common.
I interviewed a guy once who was trying to talk his way into a VP-level position. Except he was talking to me, and I was just a hired hand suited only to make a recommendation for a n additional developer. The guy had a sound mind but the company was not hiring for his role.
At the same time, I mostly don't want to work at the companies that do puzzle interviews, though you may feel differently. A lot of times these center on approaches like recursion algorithms, but I'm a full-stack/backend web developer, and I've written less than 10 recursion functions for production. I now ask these interviewers how often they write recursion algorithms and the answer I usually get the line "oh it's just useful to know the underlying concept," except it isn't. I can write them, but I don't care for them, and the concept isn't particularly mind-blowing, and you'll have to explain it to the rest of your team.
I interviewed a guy once who was trying to talk his way into a VP-level position. Except he was talking to me, and I was just a hired hand suited only to make a recommendation for a n additional developer. The guy had a sound mind but the company was not hiring for his role.
At the same time, I mostly don't want to work at the companies that do puzzle interviews, though you may feel differently. A lot of times these center on approaches like recursion algorithms, but I'm a full-stack/backend web developer, and I've written less than 10 recursion functions for production. I now ask these interviewers how often they write recursion algorithms and the answer I usually get the line "oh it's just useful to know the underlying concept," except it isn't. I can write them, but I don't care for them, and the concept isn't particularly mind-blowing, and you'll have to explain it to the rest of your team.
Anyway, hang in there, best wishes