Bajaj Markets interview question

Graph problems and one simple array problem