Comcast interview question

How would you do this xyz.