Pergunta de entrevista da empresa Mtree Software

given two sorted array where first array has length of N but holds p values and second array is q length long where p+q = N. task was to merge both array into first without taking extra space . resultant must be sorted as well