I've interviewed at companies like this (Amazon / Google / Microsoft) and they do indeed tell you ahead of time there will give algorithms / data structures / coding.
After two years Amazon called be back for a second interview. I told them that I am not interested if they still have that kind of questions. They said they don't.
I flew to a different country for that second interview and guess what! They still asked those kind of questions.
Smaller companies could just email applicants their hiring process detailing what they expect at each stage. Tiny amount of work that will save a ton of lost time & hurt feelings.