Using stochastic optimizer combined with Mie calculations we provide a route to design multilayer spheres with predefined properties. As an example, we considered two cases. First, we come across some limitations to achieve cloaking effect using dielectric metamaterials and compare obtained designs against previously published results with the use of naturally available dielectric materials; we found that usage of metamaterials leads to a new type of cloaking. Second, we designed highly efficient spherical absorber using realistic material parameters of silver and silicon. It turned out that to achieve the best absorption efficiency for a spherical particle there is no need to tune several multiple resonances using complex multilayer structure; due to dimension effect properly designed spherical particle with only a dipole response is the best one.