A good defensive layout is one half of the things needed for success in Versus Battles. Without a good layout, your base will be easily torn apart, and winning Versus Battles will become difficult, no matter how good your attacking skills and army are.
Building a Builder Base layout is vastly different from building a Home Village layout. Usually your layouts will be built for the sole purpose of defending well so that Versus Battles can be won.
If battling against opponents of the same Builder Hall level, you should expect that a competent attacker (with a competent army) will be able to score at least 2 stars consistently. As such, you can build a layout that can limit opponents to low 2-stars (i.e. 2 stars with just over 50%), or you can choose to build layouts that exploit the AI of Builder Base units. The former is often much harder to do especially if you rush the Builder Hall and thus leave the defenses underleveled for your BH level (which can be more often the case), so oftentimes the latter is the best approach to building a layout.
One similarity arises; it is best to build layouts that work against the typical attack strategies found at a particular trophy level. So for example if you're facing lots of Night Witch attacks at your trophy level it is best to build a layout that can counter Night Witches well, such as one that protects the Roaster and/or Multi Mortar well.
There are many guidelines to building a Builder Base that can withstand brutal attacks. Here are some tips to building a base layout:
Similarly, non-defensive buildings should often be left outside walls, but high hitpoint buildings like the Gold Storages can nonetheless be placed tactically at locations where troops are often grouped up in order to stall them.
Note that if a building's edge is three tiles away from a wall (for example, this occurs when a 3x3 building is adjacent to a wall), Bombers will be able to hit both the building and the wall behind it.
You should try to make sure as many buildings are covered as possible. Undefended buildings can be easily picked off by the attacker for free percentage, which might be enough for them to win the battle.
Archer Towers can be set to fast attack mode to ward off hordes of attacking units, but their short range means they can't defend buildings in front of them from Sneaky Archers or Beta Minions in that case. Setting one to long range mode to cover a corner can be helpful to pick them off, but their low damage output allows them to be overwhelmed easily.
Hidden Teslas generally do not contribute much to a defense, but their fast firing can stave off Bats and Skeletons, and their element of surprise can be unexpected to some troops like the Boxer Giant or Hog Glider, both of which might end up using their ability on it rather than on another defense.
At lower levels, remember that keeping a Cannon on one side of the Builder Hall can prevent it from being sniped by a Sneaky Archer on the other side.
Crushers' devastating damage can be put to good use by forcing troops to face it. Ranged troops will often stay clear of it, but melee units can be funneled into one by good use of walls.
At lower levels, they can be used as a deterrent to deter ground attacks from the side it covers. At higher levels however, attackers will often have the tools necessary to tackle a Crusher (such as Cannon Carts and sufficient numbers of Raged Barbarians).
The Guard Post troops can draw the attention of troops that don't target defenses, which can easily derail an attack by forcing them to group when and where the attacker doesn't want them to group. You can consider placing them in the center to cause trouble no matter where the attacker comes from, or on one side of the base so that attackers from that side do not have their units distracted when they get to your Builder Hall. However, if the troops are exposed they can be easily picked off by smaller troops such as Raged Barbarians, Sneaky Archers or Beta Minions.
Air Bombs are an excellent tool in defending air attacks. Be sure they are well defended - don't let them be picked off by a few Beta Minions or the Battle Machine before allowing an air attack. You can choose to place it next to the Builder Hall to defend it from attacking Minions.
Placing the Air Bombs next to the Builder Hall on a side with few buildings can present air attackers with a dilemma: either attack on the side with the Air Bombs to easily get the Builder Hall but risk getting a low percentage (due to being attacked by the Air Bombs), or attack opposite the Air Bombs to get a higher percentage but risk getting only one star. However, if your defenses are too weak attackers can often succeed in destroying many buildings and destroying the Builder Hall.
The Multi Mortar is a very versatile defense that should not be neglected or left poorly defended. It can take care of low-health troops easily, and also do sizable damage to support units like Cannon Carts and Night Witches. However, it does poorly when occupied by a high-health unit like a Boxer Giant. Have other high-damage defenses like the Double Cannon or Mega Tesla to protect it.
The Giant Cannon can prove to be more deadly than most players think. Meat shields like the aforementioned Boxer Giants cannot protect other units completely from it. As such, it can be surprisingly effective against Night Witches and Raged Barbarians. It is also a good tool at wiping out enemy Skeletons and so can be valuable in defending a Drop Ship attack.
The Mega Tesla is most efficient when zapping high-health units; zapping two Bats or Skeletons at a time certainly won't do your defense good. You can help the Mega Tesla use its full potential by protecting it with the Roaster and other splash defenses to wipe out smaller units.
The Lava Launcher, if you have one, is a very valuable defense against ground attacks. The lava works very well against ranged units, and can easily eliminate Bombers, Cannon Carts and Night Witches if they linger long enough in one. Use the assistance of walls to ensure they stay in the lava for as long as possible.
Walls can make attacking with ground units especially difficult if the attacker does not use Bombers. This is especially the case if the Walls are placed in a way to make units funnel around them.
Don't forget to set your Mines and Mega Mines to the appropriate mode depending on what you typically defend against. For example, a typical Night Witch defense would have Mines set to air (to kill Bats) while the Mega Mines are set to ground (to kill Night Witches).
Well-placed Push Traps move the attacking force into a location that does not play in the attacker's favor. For example, you can set a Push Trap inside your walls to force troops outside the walls, or set a Push Trap to displace troops on top of a Crusher.
There are many ways to exploit the AI of Builder Base units, especially that of ground units (and the Battle Machine, in particular):
You can use techniques of funneling that work in the Home Village, such as Spring Traps in gaps.
Wall placement contributes very highly to how melee ground units such as Raged Barbarians and Boxer Giants behave. If there are buildings behind a wall and a gap in the wall several tiles away, these troops will target the buildings behind the wall - but they will travel through these gaps to get to the targeted building - often ignoring any buildings they may pass through in their path. This fact can be put to good use by placing Crushers to cover these gaps and crush the units as they pass by, or placing high-damage defenses in the path they travel.
Such wall formations can be easily broken by Bombers. Consider placing buildings or extra wall layers to prevent Bombers from reaching and breaking the formations.
You can mask such a gap in the walls using tall buildings such as the Clock Tower, if you intend to have a gap in the corner.
Guard Post troops often disrupt attack formations and force them to clump up, which can be for the benefit of splash damage defenses.
Here is where you can find a variety of layouts which your fellow clashers decided to share, have fun picking!