Each key signature is related to a major key and its relative minor. With practice it is possible to memorise the accidentals associated with each key. Meanwhile, key signatures can be identified and constructed in other ways.
The related major key is a half-step above the last sharp:
The corresponding major key is a perfect fourth below the last flat. If there is more than one flat, it is also indicated by the penultimate flat:
See S > Scales for related topics.