What was Stack Overflow built with?
What Content Management System is Stack Overflow based on, if any?
It's its own 'CMS'; though it's a CMS very much customized towards 'Q&A' and Forum type sites.
Stack Exchange is based on the Stack Overflow codebase -- and not the other way around.
See this blog post for what Stack Overflow was built with.