In the example, a string is reversed by appending content to the beginning of a StringBuilder. Is not that operation a O(n) operation by itself? Would not it be better to use the reversed method in StringBuilder before the method returns?
I guess another alternative would be to transverse the string in reverse order to begin with so that we introduce the data in the StringBuilder in the right direction and we can save the reverse operation.
Moreover, if we are already using a StringBuilder that has a Stack like API, cannot we just use the StringBuilder as the only data structure?