Imagine an implementation for a simple linked list. There is a head pointer that is set to null during an init method, and each node has a value and a next pointer. To insert a new node at the start, we have to make a new node, make it point to the current head, then set the current head to the new node. To search for a value we use a curr variable to point to the current node starting from head, return if the node is null, else check if the value matches, then move to next node.
If two threads try to insert at the same time, and a they both make their node point to the old head, one new node will be lost.
Atomicity Violation
If a search happens before the init method has had a chance to run, the head pointer may point to a random place in memory and problems arise.
Order violation
Two threads both try to ensure a specific element is in the list. They both search for it and if not found then insert it. If not careful, they might both end up inserting the element.