Allegion interview question

Technical questions and asked to write logics