Fidelity Investments interview question

Code isSquare(). Asked some SQL questions