I'm doing some exercises to the topic DFA and noticed, that most solutions I could find to a specific language do not look like my own solution to it and I'm kinda confused. The condition of the L is {w| w is any string in a∗b∗} and my DFA looks like this:
Most comparable solutions I could find merged q3 and q4 to one state with the possibility to add a and b at the and in any order and amount. I couldn't figure out how ab would allow it. In my mind ab means, that strings like a, ab, aab, abbb would be accepted but aba for example not. Am I wrong? Could anyone explain this to me, please?

The DFA you made is perfectly alright. Note that the language $L$ consists of four classes of substrings: $$L_1=\{\epsilon\}$$ $$L_2=\{a, aa, aaa, \dots\}$$ $$L_3=\{b, bb, bbb, \dots\}$$ $$L_4=\{ab, aab, abb, aaab, aabb, abbb, \dots\}$$ The state $q_0$ detects $L_1$, $q_1$ detects $L_2$, $q_2$ detects $L_3$, and $q_3$ detects $L_4$. Every other string is sent to the trap state $q_4$. One simplification you could make is reduce the number of states by using a single state to recognize both the substrings $L_3$ and $L_4$.