This is how companies like google, facebook, and linkedin interview candidates. It's not effective, but it's the common practice
In the end as a developer your job is to solve problems, and getting hired is simply another problem (solving which has self-evident benefits, so you shouldn't lack motivation).
It's not like the hiring process for technical jobs is shrouded in mystery: there are tons of resources on the internet about it.
You know what kind of questions will be asked, you know how you are expected to answer, the rest is just study and practice: a successful interview should be at least proof for the employer that you are able to grasp that process and carry out the work necessary to see it through.