PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Boeing

Compute unique-substring length and first unique index

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in string processing and character-frequency reasoning by combining tasks that measure longest distinct-character substring length and the index of the first non-repeating character.

  • easy
  • Boeing
  • Coding & Algorithms
  • Software Engineer

Compute unique-substring length and first unique index

Company: Boeing

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Technical Screen

Solve the following two string problems. ## Problem 1 — Longest substring with all distinct characters Given a string `s`, find the **length** of the longest contiguous substring that contains **no repeated characters**. - **Input:** `s` (ASCII or Unicode string) - **Output:** an integer length - **Constraints (typical):** `0 ≤ |s| ≤ 10^5` Example: - `s = "abcabcbb"` → output `3` (substring could be `"abc"`) ## Problem 2 — First unique character Given a string `s`, return the **index (0-based)** of the first character that appears **exactly once** in the entire string. If no such character exists, return `-1`. - **Input:** `s` - **Output:** integer index or `-1` - **Constraints (typical):** `0 ≤ |s| ≤ 10^5` Example: - `s = "leetcode"` → output `0` - `s = "aabb"` → output `-1`

Quick Answer: This question evaluates proficiency in string processing and character-frequency reasoning by combining tasks that measure longest distinct-character substring length and the index of the first non-repeating character.

Boeing logo
Boeing
Jan 22, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
0
0
Loading...

Solve the following two string problems.

Problem 1 — Longest substring with all distinct characters

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

  • Input: s (ASCII or Unicode string)
  • Output: an integer length
  • Constraints (typical): 0 ≤ |s| ≤ 10^5

Example:

  • s = "abcabcbb" → output 3 (substring could be "abc" )

Problem 2 — First unique character

Given a string s, return the index (0-based) of the first character that appears exactly once in the entire string. If no such character exists, return -1.

  • Input: s
  • Output: integer index or -1
  • Constraints (typical): 0 ≤ |s| ≤ 10^5

Example:

  • s = "leetcode" → output 0
  • s = "aabb" → output -1

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Boeing•More Software Engineer•Boeing Software Engineer•Boeing Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.