Goldman Sachs interview question

How will you optimize the N queens problem