The order of sharps in key signatures is F, C, G, D, A, E, B, while the order of flats is the opposite: B, E, A, D, G, C, F.A key signature, consisting of either sharps or flats, appears at the beginning of a composition, after a clef but before a time signature.
There is an apparent reason for the dominant’s tension: the semitone movements that happen in the transition from the five to the one chord. For example, in the key of A, the dominant chord is an E7 (which has a flat seven and is known accordingly as dom7). It is a powerful musical tool that has become so familiar to the Western ear that if you were to sing a dominant chord to any average non-musical person, they would surely be able to sing, or at least sing in the direction of resolution to the tonic. Nothing can resist the tension created by the dominant–it just screams to be taken home to the tonic. If you believe that the world is balanced between good and evil, you could say that diatonic harmony sits in a balance between the five and the one, or the dominant and the tonic.