Are you referring to cases where the composer is writing in C-flat (7 flats) when they could just write in B (5 sharps) and have done with it? That’s a darn good question, and one I don’t have an answer for. If you’re asking why bother with the tough key signatures altogether, it probably has to do with that being where the composer hears the notes. They just fit in the framework of, say, D-flat rather than C.
I’m not an authority on Eastern scales, but there are some Western scales that have intervals greater than a whole step. Most notably, this would be the harmonic minor form of a scale. There ends up being a step and a half in between the 6th and 7th scale degrees.
No, it is not possible for there to be both flats and sharps within the same key signature. That isn’t to say that you can’t use sharps as accidentals throughout the course of the song. What really gets crazy is when you have things like double sharps. Like so:
The key of G# minor is considered to be the relative minor of the key of B Major. This means that it shares B Major’s key signature. If we were to write G# minor in its “natural minor” form, we’d use the 5 sharps that are in B Major (F# C# G# D# and A#). Like this:
G# - A#- B - C# - D# - E - F# - G#
If we convert this into harmonic minor, we raise the 7th scale degree by one half step. The reason for doing this is to preserve the half step leading from the 7th note back to the main (or tonic) note of the scale. In a C scale, for example, the B really leaves you hanging and waiting to hear C again. That’s why the 7th scale degree is referred to as “the leading tone”.
If we raise the 7th note in the key of G# minor, it would mean raising F# to, essentially, G natural. But the rules of music prohibit it being written as a G natural, because that would mean we’ve skipped F in the scale, and are using G twice. So instead, it gets written like:
G# - A# - B - C# - D# - E - F## - G#.
So, F## = G. And yes, G# = A-flat no matter what the instrument is.
Hope this helps!
spousebicycle (piano teacher)