public static void main(String args[]){
        SquareOfNumber sn = new SquareOfNumber();
        System.out.println(sn.square(9) + " " + sn.fastSquare(9));
        System.out.println(sn.square(27) + " " + sn.fastSquare(27));
        System.out.println(sn.square(18) + " " + sn.fastSquare(18));
        System.out.println(sn.square(199) + " " + sn.fastSquare(199));
    }
Start with 9,9. Then take 1 and keep left shifting 1 till you find number
less than 9 but power of 2. Then shift 9 by that many powers and repeat
the process with whatever is left between that number and 9.
src/com/interview/bits/SquareOfNumber.java