In diatonic repertoire, formal structure inevitably includes modulations to different keys. This is what gives music direction, color, and interest.
It may seem intimidating to have to write a melodic dictation that contains a modulation. Remember, however, that the procedure for modulation is highly rational and predictable.
Most diatonic music is “dominated” by the dominant-tonic relationship. Therefore, the dominant is the most common key to modulate to.
In minor keys, it is also very common to modulate to the dominant. Further, it is common to modulate to the relative major.
One of the easiest ways to hear that a modulation is taking place is to listen for the presence of accidentals – tones that wouldn’t appear in the initial key signature. One of the commonest accidentals you’ll hear is the leading tone (ti) of the new key. This is because ti is part of dominant harmony, whether that’s chord V (sol-ti-re) or chord V7 (sol-ti-re-fa).
In this example from the first movement of Joseph Haydn’s Cello Concerto in C Major Hob. VIIb:1, the F-sharp in the third measure (fi in the home key of C major) signals a modulation to the dominant, G major, where it is of course the new leading tone.