Dassault Systèmes interview question

1. Sum of digits program 2. Substring program