A comprehensive numerical study is performed to investigate rarefied hypersonic flows past various non-rectangular cavity configurations using the direct simulation Monte Carlo method with the effects of free-stream Mach numbers, high-temperature gas effects, and three-dimensional (3D) effects analyzed in depth. In this work, two groups of non-rectangular cavities are considered: one is the shallow-front type and the other is the shallow-rear type. The primary objective is to obtain insight into the flow characteristics and surface pressure on and heat flux to these non-rectangular cavities. Making the front or rear of the cavity shallower does not alter the flow characteristics inside the upper cavity too much, but it causes the vortex to not fill the entire cavity any longer. Instead, a “dead-water” region is formed in the bottom cavity, and this “dead-water” region becomes expanded as the front or rear of the cavity gets shallower. In addition, making the front or rear of the cavity shallower has little influence on surface pressure on and heat flux to the aft wall of the cavity, while it plays an important role in the distributions of surface pressure and heat transfer coefficients over the cavity floor. For the case of shallower-rear cavity, the surface pressure and heat flux at the right end of the cavity floor are as high as 2 and 20 times the rectangular-cavity value, respectively. Free-stream Mach number and high-temperature gas effects have a negligibly minor influence on flow characteristics inside the cavity, while 3D effects play an important role. In comparison with 2D cavities, 3D relieving effects in finite-span cavities prevent the external stream from penetrating deeper into cavities, leading to much smaller surface pressures on and heat fluxes to the cavity floors.