Continental interview question

Draw circuit diagram Programming logic