BAE Systems Interview Question

Two technical questions, coding and an electrical circuits question.