The harmonic balance method (HBM) is a promising alternative for simulating time-periodic unsteady flows; however, its performance in strong nonlinear problems has not been fully investigated. In this paper, we focus on the unsteady flow with oscillating shocks through which several unique aspects regarding the accuracy and efficiency of the HBM are addressed. First, different from most existing studies, influences of the number of harmonics and the number of time samples on the solution are separately analyzed. It is found that the mode factor plays a role in accurately describing the unsteady physics, while the sampling factor is associated with the numerical oscillations in shock oscillation regions. Second, based on the recently developed Jacobian-free Newton–Krylov method with a simplified preconditioner and comparison with other methods, the efficiency of the present HBM and its relationship with the two factors are studied. The computational cost is found to increase almost linearly with the increase of the number of harmonics, but nonlinearly with the number of time samples. Finally, noticing the fact that fewer harmonics (time samples) can ensure accurate solutions in smooth regions, while many more are required in shock oscillation regions, a non-uniform HBM is developed by adopting various numbers of harmonics (time samples) throughout the whole flow domain. The superiority of this method compared with the traditional uniform HBM is demonstrated, showing a good application prospect in large-scale unsteady flows with strong nonlinearities.