Earlier quoted context omitted.
It’s easy really. Walk. As a senior it’s insulting to expect to do a four hour take home test. When you hire a Michelin star chef do you make them make you a four course meal to prove they can cook? Do you make a surgeon do four hour surgery? It’s absolutely asinine that we accept this behavior in our industry. You’d be laughed at by every possible candidate in other industries.
I immediately decline if a company asks for unpaid work as part of the interview process. If it’s paid I don’t have an issue with it. I assume if a company starts the relationship with asking for unpaid work that expectation will continue throughout your employment. There are simply too many companies hiring that don’t require this that it’s easy to just pass.
Take-home challenges aren't unpaid work. They're just a take-home replacement for the on-site interview.
If anyone tries to get you to do unpaid work (as in, actual work that the company needs to be done rather than an arbitrary challenge given to candidates for review) then you should absolutely walk.