Depends on your commissioning source. USNA and NROTC require an application, in the case of USNA a recommendation from a Congressman, and usually an interview. Then of course 4 years of college. If you're already a graduate, see your local recruiter and attempt to gain a slot at OCS, a 3 month boot camp for Officers in Newport, RI>
Interview questions [1]
Question 1
It's the military, so it's pretty straightforward. Display a desire to lead and show an aptitude through your academic and work background.