How do miners know how to remove recently confirmed transactions?
How does a miner proceed in this scenario - dropping the 200 and adding 200 others from the mempool and trying to mine a block?


If the miner is trying to build on top of the block that was received, then he will have to drop the 200 transactions that were included in the other block. He will also not be able to include the other transactions in the next block that were present in the block he received. Apart from this, he is not restricted which valid transaction he can include. He can fill in more valid transactions, remove some or remove all the transactions and just mine the block with coinbase transaction. It's up to his discretion.


  Two blocks are created almost at the same time and they each have some of the same and some different transactions.


Imagine a scenario where two miners find a solution at the same time and both the blocks are valid. As soon as they find the solution, they will relay the block to the full nodes. The nodes will add the block that reaches to them first and add it on top of the existing blockchain. However, when they receive the other block at the same height, they will not discard it but maintain a copy of it. So here you have a blockchain fork, where around half the nodes have a different version of the blockchain at the best height. Other mining nodes will start mining the subsequent block based on the copy of the blockchain that they are seeing (on top of the block that they received first.) Now, one of the miner will find a solution and propagate it to the network. More likely than not, it will not happen to be simultaneous like the previous block. So when that block is propagated, the network converges back to a shared state. Now, as the network converges the full nodes will discard the transactions from the mempool that are already confirmed.