Amazon Interview Question

The task is to implement a low-level data copy function for a network driver that handles fragmented packets. We are given an array of source memory segments and an array of destination memory segments, where each segment is defined by a data pointer and its length.