Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.

Is DSA still worth learning when AI can write code?

Tauseef Fayyaz

Answered by Tauseef Fayyaz

Asked 13 timesUpdated 28 Sept 2026
Topics
Short answer

Yes, but for a different reason than before. AI can produce a sorting function; it cannot tell you whether your design will fall over at scale or whether the code it wrote is quietly quadratic. DSA teaches you to judge code, and many companies still test it. Learn the core patterns well, skip the endless grind.

What people tell me

I am a student and I have spent months on LeetCode-style problems. Now AI tools can solve most of them in seconds, and I keep reading that coding rounds will disappear. I am starting to feel that all this practice is wasted time and that I should only build projects with AI instead. At the same time, the companies I want to join still seem to have DSA rounds.

A composite of the messages behind this question, with personal details left out.

Key takeaways

  • DSA is the vocabulary for reasoning about cost: time, memory and what happens as data grows.
  • You need it to review and debug AI-written code, not only to write code yourself.
  • Many companies still include problem-solving rounds, so it remains part of getting hired.
  • Learn around fifteen core patterns deeply instead of chasing a problem count.
  • Balance it with projects: roughly a third of your practice time is plenty for most people.

What DSA was ever for

Data structures and algorithms were never really about memorising how to reverse a linked list. They are about a way of thinking: what does this code cost, what happens when the input is a hundred times bigger, and which structure makes the common operation cheap. That thinking is exactly what you need when a tool hands you fifty lines of plausible-looking code.

AI changes who types the loop. It does not change the fact that someone has to know whether the loop is right.

Where DSA shows up in real work

SituationWhat DSA knowledge lets you do
Reviewing AI-generated codeSpot a nested loop over a large list, or a lookup that should be a hash map
A slow page or endpointRecognise that the problem is an algorithm, not the server
Designing a featureChoose between a queue, a cache, an index or a sorted structure
DebuggingReason about edge cases: empty input, duplicates, huge values
System designUnderstand why databases use B-trees and why caches evict the way they do

I see this often: developers who lean on AI without fundamentals ship code that works on test data and falls over in production. They cannot tell why, because they never learned to read cost.

It is still part of getting hired

Hiring processes change slowly. Many companies, especially larger product companies, still include some kind of problem-solving round, and some have moved to formats where you explain, extend or debug code rather than write it from scratch. Those newer formats test understanding even more directly. Treat DSA as one input to getting hired, not the purpose of learning it, but do not assume it has disappeared because a tool can solve textbook problems.

How to learn it now

The old approach was a problem count: 300, 500, 800 solved. That was never efficient and is even less so now. A better approach:

  1. Learn the core structures properly. Arrays, hash maps, stacks, queues, linked lists, trees, heaps and graphs. Know what each makes cheap and what it makes expensive.
  2. Learn patterns, not problems. Two pointers, sliding window, binary search, BFS and DFS, backtracking, dynamic programming, and a handful more. LeetCode Patterns by Sean Prashad and the NeetCode Roadmap group problems this way.
  3. Solve by hand first. Give yourself 25 to 40 minutes before any help. Struggling is where the learning happens.
  4. Then use AI as a tutor. Ask for a hint, not the answer. After solving, ask it to critique your complexity analysis or suggest edge cases you missed.
  5. Explain it out loud. If you cannot explain why your solution works, you have not learned it yet.

The DSA roadmap follows this order, and the DSA cheat sheet keeps the patterns and complexities in one place. VisuAlgo is useful when a structure will not click.

How much is enough

For most people aiming at a first or second developer job:

  • Comfortable with easy problems and able to solve common medium problems in a reasonable time.
  • Able to name the pattern within a few minutes of reading a problem.
  • Able to state time and space complexity without guessing.

Beyond that, returns drop quickly unless you are aiming at companies known for very hard rounds, or you enjoy competitive programming for its own sake.

Keep it in proportion

The mistake is not learning DSA. The mistake is doing only DSA. A reasonable split for a student is about a third of practice time on problems and the rest on building, deploying and reading real code. Projects show you can ship; DSA shows you can reason. You need both, and AI makes the reasoning part more valuable, not less.

If you are still stuck

If you cannot solve problems at all yet, start with How do I start DSA when I cannot solve problems and never know which approach to use?, then read How many LeetCode problems are enough, and how do I practise them properly?. If you want a practice plan that fits your timeline, join Sefism and, as a member, book a 1:1 session.

Was this answer helpful?

Ask your own

Your situation is not quite this one?

Members get written answers to their own questions, a roadmap built for them and feedback on their projects. Early access is open: sign up and your account is active shortly after. Prefer to talk? A free call works too.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.

More questions people ask

All questions

Employers rarely require a specific brand. They expect you to use an AI coding assistant well (in the editor and in the terminal), to review and test what it produces, to call an LLM API in a small feature, and to explain when you would not use AI. Pick one assistant, learn it properly, and show judgement in your projects.

Asked 14 timesRead the answer

Choose based on what you want to build. JavaScript if you want web development, since it runs in every browser. Python if you are drawn to data, AI, automation or backend scripting. Both are excellent first languages, and the second one is far easier once you know the first well.

Asked 13 timesRead the answer

Tutorials train recognition, not production. When you follow along, someone else makes every decision. Building alone requires you to break a problem down and make choices, which is a separate skill. Build it with small projects, planning on paper first, and a rule to struggle before you look anything up.

Asked 13 timesRead the answer