Let [Formula: see text] be a positive, Lebesgue integrable and exponential decay function defined on an infinite interval [Formula: see text] and let [Formula: see text] be the space of weighted Lebesgue integrable functions on [Formula: see text]. In this paper, we give the relations of the best one-sided approximation and the optimal Hermite–Fejér interpolation by the set of algebraic polynomials of degree not exceeding a given number for the smooth function classes [Formula: see text], [Formula: see text], in the metric of the space [Formula: see text] and prove that the Hermite–Fejér interpolation based on the set of the zeros of some orthogonal polynomials is optimal in [Formula: see text]. In addition, we show that the approximation error of the optimal Hermite–Fejér interpolation and quadrature errors of the weighted Gaussian quadrature formula are equal, and give the exact constant of the errors.