〜か〜ないかのうちに: just as, barely before is a JLPT N2 grammar point. The second event happens practically simultaneously, before the first has even finished. Structure: [V-dict / V-た] + か + [same V-ない] + かのうちに. This page explains the construction, gives Japanese examples with furigana readings, and links to related grammar points at this level.
〜か〜ないかのうちに: just as, barely before
Structure
[V-dict / V-た] + か + [same V-ない] + かのうちに
Explanation
Repeat the same verb in affirmative and negative around か〜かのうちに to show razor-thin timing: ベルが なる か ならない かのうちに、せいとたちは たちあがった “barely had the bell rung when the students stood up”.
Examples
かれは ベッドに 横に なった か ならない かのうちに、ねむって しまった。
He had barely lain down on the bed when he fell fast asleep.
ドアが あく か あかない かのうちに、いぬが とびだして きた。
Before the door had even fully opened, the dog came bounding out.
