How to figure out which wordpress theme a site was using?

In general it is impossible, and probably pointless as well. It is not enough to know which theme is being used but you will also need to know its configuration and then what about different versions, local changes or even server settings (ok, this probably only in rare cases).

The best way to know what theme is used on a specific site is to ask the owner of the site. If it saves you half development time then you might consider even paying for the info.