BetterCloud Interview Question

pyramid algorithm and justify. Java technical qus