This story shows an example of Chinese euphemism. There are thousands of Chinese expessions like the title of this story that are made up of four Chinese characters, which are usually originated from stories in the history or classical writings.
宋朝*1的时候，有一个人叫孙山。 他很会说笑话。有一年，他离开家到京城参加考试，结果考上了， 可是发榜*2时， 他的名字在最后。
孙山回到家里以后，很多人来看他。 孙山的一个朋友的儿子也参加了考试，就来问孙山， 他儿子有没有考上。 孙山没有直接回答。 他说： “我的名字在榜上是最后一个， 你儿子的名字落在我的后面。”后来，我们就用“名落孙山” 来形容考试没有通过。
song4chao2 *1 deshi2hou, you3yi2ge4ren2 jiao4 sun1shan1. ta1 hen3hui4 shuo1 xiao4hua. you3yi4nian2, ta1 li2kai1 jia1 dao4 jing1cheng2 can1jia1 kao3shi4, jie1guo3 kao3shang4le, ke3shi4 fa1bang3*2 shi2, ta1de ming2zi4 zai4 zui4hou4.
sun1shan1 hui2dao4 jia1li3 yi3hou4, hen3duo1ren2 lai2 kan4 ta1. sun1shan1de yi1ge4 peng2youde er2zi ye3 can1jia1le kao3shi4, jiu4 lai2 wen4 Sun1Shan1, ta1 er2zi you3mei2you3 kao3shang4. Sun1 Shan1 mei2you3 zhi2jie1 hui2da2. ta1 shuo1: "wo3de ming2zi4 zai4 bang3shang4 shi4 zui4hou4 yi2ge4, ni3 er2zi de ming2zi4 luo4zai4 wo3de hou4mian4." hou4lai2 wo3men jiu4 yong4 “ming2luo4sun1shan1" lai2 xing2rong2 kao3shi4 mei2you3 tong1guo4.
*1-Song Dynasy lasted from 960 AD to 1279 AD.
*2 - fa1bang3 means to publish a list of successful applicants. In the past, the students everywhere in China had to go to the capital city of the county or the country to take exams. If the student did well in the exam, he would be awarded a kind of title (degree like BA, MA). And his name would be on the list, which was put up on the public bullitin board. The names were arranged in the order of scores from the highest to the lowest instead of alphabetically. Therefore, it usually took the student a long time to find out if he was on the list or not.
In Song Dynasty, there once a man called Sun Shan. He was very good at joking. One year, he left home to take part in the exam in the capital city. He turned out to have passed the exam. However, when the list of passed students was published, his name appeared as the last one.
After Sun Shan returned home, many people came to visit him. One of his friends had a son, who also took part in the same exam. So his friend came to ask Sun Shan if his son had passed the exam or not. Sun Shan didn't answer him directly. He said:"My name is the last one on the list. Your son's name fell behind mine."
Later, we use the expression "name falling behind Sun Shan" to describe failing in an exam.