Datadog interview question

Two generic algorithms and data structures questions. Runtime complexity analysis.