So from experience (don't judge me, it was years ago...) I know that when a person with little knowledge about a field try to explain a problem to someone with a lot of experience it can easily lead to a lot of misunderstandings, everyone gets frustrated and more often than not nothing good comes out of it. So this time I will try with an analogy that (some) children can understand in order to explain my question. If you are too lazy, simply scroll down for my most likely terrible attempt on a short explanation.
Story
Once upon a time there was a guy called Bob, Bob was a great mechanic and he wanted to build a racing-car, and as anyone who wants to build a racing-car he wanted it to go as fast as possible. He knew his highschool maths and physics, however he knew that it would not be enough for finding out how to make the fastest car. Bob was very lucky because he had gotten his hands on a machine that calculated how fast a car would go based on a lot of knobs and switches that controlled things like, car height, type of engine, shape and etc. Unfortunately the machine was very slow and used around 5-10 minutes for one calculation. Bob knew he could make an other machine that would try a lot of different random combinations and try to find the best one, but he also knew that there were so many combinations that he would never be able to try all of them. Another problem is that Bob has no idea of how his machine works and he thinks there is no way he could find out.
Question is: how to help Bob?
tl;dr
I have a very slow and complex function $f(x_1 \cdots{} x_n)$ and I would like to find the best way to maximize/minimize this function with the least number of runs.