Unisem interview question

Basic function of transistor and resistor