Google Interview Question

Read a line of data and encode method, determine the end element is belong to which type.