Jive Software Interview Question

simple algorithms to implement