X interview question

How to write maintainable and testable code