FastPrepLongest Substring Without Repeating Characters
Problems/Longest Substring Without Repeating Characters

Longest Substring Without Repeating Characters

Omnissa logoOmnissa● MediumONSITE INTERVIEW
QuestionFunctionExamples

Problem statement

A quick note: this problem is backed by a real Omnissa onsite interview report that directly named Longest Substring Without Repeating Characters. The report did not include an exact function interface, examples, constraints, or character-set rules. The core task match is about 95%.

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

Interview Follow-up

This was part of a rapid-fire three-problem round in which the candidate presented brute-force, improved, and optimal approaches and wrote working code for each problem.

Function

lengthOfLongestSubstring(s: String) → int

Examples

Example 1

s = "abcabcbb"return = 3

The longest substrings without repeated characters include "abc", with length 3.

Example 2

s = "bbbbb"return = 1

Every valid substring without repeats has length 1.

More Omnissa problems

  • Build and Check a Palindrome Linked ListONSITE INTERVIEW · Seen Sep 2026
  • Find the CelebrityONSITE INTERVIEW · Seen Sep 2026
  • Maximum All-Ones Square Side LengthONSITE INTERVIEW · Seen Sep 2026
All Omnissa interview questionsSee Omnissa hiring insights
Saved
public int lengthOfLongestSubstring(String s) {
  // write your code here
}
Checking account…