Yes, that's a common technique. Another, depending on how they found and contacted this startup, is that the test isn't really from the company it claims, the contact person is actually a candidate who is tricking people into completing the take home assignment on his own interview somewhere else. A third technique, when the questions seem like homework questions, is that it can be a student somewhere impersonating a company and posting fake job ads in order to get other people to do his school assignments.
Generally one should verify the company exists and that their contact works at the company before proceeding with these. Also if the assignment appears to be exactly something that would be of great benefit to the company and also takes a good amount of work, it is best to decline as some companies use sham job interviews to get free contract work done.
A few lines of code by some random person are not going to help your company, unless there is 'deep insight' i.e. maybe some high end AI thing, etc..
Code needs to be owned, maintained, up to spec, documented, integrated.
There's nary some random person can do remotely with little guidance that's going to help.
The 'coding' part isn't that hard, it's all the details etc. that matter.
You'd waste far more time and energy trying to get the right person, the right bit of code, changing it to suit the common architecture etc..
Obviously there are ethical questions, but they're moot if it's a stupid exercise to begin with.