"Coding tests should not produce useful code. They're designed to assess someone's ability without asking them to do proper work. If you end up doing real work in a test situation without getting properly paid for it then you're being scammed."
You can pass coding tests without being able to do the work. I really wished that a person who can do leetcode well can solve all engineering problems. Unfortunately, someone who leetcodes well may not be able to do the job.