Samsung Electronics interview question

Explain how SLAM algorithm works