Your question leads me to believe you are unfamiliar with Bipolar Junction Transistors (BJT). You should be able to benefit from reading the material in the AAC ebook that introduces the basics of BJTs at this link. By reading this material you will gain the familiarity you need to better understand these very interesting electronic devices.what is the purpose of putting r3, r4 and r5?
When Q1 is saturated, it pulls the base of Q2 below 0.7 volts. With Q2's base below 0.7 volts, it turns off.why is it when Q1 is on, Q2 is off?
and why is when Q2 is on, Q1 is off ?