There is a strong demand for accelerating structures able to achieve higher gradients and more compact dimensions for the next generation of linear accelerators for research, industrial and medical applications.Notably innovative technologies will permit compact and affordable advanced accelerators as the linear collider and X-ray freeelectron lasers (XFELs) with accelerating gradients over twice the value achieved with current technologies. In particular XFEL is able to produce coherent X-ray pulses with peak brightness 10 orders of magnitude greater than preceding approaches, which has revolutionized numerous fields through imaging of the nanoscopic world at the time and length scale of atom-based systems, that is of femtosecond and Angstrom. There is a strong interest for combining these two fields, to form a proper tool with the goal of producing a very compact XFEL in order to investigate multi-disciplinary researches in chemistry, biology, materials science, medicine and physics.In the framework of the Ultra -Compact XFEL project (UC-XFEL) under study at the University of California of Los Angeles (UCLA), an ultra high gradient higher harmonic radio-frequency (RF) accelerating structure for the longitudinal space phase linearization is foreseen. To this aim, a Ka-Band linearizer (34.2 GHz) with an integrated voltage of at least 15 MV working on 6th harmonic with respect to the main Linac frequency (5.712 GHz) is required. We here present the electromagnetic design of a cold ultra compact Ka-band standing wave (SW) linearizer, 8 cm long, working on π mode with an ultra high accelerating gradient (beyond 100 MV/m) and minimum surface electric field for minimizing the probability of RF breakdown. Moreover, we discuss a traveling-wave (TW) option and compare it with the initial SW structure, by means of main RF parameters as well as beamdynamics considerations. The numerical electromagnetic studies have been performed by using the well known SuperFish, HFSS and CST computing software.