GameNagri Studios interview question

How are raycasts done; What is layermasking.