HexArmor interview question

ruby and javascript DSA question,