Since a certain some1 a bit blur ask me to write this crap. then here i go... Engines are the mechanical collection of parts that forms a moving piece of metal that shapes our world. It helps in transporting people, goods or basically anything around. So now, lets get to the interesting part and start the crapping... Wooohoo...
Okay... There are basically so many types of engines... that its almost impossible to explain all. This is because i will get bored of it and will start doing something else. Basically there are roughly 2 types of engines, the first is piston driven engines while the other is rotor driven. Piston engines are very common while Rotary engines are not usually used in the automotive industry. Example of piston engines are everywhere but for rotary engine, only 1 car manufacturer actually used it in their cars, Mazda with their famous Rx-7 and Rx-8. Rotary engines have less moving parts compared to conventional engines thus making it light. It also has more power per cc compared to conventional engines. A 1.3 liter rotary can produce power equivalent to a 2.2 liter conventional engine giving it high power-to-weight ratio. But the difficulty of sourcing parts and the skilled personels to service this engines make it almost no favourable.
For our piston driven, conventional engines, we have lots of variety. Based on cylinder arrangement, we can actually classify them to 3 categories. there's the Inline engine, Vee engine and the Boxer or Flat engine. Inline engines are like those found in most 4 cylinder engine cars like the Toyota Vios. The boxer or flat engines have their cylinders arranged horizontally opposing to each other. The best example for this can be seen in almost all Porsche cars and the Subaru Impreza STi . Meanwhile, Vee engine are like those in the Perdana V6 which the cylinders are arranged in a V shaped manner. The Vee are a compromise between the Boxer and the Inline engine. The arrangements for the cylinders makes almost no difference in power. The only thing that makes the difference is the way to mount them. A Boxer could be mounted lower compared to the inline and vee engines thus making the car having a lower center of gravity.
FLAT or BOXER engine

Vee engine
Inline engine
In the engines, there are basically 2 types of valvetrains that are common. The Single Over Head Cam(SOHC) and the Double Over Head Cam(DOHC).
SOHC VS DOHC
DOHC
SOHC
The difference in this 2 are the amount of camshafts that are present in the engine. A SOHC engine has a single camshaft that controls both the intake and exhaust valve. Meanwhile, the DOHC has separate camshafts for the intake and exhaust valves. The pros of a DOHC engine compared to a SOHC is the ability to place the spark plug in the middle of the engine compared to the SOHC. This gives the DOHC a better combustion compared to the SOHC. Besides this, the SOHC has a better power and torque at lower rpms compared to the DOHC while the DOHC has better power and torque at higher rpms. So we can say a DOHC has a better top speed compared to a SOHC. But fuel economy wise, a SOHC might be better as lesser parts makes it relatively lighter than the DOHC. Another thing to consider is the amount of valves that could be placed in an engine. A SOHC can have a maximum of 4 valves per cylinder while a DOHC could have more. You might ask, why more valves? Does it make any difference? The answer is yes. More valves translates to higher power since more fuel-air mixture could get in and more exhaust going out at the same time. Then a question, why dont they make bigger valves instead of more smaller ones. Well, bigger valves are slower compared to more smaller valves of the same weight. Another point, a DOHC makes it easier to implement valve timing and lift duration technology as there are 2 camshaft to tune with. This is easier because the tuning of the exhaust valves and intake valves are separate. Meanwhile its more complicated to implement this technology to a SOHC. A good example of DOHC with valve timing tech is the engine of the Toyota Vios, the 1NZ-FE and the best example for a SOHC with the same tech is the Honda City with the L15A engine.
HONDA
TOYOTA