Knee cap is called Ptella in medical parlance and it the largest cuneiform bone in the body.
is fairly commonly fractured and dislocated.
Fracture mostly occurs when direct impact of something occurs on the front of knee at kneecap but it can also fracture if a young and muscular person makes a sudden postural move or runs a long sprint.
Another possilbility is rather more common to have a patellar dislocation, it almost always occurs on lateral side and is particularly common when you have an anatomical variation of knee called genu valgum.
Both the condtions can be diagnosed just through a simple x-ray of Knee-AP and Lateral and review by any orthpedician/Physician/Surgeon.