© 2015 American Mathematical Society. We analyze a model optimal control problem for a 2D scalar conservation law-the so-called inverse design problem-with the goal being to identify the initial datum leading to a given final time configuration. The presence of shocks is an impediment for classical methods, based on linearization, to be directly applied. We develop an alternating descent method that exploits the generalized linearization that takes into account both the sensitivity of the shock location and of the smooth components of solutions. A numerical implementation is proposed using splitting and finite differences. The descent method we propose is of alternating nature and combines variations taking account of the shock location and those that take care of the smooth components of the solution. The efficiency of the method is illustrated by numerical experiments.