It is connected in parallel across a resistor. The reason for doing this is to bypass an ac current away from the resistor. The capacitor provides a short for the ac. You can use the following rule to calculate the capacitance:
Make the reactance at least 10 times smaller than the total resistance in parallel with the capacitor.
[Ukrainian] [English] [Russian]