McKinsey & Company Interview Question

First round was an online coding round set on hackerrank, where they asked mainly implementation based questions, like filtering out URLs from a given HTML page, given a set of strings finding out which strings represent IPv4 and IPv6 addresses, etc. Second round was a design round, in which we had to implement a stack which also supports a inc(x,d) operation, in which you increment the bottom x elements of the stack by d. Third round was personal interview round. They started off by grilling me with my CV for about 30-35 minutes. Then they came onto an OOPs design question, in which the scenario is that you have to design classes for a mars rover, where you have a robot, and the purpose is to make it move around in a rectangular world. After this, they asked me to implement the Dutch National Flag algorithm.