Jive Software interview question

simple algorithms to implement