FastPrepTarget Interval Conflict
Problems/Target Interval Conflict

Target Interval Conflict

Google logoGoogle● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report gives half-open endpoints and a linear scan for a single query. It does not give a function signature or input limits. Our version is about 98% the same as the reported question.

You are given a target half-open interval [target[0], target[1]) and an unsorted collection of half-open intervals intervals. Return true if the target conflicts with at least one interval. Otherwise, return false.

Two half-open intervals conflict when they share at least one point. Endpoints that only touch are not a conflict. Equivalently, [aStart, aEnd) and [bStart, bEnd) do not conflict when aEnd <= bStart or bEnd <= aStart.

This is a single query. The input does not need to be sorted.

Function

hasIntervalConflict(target: int[], intervals: int[][]) → boolean

Examples

Example 1

target = [4,8]intervals = [[8,10],[1,4],[6,7]]return = true

The intervals [1,4) and [8,10) only touch the target at an endpoint, but [6,7) shares points with [4,8).

Example 2

target = [4,8]intervals = [[10,12],[1,4],[8,10]]return = false

Every interval is disjoint from the target. In particular, [1,4) ends when the target begins, and [8,10) begins when the target ends.

Constraints

  • target.length == 2.
  • Every row of intervals has length 2.
  • Every target and collection interval is valid: start < end.
  • intervals may be empty and may appear in any order.

More Google Phone Screen questions

  • Route Pattern MatcherPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Periodic-Color Binary Forest RootsPHONE SCREEN · Seen Nov 2026
  • Evaluate a Nested Math ExpressionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Best Stock Trade with Buy and Sell DaysPHONE SCREEN · Seen Nov 2026
  • Word Chain Jumps in a GridPHONE SCREEN · Seen Nov 2026
  • Dice-Walk Winning ProbabilityPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Lowest Common Ancestor in an N-ary TreePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Apartment Housemate PreferencesPHONE SCREEN · Seen Nov 2026
  • Price at Query TimestampsPHONE SCREEN · Seen Nov 2026
  • Course Schedule Cycle DetectionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Total Years of Work ExperienceLinkedIn · PHONE SCREENLinkedIn interview questions
  • Meeting RoomsByteDance · PHONE SCREENByteDance interview questions
  • Meeting RoomsGoldman Sachs · PHONE SCREEN · ONSITE INTERVIEWGoldman Sachs interview questions
  • Meeting Room Request FeasibilityApple · PHONE SCREENApple interview questions
  • Meeting RoomsChainalysis · PHONE SCREENChainalysis interview questions
  • Find First Common AvailabilityDatadog · PHONE SCREENDatadog interview questions
  • Merge Overlapping IntervalsAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
  • Peak Chat Load Across AgentsCresta · PHONE SCREENCresta interview questions
  • Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
  • Majority Labels over Audio IntervalsNooks · PHONE SCREEN

Interview reports that mention this question

  • Google SWE Intern Interviews: 85 Experiences (Part 1 of 8)

Google interview experiences

  • Google interviews · November 2026
  • Google Software Engineer Onsite Questions: 10 Experiences
  • Google OA: What It Tests (2026)
  • Google L4 SWE Phone Screen: 1 Experience
  • Google ML Engineering Manager Onsite: 1 Experience
All Google interview questionsSee Google hiring insights
Saved
class Solution {
    public boolean hasIntervalConflict(int[] target, int[][] intervals) {
      // Write your code here.
    }
}
Checking account…