InterviewLegend

Strings & Hash Maps

Alex Chen30 min readGuide updated
In this lesson
  • Find the longest run of distinct characters with a sliding window
  • Find the first character that appears only once with a count map
  • Pull the unique numbers out of a list, and ask what "unique" means first
  • Read a Boeing prompt to the letter, including print versus return

When a Boeing screen asks for live code, the problems are short and the topics are basic. Strings and hash maps are a steady thread. A Canada intern in November 2025 had a video technical round with an easy LeetCode hash map question, and the newest named problem, from January 2026, is a string screen in two parts.

This lesson works that screen first, then a 2024 task from a hiring-manager round. None of the three is hard. The test is a clean loop with a map, talked through as you type, that gives exactly the output the prompt asked for.

The Boeing angle
Print or return, read it twice. A Seattle embedded candidate in January 2024 returned the answer when the two hiring managers wanted it printed, and they were strict about it. Boeing rounds grade against the prompt as written, so repeat the output format back before you start.

Asked at Boeing

One screen, two string parts (January 2026). A full-stack software engineer's technical screen asked for something like two things about one string: the length of the longest substring whose characters are all different, and the index of the first character that doesn't repeat. Its difficulty is listed as Easy. Only the outline of each part is known, so the versions below are the standard forms. They share one idea, a map that remembers what you've already seen.

1

Longest Substring of Distinct Characters

MediumCommonly asked
Problem
Given a string text, return the length of the longest substring in which no character appears twice.

A substring is a run of characters next to each other, so you can't skip any. Characters are compared exactly, which means upper and lower case count as different, and a space is a character like any other.
Inputtext = "abcabcbb"Output3

"abc" is the longest run with no repeat. Every run of four contains a repeated letter.

How this uses the pattern

Slide a window over the string. Keep a map from each character to the last index you saw it at, and when a character repeats inside the window, move the window start just past its last position.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Longest Substring of Distinct Characters

Loading...
Click "Run" to execute your code
The Boeing angle
This was the first of two parts in one screen, so finish it cleanly and leave time for the second. Say the brute force out loud in a sentence (check every substring, cubic time), then go straight to the window. Interviewers at this level want to hear why the start only ever moves forward, because that's what makes it linear.
Take it further
Return the substring itself. Keep the start index of the best window alongside its length, and slice at the end. Ask whether ties should return the first or the last longest run. A 2023 eLitmus test in India asked for a "longest distinct subsequence" as its medium question, and if you hear that wording, ask whether a subsequence or a substring is meant. A subsequence can skip characters, so the longest one with no repeats is just the number of different characters, which would be a strange medium. It almost certainly means this problem.

The second part of the same screen moves from runs to single characters. Something like: find the first character in the string that appears only once, and give its index.

2

Index of the First Non-Repeating Character

EasyFrequently asked
Problem
Given a string text, return the index of the first character that appears exactly once in the whole string. If every character repeats, or the string is empty, return -1.

Characters are compared exactly, so "A" and "a" are different characters.
Inputtext = "leetcode"Output0

l appears once and comes first.

How this uses the pattern

Two passes. Count every character first, then walk the string again and return the first index whose count is 1.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Index of the First Non-Repeating Character

Loading...
Click "Run" to execute your code
The Boeing angle
This is the easy half of the screen, so it's where you buy back time. Say the two-pass plan in one sentence and write it. If you finished part one with time to spare, offer the streaming follow-up before they ask. It shows you can keep a map up to date while data arrives.
Take it further
Characters arrive one at a time. Now the string is a stream, and after each new character you have to report the first character so far that has appeared once. Keep the counts and a queue of candidates in arrival order. After each new character, drop from the front of the queue every candidate whose count has gone above 1. The front is the answer.

Older problems (2024)

Get all the unique numbers in a list (January 2024). A Seattle embedded software candidate had a programming interview with two hiring managers. The task was something like getting all the unique numbers in a list. The candidate returned the answer when the interviewers wanted it printed, and they were strict about that. It's one report from nearly three years ago, but reading the prompt to the letter pays off in any Boeing round.

3

Unique Numbers in a List

EasyRarely asked
Problem
Given a list of integers numbers, return each different value once, in the order it first appears.

The interview version asked for the result to be printed. The tests here check the returned list, so print it at the end if your prompt says so.
Inputnumbers = [1, 2, 2, 3, 1]Output[1, 2, 3]

1 first appears at index 0, 2 at index 1 and 3 at index 3. The later copies are skipped.

How this uses the pattern

Keep a set of values already seen. Walk the list once and keep a value only the first time it shows up.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Unique Numbers in a List

Loading...
Click "Run" to execute your code
The Boeing angle
"Unique" has two readings. It can mean each value once (remove duplicates) or only the values that appear exactly once. Ask which one before you code, and ask whether order matters and whether to print or return. A thin prompt gets much clearer after those three questions, and the one Boeing report on this task shows the interviewers grading to the letter.
Take it further
Only the values that never repeat. If the interviewer meant the other reading, [1, 2, 2, 3, 1] should give [3]. Count first, then keep the values whose count is 1, in list order. It's the same two-pass shape as the first unique character above.

Common questions

Does Boeing ask LeetCode questions?

Some teams do, at the easy end. The newest named one is the January 2026 string screen above, and a November 2025 intern video round asked an easy hash map question. Many loops have no live coding at all beyond the HireVue coding challenge.

How hard are Boeing technical screen questions?

Mostly easy, sometimes medium. The longest distinct substring is the hardest problem on this page, and it's a standard sliding window. Clear explanation and an exact reading of the prompt matter as much as the algorithm.

Key Takeaways

  • ✓The newest named Boeing coding problem is a January 2026 string screen in two parts.
  • ✓A sliding window with a last-seen map finds the longest run of distinct characters in one pass.
  • ✓For the first unique character, count first, then walk the string in order.
  • ✓Ask what "unique" means and whether to print or return before you write code.
Boeing interview guide

Know what Boeing asks before you walk in.

20 coding · 3 system design · 26 behavioral questions

Get Premium$49 a year · Instant access
Or start freeNo card.

Get their questions first.

The Boeing HireVue Coding ChallengeHad your Boeing interview?How we research

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.