Is there a reasonable delay where you can assume that you may have been infected and then test? Wait X number of days after someone tests positive and you know you had potential exposure to them.Get the point but a test, technically, is not really enough "to avoid quarantine". You could become positive after the test (exhibit A: Trump and the debates). The only way to be sure is to test after (I can't remember the exact recommended time...heard different things when a pod of my son's had to quarantine after exposure) 7-10 days.
Has happened on multiple occasions with my kids. Confirmed positive tests from friends (asymptomatic). We waited 3-4 days then tested everyone in our household. Tests came back negative. Frustrating to say the least but a necessary evil I suppose.