Interaction forces among residue pairs are determined from optimum folding pathways along which a protein represented as a coarse-grained chain of alpha-carbons goes from different initial configurations to a known native state. A dynamic optimization approach is employed that uses the coarse-grained model to compute the optimal folding pathways. The pair-wise interaction forces obtained in this manner are incorporated into the coarse-grained model which is then simulated to fold the protein from a new set of initial configurations in a predictive way. We show that the folding pathways predicted in this manner are near-optimal. We applied the technique to the secondary structures: helix and beta-sheet.