Moody's interview question

Complete some functions in c# and jquery