The optimal heating or cooling strategy that minimizes entropy production is derived for a simple class of common heat transfer processes that are constrained to proceed in a fixed, finite time. The empirical wisdom embodied in conventional single-pass counterflow heat exchanger design is examined in light of this solution. For judiciously selected system parameters, the counterflow heat exchanger can yield the optimal solution.