In recent years, metasurfaces have emerged as revolutionary tools to manipulate the behavior of light at the nanoscale. These devices consist of nanostructures defined within a single layer of metal or dielectric materials, and they offer unprecedented control over the optical properties of light, leading to previously unattainable applications in flat lenses, holographic imaging, polarimetry, and emission control, amongst others. The operation principles of metaoptics include complex light-matter interactions, often involving insidious near-field coupling effects that are far from being described by classical ray optics calculations, making advanced numerical modeling a requirement in the design process. In this contribution, recent optimization techniques used in the inverse design of high performance metasurfaces are reviewed. These methods rely on the iterative optimization of a Figure of Merit to produce a final device, leading to freeform layouts featuring complex and non-intuitive properties. The concepts in numerical inverse designs discussed herein will push this exciting field toward realistic and practical applications, ranging from laser wavefront engineering to innovative facial recognition and motion detection devices, including augmented reality retro-reflectors and related complex light field engineering.