Contrado Imaging interview question

Basic c# and logical question