The nonlinear optical response of materials to exciting light is enhanced by resonances between the incident laser frequencies and the energy levels of the excited material. Traditionally, in molecular nonlinear spectroscopy one tunes the input laser frequencies to the molecular energy levels for highly enhanced doubly or triply resonant interactions. With metasurfaces the situation is different, and by proper design of the nanostructures, one may tune the material energy levels to match the incoming laser frequencies. Here we use multi-parameter genetic algorithm methodologies to optimize the nonlinear Four Wave Mixing response, and show that the intuitive conventional approach of trying to match the transmission spectrum to the relevant laser frequencies indeed leads to strong enhancement, but not necessarily to the optimal design. We demonstrate, experimentally and by direct nonlinear field calculations, that the near field mode distribution and spatial modes overlap are the dominant factor for optimized design.