Fexle Services interview question

basic questions and pattern problem