I always walk away from those situations. I just don't have 8 hours I can give unless I'm 80% confident it'll work out, or I just want an excuse to try some new tech.
Had a small company try the coding test “pre screen” with me. Normally I’m fine with those, but this one wanted you to implement a 1-D Discrete Cosine Transform then use it to detect edges in a grayscale bitmap file. In C, without using any existing code or libraries.
I told them I could either lift the DCT code from at least a dozen different sources and change the variable names and indentation, or I could spend several hours implementing the algorithm from scratch by reading academic papers. 1 was against the rules of the test and 2 would just be a ridiculous waste of my time.