'... the weather' vs. '... weather'

Solution 1:

Weather is a mass noun. When you ask about the quality of a mass noun using be, then it requires the definite article:

Was the weather nice?
Is the milk off?
Was the honey sweet?

Asking about having a mass noun means you can keep or drop the:

  1. Did you have the nice honey?
  2. Did you have nice honey?

It is important to note that these sentences mean different things. Sentence 1 is asking if, between a selection of honeys, the person had the nice one. Sentence 2 is asking if the honey that the person had was nice, but does not imply that there was a range to try from, that fact is not something you can determine from the question.

When we look at this construction with weather

  1. *Did you have the nice weather?
  2. Did you have nice weather?

Sentence 1 is semantically incorrect because weather is not something you can choose. However, you can modify the question to be, for example, about a previous aspiration and it then requires the definite article:

  1. Did you have the nice weather you were hoping for?
  2. *Did you have nice weather you were hoping for?

As you can see, this modification makes the second sentence grammatically incorrect, because aspirations require a specific instance to be talked about.

Solution 2:

This is not a weather phenomenon, that might be what's confusing you. Consider:

Was the food delicious?
Did you eat delicious food?

Were the beds comfortable?
Did you sleep on comfortable beds?

Was the water warm?
Did you swim in warm water?

Was the flight bumpy?
Did you have a bumpy flight?

The general constructs used here are:

Was [the][noun][adjective]?
Did you [verb][adjective][noun]?

In these constructs, when the noun is a plural noun or a mass noun (e.g., weather, water, beds), the article is generally removed. However, when the noun is singular (such as in last example – flight), the article is retained.

Regarding the first example (the one with food), change it to meal or meals, and see how pattern continues:

Was the meal delicious?
Did you eat a delicious meal?

Were the meals delicious?
Did you eat delicious meals?

Solution 3:

'the weather' is in reference to how it was at a paticular situation of place and time.

Without the article, it refers to the weather in general.

The first question is about a situation already mentioned earlier in another sentence.