Fortinet interview question

basic C++ concept. Design algorithms for different settings. review the time complexity and space complexity.