Extend and optimize an existing CLI tool | Oracle Interview Question