Virtusa interview question

Questions on Subarray and string.