Viridien Interview Question

several math problems, plus PHP and MySQL coding