E[X] = sum of (outcome times its probability), or the integral of x f(x) for continuous variables.
The property that does most of the work in interviews is linearity: E[X + Y] = E[X] + E[Y] holds whether or not X and Y are independent. That lets you decompose a hard count into a sum of simple probabilities.
The trap. Expected value is not the most likely outcome, and often is not even attainable - the expected roll of a die is 3.5. It also says nothing about risk: a coin flip for a million and a guaranteed zero have the same EV as a bet that costs nothing, but they are not the same decision. See position sizing.