Dominant sevenths are basically an arpeggio with an extra note - 1, 3, 5, 7 & 8.
To work out dominant sevenths for exams etc. you will need to know what key you are in (see key signatures). Once this is established, find the fifth degree (dominant) and build an arpeggio (1, 3 & 5). To complete the dominant seventh, include the seventh note from the start of the arpeggio making note of the original key and the top note (8). To understand this a little better, here is an example using just four steps.
What is the dominant seventh of G Major?
Find out the key signature of G Major (this has an F# in it)
Find the dominant (the dominant or fifth degree of G is D) Building on the dominant/fifth degree is important here. Otherwise you will be starting the arpeggio on the wrong note and completely missing the point of dominant sevenths.
Build an arpeggio on D (D, F#, A & D)
Add the seventh note of the arpeggio keeping in the original key (Because we are in G Major, this is C not C#)
Put them all together to make the dominant seventh- D, F#, A, C & D.