Align Technology interview question

some logic questions and avarage code challenge