Skip to main content

Posts

Showing posts from 2019

Nuclear Fission Online Test Program

In one of the online java programming test, I have been asked this question to solve. I tried my best and come up with the solution below. This can be improve a lot to work much better with large data set. Please do let me know if found useful or it can be improve in certain way to write a very very efficient code: Question: Nuclear fission is a process in which a large nucleus splits into two smaller nuclei with the release of energy. The process involves releasing of three neutrons from each split and which further splits more atoms until the fuel gets finished. Now let us consider a very efficient nuclear fission reaction. You have n number of atoms. The reaction starts with one external neutron. The neutron hits the first atom and causes three neutrons to split. These hit the other large nuclei and so on. Find the total number of neutrons generated at the end of the reaction. Examples Let the number of atoms in the fuel be 7. Look at the diagram below: We see ...