How do I find edge cases in DSA problems?
Are there some common edge cases that everybody knows about?
Is there some sort of method or procedure to find those edge cases?
Make things weird and try to break stuff.
This really doesn't have to be taught - It's more about bringing out your inner survival instinct. Humans have evolved over millions of years to be careful:
Tap into that worry and apply it to your code. Leverage your fear to conquer your fear. This is where I've seen mediocre engineers fail time and time again. They are afraid to face their fear of their code being bad. They only think about the happy flow. They only run the happy flow. That works in the beginning, but the second anybody tries something weird against their code, the happiness is smashed to pieces.
When you get a DSA problem or any problem really (it doesn't have to be FAANG or DSA), take the happy flow and mangle it as much as possible. In DSA, the interviewer will generally give you sample, neatly packaged test cases to illustrate the problem - Use those as a basis to turn everything on its head.
The edge cases will vary for different problems (these companies are trying to gauge your on-the-spot creativity), so you naturally can't study your way out of this. But to help you out, here's some common edge cases:
Check these out for more inspiration:
For an extremely in-depth guide on how to become a better coder in general (not just DSA), check this out: "How to Learn/Practice Clean Code, particularly by oneself?"
I'd also embed this into your interview practice. Edbert talks about "Not Fixing Your Own Mistakes" in his talk about common mistakes among interviewees.
Alex's list of common edge cases is great: start there and add other edge cases as you find them!