Ruby Typescript Interview Question