How is it legally different to sitting a one hour interview? You're not getting paid for that either, that doesn't make it a minimum wage violation because its not doing work.
I think their code test / interview process sounds terrible, but the two days of code test is part of the interview, it's not producing code for the company to use.
(I do think that any company that wants applicants to spend that much time should pay for that time, but only for ethical, not legal, reasons.)