MAQ Software Interview Question

2 coding question each in 1 round.