Bitwise Interview Question

Based on java,sql