LIN-2/7 (L27) domains are protein interaction modules that preferentially hetero-oligomerize, a property critical for their function in directing specific assembly of supramolecular signaling complexes at synapses and other polarized cell-cell junctions. We have solved the solution structure of the heterodimer composed of the L27 domains from LIN-2 and LIN-7. Comparison of this structure with other L27 domain structures has allowed us to formulate a general model for why most L27 domains form an obligate heterodimer complex. L27 domains can be divided in two types (A and B), with each heterodimer comprising an A/B pair. We have identified two keystone positions that play a central role in discrimination. The residues at these positions are energetically acceptable in the context of an A/B heterodimer, but would lead to packing defects or electrostatic repulsion in the context of A/A and B/B homodimers. As predicted by the model, mutations of keystone residues stabilize normally strongly disfavored homodimers. Thus, L27 domains are specifically optimized to avoid homodimeric interactions.