Drawbridge Interview Question

One coding exercise and design question