We treat the problem of achieving optimal system size for k-out-of-n systems with competing failure modes. Assume that components are independent and identical distributed and subject to two types of failure: failure in open mode and failure in closed mode. The system works if and only if fewer than k components fail in closed mode and fewer than n - k + 1 components fail in open mode. In this paper we determine the optimal system size n which maximizes the system reliability. We also study the effect of the system parameters on the optimal system size n. A numerical example is given to illustrate the results.