MathWorks interview question

Constructor and destructor code snippets