We describe a simulation method to design surfaces for recognizing specific monomer sequences in copolymers. We fix the monomer sequence statistics of the AB copolymers on a surface containing two types of sites and allow the simulation to iterate towards an optimal surface pattern that can recognize and selectively adsorb the sequence in the copolymer. During the simulation the surface pattern is designed by switching identities of two randomly picked sites. For copolymers with less blocky sequences the designed surfaces recognize the correct sequence well when the segment-surface interactions dominate over the intersegment interactions. For copolymers with more blocky sequences recognition is good when the segment-surface interactions are only slightly stronger than the intersegment interactions.