An earthquake is caused by the sudden release of energy from two parts of rock masses moving suddenly along a fault. This energy is released in different types of waves that originate from the focus or epicenter of the earthquake. Earthquakes can be classified based on their mode of origin such as volcanic, tectonic, or surface causes, or based on the depth of their focus as shallow, intermediate, or deep. The effects of earthquakes can be devastating, so earthquake resistant structures should be designed through careful study of past records and use of techniques like foundations on hard rock, wider streets, and steel or reinforced concrete frames.