Yahoo interview question

how to serialize and object?