M3 doesn't really have homework. Sometimes you may have "homework" because your attending will ask you to give a presentation or do a case report on a particular topic or patient that you have seen or read about. Other than that, most medical schools have shelf exams at the end of each rotation. Shelf exams are nationalized exams written by the NBME (same people who write the USMLE exams). The entire country usually takes the same/similar shelf exam although the questions can vary from place to place or time to time. These exams usually make up anywhere from 15% to 50% of your rotation grade. You will have to study for these on your own time outside of your obligations as an M3.
M4 is quite nicer. Most schools do not have tests at the end of M4 electives. So you still may have to do things like give presentations or case reports as an M4 but there are no shelf exams. Most electives or AI's, you just work really hard during your time at work but once you come home, you're usually free to do what you want (like finishing up your applications for residencies 😀 )