Modelling of non-adiabatic dynamics in extended molecular systems and solids is a next frontier of atomistic electronic structure theory. The underlying numerical algorithms should operate only with a few quantities (that can be efficiently obtained from quantum chemistry), provide a controlled approximation (which can be systematically improved) and capture important phenomena such as branching (multiple products), detailed balance and evolution of electronic coherences. Here we propose a new algorithm based on Monte-Carlo sampling of classical trajectories, which satisfies the above requirements and provides a general framework for existing surface hopping methods for non-adiabatic dynamics simulations. In particular, our algorithm can be viewed as a post-processing technique for analysing numerical results obtained from the conventional surface hopping approaches. Presented numerical tests for several model problems demonstrate efficiency and accuracy of the new method.