We study adaptive and nonadaptive methods for Lq-approximation and global optimization based on n function evaluations from a Wiener space sample. We derive (asymptotically) optimal methods with respect to an average error. The error of optimal methods converges to zero with the following rates: for Lq-approximation if if q = ∞, and for nonadaptive methods for global optimization. We show that adaption helps for global optimization.