SAP interview question

how to resolve stack overflow exception