There are many settings where a principal knows the interim distribution of agent types rather than the ex-ante distribution. For example, the principal may have data that is anonymized or may know the types but is not allowed to discriminate. This setting is rarely studied in mechanism design because the optimal mechanisms are usually trivial. However, this setting is frequently studied in the design of contests under functional form assumptions that preclude full-surplus extraction. We model contest design as a general allocation rule without any functional form assumptions. Instead, we impose efficiency, the requirement that the entire prize budget must be allocated in response to any bid profile. This condition holds in all popular models of contests. We find that efficiency and linearity of payoffs are sufficient to prevent full surplus extraction. In the two-player case, the overall optimal contest is one of two popular models: an all-pay auction with bid caps when heterogeneity is low or a difference-form contest when heterogeneity is high.