We consider two companies that are competing for orders. Let X1(n) denote the number of orders processed by the first company at time n, and let τ(k) be the first time that X1(n)<j or X1(n)=r, given that X1(0)=k. We assume that {X1(n),n=0,1,…} is a controlled discrete-time queueing system. Each company is using some control to increase its share of orders. The aim of the first company is to maximize the expected value of τ(k), while its competitor tries to minimize this expected value. The optimal solution is obtained by making use of dynamic programming. Particular problems are solved explicitly.