In an interview, I was asked to write an implementation of strcpy and then fix it so that it properly handles overlapping strings. My implementation is below and it is very naiv
You could probably use memmove() if you expect the strings to be overlapping.
char* my_strcpy(char *a, char *b) { memmove(a, b, strlen(b) + 1); return a; }