Reaction between NaOH and Carbonic acid
You're right, both of these reactions take place.

From Wikipedia, the Free Encyclopedia


  In aqueous solution, carbonate, bicarbonate, carbon dioxide, and carbonic acid exist together in a dynamic equilibrium.


Now, the answer to the question depends on context. If you're asked to do this reaction in a mildly acidic/weakly basic medium, then the answer would be the bicarbonate, while in a strongly basic medium, the answer would be the carbonate.

Interesting for further reading:

This $\ce{pH}$ dependent equilibrium between carbonate and bicarbonate is one of the ways in which the blood $\ce{pH}$, and the $\ce{pH}$ of the mouth is maintained. It also helps aquatic life to survive in ocean waters. (Also see urea cycle and carbon cycle)