Any oscillations about an equilibrium where its restoring force is proportional to its displacement will be simple harmonic
This doesn’t apply just to pendulums and mass on springs
An example of another harmonic oscillator is the oscillation of a liquid in a U-tube
A U-tube is a type of simple harmonic oscillator with a displacement x from the equilibrium position and length of liquid column L
The time period for these oscillations are found from the same equation as the time period of a simple pendulum, where l is known the length of the liquid column
An exam question will likely state whether a particular oscillation should be treated as simple harmonic. Some other examples include: