code I've written to answer interview questions