Anytime I'm given non-trivial homework for a job interview, I decline because there are a dozen other companies that can determine my competence in a few hours of interviews.
I understand that hiring is risky for startups, but this approach seems excessive for what it is supposed to determine. It seems like you could get nearly all the same principal information about a person's talent by giving them an even more simple assignment, like writing a method to determine if two dates overlap.
A lot of what you're looking for is to see if a developer follows industry best-practices. It's just as easy to ask them, "what are some security/design considerations that need to be accounted for when creating a login page." You get the same information but in much less time.