Interview prep

Software engineer interview questions, with the answers worked out.

Practice a real coding question and a real system design question below, free, with full solutions.

Published October 30, 2026 · Updated November 1, 2026

Most software engineer interviews mix a coding problem with a design discussion. Here’s one of each, answered the way interviewers want to hear it.

Free question 1 (coding): Merge overlapping intervals

You’re given a list of meeting times as [start, end] pairs, for example [[1,3],[2,6],[8,10],[15,18]]. Merge every pair that overlaps and return the result. For this example, return [[1,6],[8,10],[15,18]].

Model answer

Start by saying the plan out loud: “If I sort by start time, any overlap has to be with the interval right before it. So I can sort once, then walk the list one time.”

def merge(intervals):
    if not intervals:
        return []
    intervals.sort(key=lambda pair: pair[0])
    merged = [list(intervals[0])]
    for start, end in intervals[1:]:
        last = merged[-1]
        if start <= last[1]:
            last[1] = max(last[1], end)
        else:
            merged.append([start, end])
    return merged

Walk-through: after sorting, [1,3] goes in. [2,6] starts at 2, which is at or before 3, so the last interval becomes [1,6]. [8,10] starts after 6, so it’s added. [15,18] starts after 10, so it’s added. Result: [[1,6],[8,10],[15,18]].

Complexity: O(n log n) time for the sort, then O(n) for the single pass. O(n) extra space for the output.

Edge cases to mention: an empty list; a single interval; intervals that only touch, like [1,4] and [4,5] (with start <= end they merge, so ask the interviewer if touching counts as overlapping); one interval inside another, like [1,10] and [2,3], which is why the code takes max() instead of the new end.

What interviewers listen for: you state the sorting idea before coding, you test with the example, and you raise the “touching” question yourself.

Free question 2 (system design): Design a URL shortener

Design a service like bit.ly. Users paste a long URL and get a short link. Anyone who opens the short link is sent to the long URL.

Model answer

1. Agree on scope first. Core features: create a short link, redirect, optional custom alias, optional expiry. Out of scope unless asked: user accounts and detailed analytics.

2. Estimate the load. Say 10 million new links a month and 100 reads for every write. That’s about 4 writes and 400 reads per second on average, so plan for spikes several times higher. Over 5 years that’s 600 million links. At roughly 500 bytes each, about 300 GB of data.

3. API.

  • POST /links with the long URL, returns the short code
  • GET /{code} returns a redirect to the long URL

4. Making the short code. Use a unique counter (or an ID service that hands out blocks of IDs to each server) and convert the number to base 62 (a to z, A to Z, 0 to 9). Seven characters give 62 to the power of 7, about 3.5 trillion codes, far more than needed. A counter never collides. Random codes also work but need a check for collisions.

5. Storage. A key-value table: code, long URL, created date, expiry. The workload is simple lookups by key, so a key-value or wide-column store fits. A relational database with an index on code also works at this size.

6. Make reads fast. Reads outnumber writes 100 to 1, so put a cache (for example Redis) in front of the database. Popular links stay in memory. Put the redirect service behind a load balancer and add servers as traffic grows.

7. Redirect type. A 301 (permanent) lets browsers cache the redirect, which cuts load. A 302 (temporary) sends every click back to you, which you need if you count clicks. Say which you’d pick and why.

8. Abuse and reliability. Rate-limit link creation, check long URLs against a malware list, and replicate the database so a single failure doesn’t break every link.

What interviewers listen for: you ask about scale before drawing boxes, you explain the trade-off on code generation, and you notice the read-heavy pattern and add caching.

The full guide

The full software engineer interview guide

One printable PDF. Part 1 is the prep section: what to wear, when to arrive or log in, key topics to review for this role, questions to ask, talking about pay, a story bank, the day before and the day itself, and a thank you note. Part 2 is 20 questions for this role, each with a possible answer and lined space for your notes. A checklist for the night before is included. Print it on US Letter and write in it.

  • A full prep section: what to wear, when to arrive or log in, key topics for a software engineer role, questions to ask, talking about pay, a story bank, the day before and the day itself, and a thank you note
  • 6 coding questions in Python (arrays, strings, hash maps, trees, graphs and dynamic programming), with time and space notes and lined space for your notes
  • 4 system design questions: a rate limiter, a news feed, a chat app and a job queue
  • 5 behavioural questions with sample STAR answers, plus lines for your own stories
  • 5 situational questions on your team, your code and production
  • A checklist for the night before. Print the PDF on US Letter and write in it

One PDF, $24 CAD / $17 USD, paid once on this page and emailed to you. Visitors in Canada pay $24 CAD. Everyone else pays $17 USD.

Pay on this page

The PDF is emailed to you after payment. It is not posted as a public download.

$24 CAD / $17 USD

Next, you pay securely by card through Stripe. If you are 13 to 17, we email your parent or guardian to confirm before we send the guide.

Questions

About these questions

Are these software engineer interview questions for jobs in Canada?

Yes. Software engineer interviews in Canada usually include a coding round, a system design round for intermediate and senior roles, and behavioural questions. The questions here follow that format.

Is there a full interview guide?

Yes. The full printable software engineer interview guide is $24 CAD / $17 USD. You pay on this page and we email you the PDF. It has a prep section (what to wear, when to arrive or log in, key topics for this role, questions to ask, talking about pay, a story bank, the day before and the day itself, and a thank you note), 20 software engineer questions with possible answers and lined space for notes, and a checklist for the night before. The two questions on this page are free to use now.

Not getting interviews yet? Our software and IT resumé help shows what hiring managers screen for first.

More roles: interview questions by role.

Request a role

Don't see your job? Tell us.

Tell us the job you're interviewing for, and we'll write interview questions and model answers for it. It's free to ask. We read every request. We can't promise to add every role, but the most requested ones go first.