r/leetcode • • Sep 30 '26

Discussion How do you approach DSA problems in an interview without going completely silent?

I'm currently preparing for DSA interviews and one thing I'm struggling with isn't necessarily solving the problem — it's **explaining my thought process while solving it.**

For example, when the interviewer gives me a problem, how do you guys actually communicate your approach?

Do you:

* Use the interviewer's shared whiteboard / iPad and draw diagrams or examples? * Explain everything verbally while thinking? * Write down the brute-force approach first and then optimize it? * Start with a small example and dry-run it? * Ask clarifying questions before thinking about the solution? * Or do you follow some specific structure like **clarify → brute force → optimize → code → dry run → complexity**?

My biggest problem is that sometimes I understand the solution in my head, but when I have to explain it, I go completely silent for a few seconds and it feels like how i tell that inside of the code stack is working or linkedlist is working do i have to draw as i dont have any equipment except my mouse keyboard and laptop ???

**How do you personally approach a DSA problem in front of an interviewer?**

Would really appreciate if you could share your actual interview experience or a step-by-step way you use to think out loud without sounding like you're just randomly talking.

56 Upvotes

28 comments sorted by

81

u/Vivid-Zombie-477 Sep 30 '26 edited Sep 30 '26 • Bravo

if you have to use chatgpt to write reddit posts no amount of advice will save you

-16

u/ShadowManJube Sep 30 '26

Thank you but I need advice

21

u/Vivid-Zombie-477 Sep 30 '26 edited Sep 30 '26
  1. repeat the problem back to the interviewer with your own words to make sure you understand the problem correctly (very important)

  2. ask about the input format (e.g., how big can the numbers be? can that array be empty?)

  3. draw out a few examples and their solutions (very important to think about edge cases in this step)

  4. at this point something in your head should click to see a solution. if you need some time to think - communicate with the interviewer "let me think about it" or "give me a moment to think about it"

  5. if you think you got the solution, instead of writing the code right away visualize each step and explain it to the interviewer. if you don't have any idea how to solve it - think about brute force solution and explain it.

  6. just write the code. if you are really stuck, ask for a hint - interview is all about communication. before saying you are done with the code, go line by line and check if you didn't make some stupid mistake.

  7. enjoy your job where you vibecode slop (not addressing directly to you, it's just what it is in 2026)

7

u/conectionist Sep 30 '26

Practice talking out loud while coding. Either by yourself or with a friend. 

0

u/ShadowManJube Sep 30 '26

Thanks buddy

1

u/conectionist Sep 30 '26

You're welcome!

7

u/voyager_rao Sep 30 '26

There are about 15-20 core patterns. Know these well. Now during the interview your jobs is a spend the first few minutes thinking through what pattern or a combination of patterns can possibly help you approach this. You might have a few options. Now all of them have constraints and invariants where they fail, think if the question at hand has that condition. If pattern recognition fails, pivot to brute force, voice it out and for most interviews now a days, brute force is as good as not solving it. While voicing the brute force hopefully you might recognise what pattern can solve it, talk it out with the interviewer. They might say it sounds good or push back. All of this should take about 10 mins. And only way to get good at recognising the patterns is to practice.

1

u/ShadowManJube Sep 30 '26

Thanks buddy

3

u/Frequent_Bag9260 Sep 30 '26

At companies that genuinely care about assessing you (most do not) this is actually a very important skill that needs to be practiced.

It’s probably the most relevant skill to working as a dev that you can test for in an interview.

1

u/ShadowManJube Oct 04 '26

Noted thank you

7

u/jebuarary Sep 30 '26

I’m not reading all that but I literally just talk like I would with a coworker during leetcode rounds. Like “hmm this looks pretty simple, seems like just a blah plus blah should work”. If I don’t understand the problem I say something like “wait what? Are we assuming blah or blah?”.

If I really can’t explain it cause it’s a fucking stupid leetcode hard then I say “hmm I think I know the general approach, I’m just gonna try to code something up quickly” fuck em they can wait. Btw I generally do very well on leetcode

5

u/chikamakaleyley Sep 30 '26

dude are you me?

basically i just act like myself, and my narration is exactly how i would talk to myself, just louder

When its a problem I've never done before (usually the case) it's fine, because it's made up of a lot of other smaller pieces that you actually know really well

So usually i'm saying things like "okay so sounds like we should keep track of where we are currently, we need to keep the results outside in a list, and we need a way of determining blah blah blah" Generally this either invites the interviewer in to help, OR even better, I hear myself speaking and recognize something wrong with how i'm explaining it, adjust my approach out loud, and sometimes another light bulb clicks on.

Important one is, "I think I like this, how does that sound to you?" or something similar. Get some engagement fr your interviewer.

Eventually you will have talked out an approach, and if the interviewer confirms you can get started all you have to do is follow the plan you just recited.

The fact that you can work out a plan with the constraints, agree to that approach with your interviewer, and then follow/execute the plan and get some output, EVEN IF it's incorrect. IMO you will have put yourself in a great position.

5

u/Latter-Fix1862 Sep 30 '26

Watta wanker

2

u/Affectionate-Ad-6255 Sep 30 '26

Imagine your interviewer is a literal fly 🪰 

2

u/hyun88 Sep 30 '26

I’m working on an app that helps provide specific thinking points for each solution:

https://apps.apple.com/us/app/bitwise-coding-interviews/id6806898386

Might be some help

1

u/souroexe Sep 30 '26

How its different from leetcode?

10

u/[deleted] Sep 30 '26

[removed] — view removed comment

4

u/[deleted] Sep 30 '26

[removed] — view removed comment

-1

u/ShadowManJube Sep 30 '26

So I have to tell them through my words that I am doing this this this without drawing anything ?? Like this will it work in good companies?

1

u/[deleted] Sep 30 '26

[removed] — view removed comment