Zendesk interview question

Write a string compression method and use TDD.