Google interview question

algorithm, coding for DMA copy