Community Question Bundle

The Mid-Level Coding Questions Most Loops Share

Five Python questions I have now seen at four different mid-level loops in 2024 and 2025. None are tricky; all five are testing whether you can write clean code and reason about edge cases out loud.

The Mid-Level Coding Questions Most Loops Share

Five Python questions I have now seen at four different mid-level loops in 2024 and 2025. None are tricky; all five are testing whether you can write clean code and reason about edge cases out loud.

Question Bundle
Python
5 questions
mid-level
interview-prep
coding-interview
hugodlamini

By @hugodlamini

May 13, 2026

·

Updated May 18, 2026

901 views

28

4.5 (9)

Write a function that returns the longest substring of s with no repeated characters. They want the substring, not just the length, and they will follow up by asking the runtime.

Try this

Try this. longest_unique_substring('abcabcbb') returns 'abc'. longest_unique_substring('bbbbb') returns 'b'. longest_unique_substring('pwwkew') returns 'wke' (the helper returns the first length-3 window it finds).