OodlesTechnologies interview question

basic and advanced JS question