Frage im Vorstellungsgespräch bei Microsoft

Three Design questions. Two string manipulations problems.