BAE Systems interview question

Two technical questions, coding and an electrical circuits question.