Fanatics interview question

Algorithm in C#, Basic questions