Laser interferometers and grating interferometers based on optical interferometry are widely used in displacement measurement of precision machining and testing equipment, such as the measurement system of integrated circuit equipment, due to their high precision, noncontact, and large dynamic measurement range. The ghost reflection in optical elements may lead to the periodic nonlinear error of the interferometer and also reduce alternating current/direct current. We propose a general method for automatic ghost reflection interface identification. It can analyze the influence weight of ghost reflection for each interface of any interferometer. In addition, the manufacturing cost of the interferometer is effectively reduced by optimization algorithms that enable ghost reflection avoidance in the interferometer design. Experimental results prove the influence weight of ghost reflection at different positions in the interferometer and provide the parameter selection of the most suitable interface reflection of the interferometer.