LLD - Design — Parking Lot System
Consider this pseudocode for two threads incrementing a shared counter without locks:
Thread 1: temp = counter
temp = temp + 1
counter = temp
Thread 2: temp = counter
temp = temp + 1
counter = temp
What is the possible final value of counter if it starts at 0?