This was my exact experience when interviewing for Google 5 years ago. Extremely irritating to write (and see) code like that.
assuming it was remote, that's not so bad. if it was in office then they might have used a white board. is that also bad? most of the work of a soft eng is not simply writing code and compiling. most of the time is actually spent discussing
Yes but sometimes you do have to code, and when you do code you use certain tools. That's why there are dozens of companies that help solve this problem for technical screens.
Is there an explanation why ?
Some Chinese companies use it as a filter for culture fit. Mainlanders who can't access Google Docs are either unable or unwilling to circumvent the Great Firewall, and they want to hire neither of those groups.