 Rei studied in the Tartu Emperor Alexander High School (the former State High School of the Livonian Governorate), but graduated from the Novgorod State High School.In 1904–1905 and 1907–1911, studied law in the St. Petersburg University.In 1905–1907, Rei participated in the Russian revolution of 1905.