JEJ Solutions interview question

Very hard tech question that was hard