Interview question on constraints

In reply to sdeepak.v:

I am not sure i understand your questions completely. Based on what I understood, I would just use the array.sum == 3 for the constraint.

module test;
  bit clk_helper[5];
  
  initial begin
    repeat(5) begin
      std::randomize(clk_helper) with {clk_helper.sum() with (int'(item)) == 3  ; } ;
      $display("%p", clk_helper);
    end
    
    
  end
endmodule