X interview question

Questions on algorithms and binary concepts