Bloomberg interview question

HackerRank easy array question, followed by a more "design" question that we ultimately coded up.