Yugabyte interview question

to Solve the coding question they gave