Comcast Interview Question

How would you do this xyz.