Hah, this is me with many interview questions, because you rarely ever get something like: "How would make a RESTful API to allow retrieving and changing some data from a PostgreSQL DB", instead it's just Leetcode problems that have (comparatively) little to do with the day to day, especially when you're expected to know, not look up the solution like you would normally. So there's not a lot that you can do, but just familiarize yourself with algorithms and ways to solve common problems and write plenty of code. :)
I imagine it's quite a lot like that in most specialized domains, be it solving physics or maths problems, or even using Excel for interesting use cases.