Databricks interview question

Building a LazyArray (OOP). Need to support two methods.