Beast Code interview question

Explain how variable scoping works.