๐Ÿ“Š We use cookies & analytics to improve your experience. Learn more
Latest

Free course ยท Intermediate

Interview DSA Crash Course

๐Ÿ› Way2Fresher Academy โฑ 4 weeks โญ 4.9 ๐Ÿ‘ฅ 7,200 learners ๐ŸŽ“ Certificate

Free 4 modules ยท 15 lessons Start now โ†’

What you will learn

  • State the time and space cost of your own solution in the interview without being asked twice
  • Recognise the ~12 patterns behind the vast majority of fresher interview questions
  • Write working code on paper or a plain editor, with no autocomplete and no run button
  • Talk through your approach before typing, which is what the interviewer is grading
  • Handle a question you have never seen by reducing it to a pattern you know
  • Recover from a blank moment without going silent for two minutes

Course curriculum

4 modules ยท 15 lessons ยท a worked example and a practice task in every lesson

Module 4Graphs, greedy and interview polish4 of 44 lessons

The two patterns left, and the debrief that makes practice actually stick.

  1. Graphs: BFS and DFS

    A graph is nodes and edges; BFS explores level by level and finds the shortest number of steps, while DFS goes deep and is the base for many recursive answers.

    The lesson

    Keep a visited set from the start, or a graph with a cycle loops forever - the single most common bug in a first BFS.

    Grid problems are graphs in disguise: each cell is a node and its four neighbours are edges. Seeing that turns a scary question into BFS you already know.

    Python
    from collections import deque
    
    def shortest(graph, start, goal):
        q = deque([(start, 0)])
        seen = {start}
        while q:
            node, dist = q.popleft()
            if node == goal:
                return dist
            for nxt in graph[node]:
                if nxt not in seen:
                    seen.add(nxt)
                    q.append((nxt, dist + 1))
        return -1

    Example Shortest path in a grid, or "fewest changes to reach a state", is BFS with a queue; "does a path exist" or "count the islands" can be DFS.

    Practice Write BFS that returns the shortest distance between two nodes in an unweighted graph.

  2. Greedy and intervals

    A greedy solution takes the locally best choice and never reconsiders. It is right when the problem has that property - intervals sorted by end time is the classic case.

    The lesson

    Greedy is easy to code and easy to get wrong; before trusting it, try to build a small counterexample. If you cannot, say why the greedy choice is safe.

    Its tell is an exchange argument: swapping your choice for any other never improves the answer. Saying that sentence is worth as much as the code.

    Python
    def max_meetings(intervals):
        intervals.sort(key=lambda iv: iv[1])   # by END time
        count, last_end = 0, float("-inf")
        for start, end in intervals:
            if start >= last_end:              # fits after the last one
                count += 1
                last_end = end
        return count
    
    # [[1,3],[2,4],[3,5]] -> 2   (take [1,3] then [3,5])

    Example The maximum number of meetings in one room is greedy: sort by end time and take each meeting that starts after the last one ends.

    Practice Solve the meeting-room problem and write one sentence on why sorting by end time is the correct greedy choice.

  3. Binary search on the answer

    When the answer is a number and "is X good enough" is easy to check, binary search the answer instead of trying every value. It turns a linear scan into a logarithm.

    The lesson

    The hard part is the check, not the search. Write a plain function that answers yes or no for one value; the binary search around it is five lines.

    Off-by-one is the classic bug - decide once whether the answer is the low or the high end, and keep that convention through the loop.

    Python
    def ship_within(capacity, weights, days):
        used, current = 1, 0
        for w in weights:
            if current + w > capacity:
                used += 1
                current = 0
            current += w
        return used <= days
    
    lo, hi = max(weights), sum(weights)
    while lo < hi:
        mid = (lo + hi) // 2
        if ship_within(mid, weights, days):
            hi = mid
        else:
            lo = mid + 1
    print(lo)

    Example "Smallest ship capacity to move all packages in D days" is checked by a simple simulation at each candidate capacity, then binary-searched.

    Practice Solve "minimum capacity to ship in D days" and write the check function separately from the search.

  4. The mock interview and the debrief

    A mock interview is worth ten more practice problems if you debrief it. Record it, then write down the pattern you missed and the sentence you fumbled.

    The lesson

    Practise out loud with a person or a recording; thinking you can explain it and explaining it under time pressure are different skills, and only one is tested.

    Read your debrief file before the next interview, not your solution file. The mistakes repeat; the solutions you already know do not need revising.

    Plain text
    Mock interview debrief (3 lines)
    
    Went well:  talked through the two-pointer plan before coding
    Went wrong: blanked on "longest subarray with sum <= k" - missed the window
    Change:     keep a pattern checklist; say the pattern out loud first
    
    Read this before the next interview, not the solutions.

    Example If you blanked on a "subarray" question, the debrief note is "did not connect subarray to a sliding window" - the fix is a checklist, not more problems.

    Practice Do one timed mock interview, then write a three-line debrief: what went well, what went wrong, what you will change.

Show all modules on one page

About Interview DSA Crash Course

Solve the interview problems that are actually asked of freshers โ€” out loud, under time, on paper โ€” in four weeks.

Final-year students and graduates with a first round of coding interviews ahead, who can already write a loop and freeze when the timer starts.

What you will be able to do at the end

  • State the time and space cost of your own solution in the interview without being asked twice
  • Recognise the ~12 patterns behind the vast majority of fresher interview questions
  • Write working code on paper or a plain editor, with no autocomplete and no run button
  • Talk through your approach before typing, which is what the interviewer is grading
  • Handle a question you have never seen by reducing it to a pattern you know
  • Recover from a blank moment without going silent for two minutes

How the course is structured

3 modules and 11 lessons, arranged so each one ends with something you have built. Every lesson carries a worked example and a practice task โ€” the practice is the course, the reading is only the setup. Plan for 4 weeks ยท about 8 hours a week.

The full syllabus โ€” every lesson, its example and its practice task โ€” is in the Course curriculum below. Nothing is locked and nothing needs an account.

Your weekly routine

  • Two problems a day, solved on paper first and typed afterwards.
  • One narrated mock interview a week โ€” out loud, timed, no pausing to look anything up.
  • Write the complexity of every solution before typing it, even when you are sure.

What you will have built by the end

  • A pattern notebook: every problem you solve, its pattern and its complexity in one line
  • Four recorded practice interviews narrated out loud
  • A full mock interview from the Career Portal's AI mock-interview tool, with its feedback written down

Where this leads for a fresher

  • Fresher software engineer at a product company
  • Trainee / graduate engineer at a services company
  • Second-round technical interviews you have already qualified for
  • Campus and off-campus hiring drives

Titles vary between companies; the evidence does not. A deployed project, a set of queries you can explain, or a case study with real testing behind it is what a fresher interview has to work with.

Frequently asked questions

How many problems should I solve before interviewing?

Around 60โ€“80 real ones, each narrated out loud, covers the patterns fresher interviews actually use. Numbers in the hundreds without narration is the common trap: you recognise but cannot produce.

I know coding but I freeze in interviews. Is that fixable?

Yes, and it is the most fixable part. Narrating every practice problem out loud, including one full mock a week, is the training โ€” not more reading. Take the free Career Pulse check: communication is one of the areas it scores, and it will show you how much of your gap is interview skill rather than knowledge.

Is this course free?

The lessons, examples and practice tasks are free, and the AI mock-interview tool on the Career Portal is free to use.

Do I need data structures from my college syllabus?

No. Arrays, strings, maps, sets, trees and recursion cover the overwhelming majority of fresher questions. This course teaches exactly those and skips the theory you will not be asked.

Not sure which of these you need first? The free Career Pulse check scores your skills, communication and goal clarity in about three minutes and tells you which gap to close first. Take the free check.