In the Dragon Ball: Bouken Special, the Dragon Ball manga author, Akira Toriyama, explains that there are seven Dragon Balls because there are eight balls in Hakken-Den, a famous Edo-era Japanese novel, and that he would have hated for them to be exactly the same number, so he had the Dragon Balls be seven.
Unlike other forms of fiction that involve wishes being granted, the Dragon Balls seem to grant a wish exactly as the wisher imagined it, rather than warping the wish so that it is technically granted, but ends up making the wisher's life even more difficult. For example, when King Piccolo wished for youth, he was not reduced to an infant, but rather, appeared in his prime. Also, when a victim is revived from the dead, they are not undead, but rather, are truly alive. This is likely so that there is a legitimate reason to pursue the Dragon Balls by the protagonists, as they would not have a justification to rely on them if they knew they would never grant a proper wish. Also, unlike wishes in other literary works, Shenron is actually a sentient being; he may be capable of interpreting a wish however he sees fit, but chooses to interpret them how he knows the wisher actually wants, as a courtesy rather than as a rule. Credence is lent to this theory in the movie Dragon Ball Z: Fusion Reborn, where Shenron was asked to move all the dead people back to the Other World. He claimed that he was perfectly capable of granting the wish precisely as it was uttered, but he knew what consequences the Z Fighters were expecting (that the onslaught of undead would be resolved and peace would be restored), and warned them of the futility of the wish.
The only time a wish was not granted exactly as the wisher imagined it was during the Frieza Saga, when Piccolo was wished to Planet Namek, but not to the Z-Fighter's specific location. However, this is still consistent with the theory that the eternal dragon can interpret wishes; Porunga is much more cynical than Shenron, and so it makes sense that he would twist a wisher's words out of sheer spite.