Dematic interview question

Technical interview consisted of two array problems.