We study different realizations of the first-order deconfinement phase transition inside a compact star by comparing the Gibbs and Maxwell construction for the mixed phase. The hadronic sector is described within the relativistic mean field model including hyperons. The quark sector is described by the MIT bag model. We find that these two realizations lead to very different star properties, in particular, the composition of the stellar matter. We also find that for the Maxwell construction there is a sharp discontinuity in the baryon density and the electron chemical potential. We argue that a sharp jump in the electron chemical potential should lead to the redistribution of electrons and formation of strong electric fields around the discontinuity surface.