か〜ないかのうちに details
Examples
no sooner does one X than — the second event overlaps the first so closely that the first may not even be finished
ベルが鳴るか鳴らないかのうちに、生徒たちは教室を飛び出した。
beru ga naru ka naranai ka no uchi ni, seitotachi wa kyoushitsu o tobidashita.
Almost before the bell had finished ringing, the students had already dashed out of the classroom. neutral
ドアが開くか開かないかのうちに、猫が飛び出してきた。
doa ga aku ka akanai ka no uchi ni, neko ga tobidashite kita.
The cat shot out almost before the door had even opened. neutral
目が覚めるか覚めないかのうちに、電話が鳴り出した。
me ga sameru ka samenai ka no uchi ni, denwa ga naridashita.
The phone started ringing almost before I was even properly awake. neutral
Formation
Vるか〜Vないかのうちにattaches to noun phrase (schematic)
Notes
never two different verbs. The first slot also occurs in た form
(駅に着いたか着かないかのうちに), alongside the plain dict-form pairing shown here.
Related patterns
Similar
たとたんに requires the first event to have fully COMPLETED (た form) before the second follows; か〜ないかのうちに blurs that boundary — the second event starts so early it is unclear whether the first has even finished, which is why the frame repeats the same verb once affirmative and once negative.