Once I was given a task to create some validation code for given criteria and integrate it in the given project.
They then invited me to an in person interview. At one point, I had to pair program with one of their developers and what I saw kind of shocked me. They integrated my code from the interview into their production code and their developer had an issue with it and asked me to help getting it working and write a couple of extra tests. So I did and they seemed very happy.
I didn't get the job though. They said I am not a "cultural fit".
I asked them if they actually used my code and if so they would have to pay me for the whole day, but they never responded afterwards.
I decided it wouldn't be worth to legally pursue, but since then I decided to not do any pair programming or coding tests.