Bitcoin Core maintains the set of unconfirmed transactions it knows about in the mempool. The mempool data structure tracks which UTXOs are consumed and created by those unconfirmed transactions. When a new transaction comes in, it will find outputs either in the UTXO set, or in the pending outputs in the mempool.
Naturally, any transaction that gets included in a block must only spend UTXOs that were created before it is spending them. Thus, any parent transactions must appear in the block before a corresponding child transaction.









