In SrTiO
3-based oxide heterostructures, the mobility of the two-dimensional electron gas (2DEG) at the interface is relatively low at room temperature due to the influence of Ti 3d orbitals, which limits their applications in semiconductor devices. In contrast, the conduction band bottom of SnO
2 is composed of Sn 5s orbitals, and it has been demonstrated that bulk SnO
2 exhibits high carrier mobility at room temperature. Therefore, SnO
2-based heterostructure interfaces have the potential to form 2DEG with high mobility at room temperature. In this paper, we construct a heterostructure (HfO
2)
7/(SnO
2)
13 with 2 \times 1 supercell in (001) plane and systematically investigate the electronic structure of the heterostructure by using first-principles calculations. The calculation results show that the defect-free (HfO
2)
7/(SnO
2)
13 heterostructure has a band structure similar to that of a semiconductor, and there is no 2DEG near the interface of the heterostructure. However, the conduction band bottom is mainly contributed by non-degenerate Sn 5s orbitals in this situation. In the in-plane 2 \times 1 supercell of the (HfO
2)
7/(SnO
2)
13 heterostructure, each layer contains 8 oxygen atoms (the thickness of 1 unit cell is defined as a layer). When an oxygen atom in a layer on the SnO
2 side near the interface of the heterostructure is removed, the presence of the oxygen vacancy leads to the formation of a defect band below the conduction band. This will lead to hopping conductivity in the heterostructure. However, 2DEG still does not appear near the heterostructure interface. When the oxygen vacancy is located in the surface layer of the HfO
2 in the supercell structure, the presence of the oxygen vacancy leads to the formation of a defect state in the surface. The electrons in the defect state are localized and do not contribute to conductivity. However, the defect band overlaps with the conduction band at the interface, causing the electrons on the surface of HfO
2 to tunnel towards the interface. In this scenario, the 2DEG emerges in the vicinity of the heterostructure interface. In addition, for HfO
2/SnO
2 heterostructures with thinner HfO
2 layers, such as HfO
2 layer with a thickness of 7 unit cells (about 2.37 nm), the H atoms adsorbed on the HfO
2 surface provide electrons for the heterostructure. Some of these electrons transfer to the conduction band near the interface, leading to the formation of a 2DEG in that region. Meanwhile, the remaining electrons stay on the surface, forming a conductive layer with a thickness of approximately 2 unit cells. As the thickness of the HfO
2 layer increases, the probability of electrons transferring from the surface to the interface gradually decreases, resulting in a gradual decrease in the electron density at the interface.