Google interview question

Design a encoder and decoder