Is there any way to improve this? To be honest, I am asking this because I am failing every single interview screening which generally involves trick questions. I would love to know the relation between the two.
Is there any way to improve this? To be honest, I am asking this because I am failing every single interview screening which generally involves trick questions. I would love to know the relation between the two.
The trick is to code a lot outside of the competitions and know all these tricks, as well as to have common snippets of code in your fingertips.
I still find that experience quite useful in my day-to-day programming.
You may find these book useful:
Competitive Programming 3 by Felix Halim and Steven Halim.
Competitive Programmer’s Handbook (https://cses.fi/book/index.html)
>I have rarely found the need to code one up in my job
Depending on your job profile, these data structures may not be used at all. But programming puzzles have become the norm for interviews in the industry.