Databricks Interview Question

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