Oh, I see.
There are two ways to ask about a hat: Whose hat is this? and Whose is this hat?. There's no difference really, but the rule is still the same, they correspond to Ukrainian Чия це шапка? and Чия ця шапка? You just always have to think about what does "this" means in a sentence. Is it an adjective? Is is a pronoun?
These sentences are different grammatically.
"Чия це шапка?" = Whose hat is this? -> the subject is "this", "this" can be interchanged with "it" ("Whose hat is it?"), "this" is a pronoun that plays a noun role. An answer to this question: "This is my hat".
"Чия ця шапка?" = Whose is this hat? -> the subject is "this hat", "this" cannot be replaced by "it" ("Whose is it hat?"), "this" is an attribute of "hat", a pronoun that plays an adjective role. An answer to this question: "This hat is mine".