Using newly developed 3 dimensional Rock Failure Process Analysis code RFPA3D, numerical simulations on samples of rock-like material containing pre-existing surface closed flaws under uniaxial compressive loading are conducted to investigate the failure mechanism and crack coalescence modes. Friction in closed flaws is modeled by inserting ideal elasto-plastic materials into the flaws. The simulations replicate most of the phenomena observed in actual experiments, such as initiation and growth of wing and secondary cracks, crack coalescence, and the macro-failure of the sample. For the samples containing three pre-existing surface closed flaws, four different patterns of crack coalescence are obtained in our simulations. The four different patterns of coalescence are the combination of T mode, S mode, TS mode and C mode, i.e. type (C+S mode), (T+S mode), (S mode) and (C+S mode). A total of four types of samples containing three surface parallel inclined frictional flaws are numerically simulated.