Solutions to coding questions