Cognizant interview question

They asked me to find pressures inside different balls using coding

Interview Answer

Anonymous

23 Feb 2021

I answered the question by resorting to inheritance methods, wherein I can make a main class with the dimensions and inherited classes that require us to use a specific formula to find the pressure according to the shape of the ball