← Antra Interview Insights

Antra·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Interviewed for a software engineer role at Antra and got the classic sliding window problem. Nothing too wild, pretty standard technical screen.

Questions Asked (1)

Q1

Given a string, find the length of the longest substring that contains no repeated characters.

Algorithms & Data Structures
Author's notes

Knew this one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Use a sliding window with two pointers to maintain a substring with unique characters, expanding the right pointer and shrinking the left pointer when a duplicate is found. Track the maximum length seen so far. This yields O(n) time complexity.

Pro tip: After presenting the optimal solution, mention that the same sliding window pattern applies to many substring problems, showing you understand the underlying technique rather than just memorizing one answer.

1. Clarify the problem

Confirm that the string can contain any characters (e.g., ASCII, Unicode) and that we need the length, not the substring itself. Ask about edge cases like empty string or all unique characters.

2. Discuss brute force

Briefly mention that a brute force approach would check all substrings for uniqueness, which is O(n^3) or O(n^2) with optimization, and explain why it's inefficient.

3. Introduce sliding window

Explain the sliding window technique: maintain a window [left, right] with unique characters. Expand right, and when a duplicate is found, move left past the previous occurrence of that character.

4. Detail the algorithm

Use a hash map to store the last seen index of each character. Iterate right from 0 to n-1; if the character is in the map and its index >= left, update left to index+1. Update the map and max length.

5. Analyze complexity and test

State that time complexity is O(n) and space is O(min(n, m)) where m is the character set size. Walk through a small example to verify correctness.

Key Points to Mention

  • Sliding window technique with two pointers
  • Hash map to track last seen index of characters
  • Time complexity O(n) and space complexity O(min(n, m))
  • Handling edge cases: empty string, all unique characters, repeated characters
  • Comparison with brute force approach
  • Generalization to other substring problems

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.