Google Interview Question

Write a function that checks for valid unicode byte sequence. A unicode sequence is encoded as: - first byte contains number of subsequent bytes '1111000' means 4 subsequent data bytes - data bytes start with a '10xxxxxx'