Interland interview question

pattern printing questions and logical