How do I answer the expected salary question?
With a range anchored on evidence, and the question turned around first: asking what the band for the role is costs nothing and is answered honestly more often than people expect. If the answer is refused, that is information too.
How long should a take-home exercise be?
Under three hours, with a stated cap and an explicit instruction to stop. Anything longer selects for people with free evenings rather than for skill, which is a filter most teams would reject if it were stated out loud.
Anything that changes this at ten times the scale?
At ten times the size the bottleneck moves from the operation itself to what it competes with: memory, locks and the people who have to run it. The approach stays, the batching gets smaller and the schedule matters more.