Coinjoin transactions leave a fingerprint on the blockchain. Here is an example coinjoin transaction: https://mempool.space/tx/db417ce9e468bfa55a563eb9912a8252fe9205e373771087ca118aaabdfa6457
Some of the typical characteristic of coinjoins are:
  • there are more than three inputs (i.e. "from" addresses)
  • there are more than three outputs (i.e. "to" addresses)
  • at least three of the outputs have the same value
An exchange can detect if a coin was in a coinjoin by scanning the blockchain for the transaction that sent money to your bitcoin address from some other bitcoin address, and then checking the transaction that sent money to that address, and so on. If any of the transactions in your coin's history was a coinjoin, then they know your coins were in a coinjoin once. But they cannot trace them back further than that because the whole point of coinjoins is that you can't figure out which sender sent money to which recipient.