A student had heard that rainwater is as good as distilled water. So, he collected some rainwater in a clean glass beaker and tested it. To his surprise he found that the compass needle showed deflection. What could be the reason?

Rain water can collect salts from the atmosphere has some dissolved salts whereas the distilled water does not. Thus, the rainwater showed the deflection because it conducts electricity.