TATA ELXSI interview question

Electronics questions and Programming question to write a function.