We study the minimal dimension of solvable and nilpotent Lie algebras over a field of characteristic zero with given derived length k. This is motivated by questions on nildecomposable Lie algebras g = a + b, arising in the context of post-Lie algebra structures. The question is, how the derived length of g can be estimated in terms of the derived length and nilpotency classes of the two nilpotent subalgebras a and b.