That happened to me recently. Everyone seemed great during the interview process, but the company was a disaster.

Once I got in the door I found out all the code was originally produced from outsourcing in Russia. So it had no comments and it had layer after layer after layer of unneeded abstraction. So figuring out the behavior on an error in the BLE back end communicating with a fitness tracker required tracing through half a dozen unneeded classes like screen config beans, screen states, the fragment state generators, to to error codes, to error messages, to fragment subclasses, to flow subclasses, to activity subclasses. All with if/else's for special conditions jammed everywhere even in things that should be mindless DTOs and many parts never actually used and deep inheritance hierarchies. It could all have been easily done with 40 classes instead of 120, with much simpler, more reliable code.

Lesson: ask the company about outsourcing history and plans.

Software engineering has known for a long time that abstraction over composition really hurts maintainability and reliability, but clearly this company never heard of that. Normally this sort of thing is fixable, but the couple staff developers they had brought in tended to just write whatever they thought would work, shove it into the app, then call it a day, not even smoke testing, let alone writing unit tests. Developers frequently pushed code that didn't even work in real testing on a device then left for vacation for a week leaving others to deal with their mess. If you sent them an email with logs or even fix commits, they'd call a meeting with management to try to discredit you and block the fixes rather than working to fix the problems. And their stuff simply didn't work on the devices, so there was no possible end goal to their politics that would leave the app functional. It made no sense.

Even ignoring things that could be considered "style" they didn't have much technical ability either. They thought changes to variables would be visible on all threads as long as they used an Android Handler class on a background Looper, but that's only true if both threads where it is read block on the underlying event queue, which wasn't happening in their code. But they fought the synchronization blocks that would make the value changes visible to their UI logic despite logs proving their code was blowing by changed values without seeing them.

Lesson: their developers will give you a technical interview, but be sure to ask your own questions and determine their level as well.

OK, outsourcing, we can clean it up. Clueless junior developers, we can train them and pair code with them and clean up up their messes. But management was completely screwed up as well which kind of prevented any fixes. My manager left at 4PM every day to go ride his bicycle and never came back. Meanwhile, I took a 45 minute bicycle ride midday and worked until 8PM to finish a project for the company during a month we were encouraged to exercise and be healthy - he fought to get me in trouble for "long lunches".

Similarly, my wife drove two hours once to get me in without standing an hour on the BART, so my back wouldn't hurt. She did everything properly, got a guest badge, stayed out of restricted areas where we were working on unreleased products, and got kicked out by the manager for talking quietly at my desk with me and a coworker. He was panting heavily and claimed she was too distracting for him to work. She left and never came back to the company ever again, but he went right back to harassing me about her week after week, talking about her and making up new rules despite the fact that she never came back. Meanwhile he had reserved an entire conference room for his friend's family to visit the entire day.

Lesson: not sure how to avoid this one.

The manager said all the right things during the interview, that management is supposed to help employees get things done and get along with their team, but he spent what little time he was on site harassing people. I guess because the company had just IPO'ed the management was basically rich from their options and didn't give a damn about actually working. I put in a transfer request with HR who immediately fired me instead of looking into it. They claimed all their managers were the same, which was a lie, since I walked around and asked. So no clue of the right lesson for that one. Sometimes you just end up with a bad company despite doing everything right.