Allegion Interview Question

Technical questions and asked to write logics