The goal of this paper is to investigate the stability of the Helmholtz equation in the high-frequency regime with non-smooth and rapidly oscillating coefficients on bounded domains. Existence and uniqueness of the problem can be proved using the unique continuation principle in Fredholm’s alternative. However, this approach does not give directly a coefficient-explicit energy estimate. We present a new theoretical approach for the one-dimensional problem and find that for a new class of coefficients, including coefficients with an arbitrary number of discontinuities, the stability constant (i.e. the norm of the solution operator) is bounded by a term independent of the number of jumps. We emphasize that no periodicity of the coefficients is required. By selecting the wave speed function in a certain “resonant” way, we construct a class of oscillatory configurations, such that the stability constant grows exponentially in the frequency. This shows that our estimates are sharp.