For the second situation, it isnt always that they want to be asked the question. Sometimes they noticed a change in your behavior recently and are checking in on you.
Example, you're eating lunch and you love chocolate pudding. You usually eat your chocolate pudding every day without fail. Today, you didn't eat your chocolate putting and just left it sitting there.
A: "Hey" B: "Hey" A: "So... what's up?"
Regardless, "what's up" is just a place holder for "how are you". Sometimes that is just small talk and a way of fulfilling simple social interaction, and sometimes it is a question with genuine interest in knowing what is going on in your life (or asking you first, so they feel comfortable sharing what is going on in their own life).
I always find it easiest to give a simple and short, but honest, response, and elaborate further if they show interest with follow up questions. Of course, giving them information you are comfortable giving that person.
A: "What's up?" B: "Not much, I'm a little tired today. You?"
or
A: "What's up?" B: "Kind of sad, but I don't want to talk about it."
While true that they could have searched on the internet, in the time it took you to berate them you could given them am answer.
Also, this is Lemmy, you should have said "you can DDG it".