What job did Barack Obama have before he became president of the us?

His previous job was as a U.S. Senator from Illinois. Before that, he was an Illinois State Senator.