Interfaces between cathode particles and electrolyte have significant influence on performance and longevity of Li-ion batteries. Therefore, for further battery improvement deep understanding of cathode-electrolyte interface structure and its relationship with electrochemical processes inside the battery is strongly required. During the last few years, more and more studies are focused on the interfaces and surfaces of cathode particles, especially for layered transition metal oxides (TMO). For example, it was established that TMO surfaces experience reconstruction from layered to spinel and cubic structures, considerably affecting charge transfer through cathode/electrolyte interface and electrolyte and cathode stability [1]. Though initially reconstruction was considered mostly as a detrimental effect, resulting in increased barriers for Li insertion and cathode degradation, new studies show that reconstructed layer can serve as a natural protection from oxygen loss, preventing decomposition of electrolyte and insertion of water in cathode structure [2]. Though it is evident from experimental studies that the reconstructed layer resembles spinel and rock-salt structures, the exact ordering of atoms is controversial. More importantly, the governing factors for reconstruction are still not fully clear: in some cases, reconstruction occurs during synthesis and in others it proceeds under exposure to electrolyte and/or during cycling. Finally, surface reconstruction remains almost unexplored in promising Na-based TMO cathodes, where its role can be highly important, serving as a protective layer from water insertion [2]. In this work, we develop an algorithm for finding reconstructed structures of surface for transition metal oxides. The algorithm is based on the Monte-Carlo method used for a random swap of alkali atoms, transition atoms, and vacancies, while the density functional theory is used for atomic optimization after each Monte-Carlo step and accurate calculation of energies. The Metropolis method allows to take into account the influence of temperature and predict kinetically controlled surface structures. The algorithm is implemented in our SIMAN package for high-throughput materials modelling and available for free use [3]. Employing the developed algorithm, we consider several oxide compounds, such as LiNiO2, NaNiO2 and NaMnO2 used for pragmatic applications for rechargeable Li-ion and Na-ion batteries. We found that in LiNiO2 and NaNiO2 the formation of surface and subsurface anti-site defects is much easier than that in the bulk region. By making simulation at real synthesis temperatures, we observed kinetically controlled formation of spinel layers for both LiNiO2 and NaNiO2. Under oxidative conditions the transformation of the LiNiO2 surface to a rock-salt structure is thermodynamically favorable. The obtained results explain experimentally observed surface reconstruction to spinel and rock-salt structures in layered oxides. The undergoing study will identify the reasons that control the type of reconstruction depending on the chemical composition and synthesis conditions, providing useful guidelines for improving cathode materials.