FastPrepMissing Element in Sorted Array
Problems/Missing Element in Sorted Array

Missing Element in Sorted Array

Bloomberg LP logoBloomberg LP● MediumNEW GRADONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a first-hand Bloomberg 2019 new-grad onsite interview through the standard sorted-array missing-element problem.

Given nums and k, return the k-th missing positive integer after nums[0].

The array is strictly increasing: each value is greater than the previous one. Count positive integers that are absent from the array, from smallest to largest.

Function

missingElement(nums: int[], k: int) → int

Examples

Example 1

nums = [4,7,9,10]k = 3return = 8

The first missing values are 5, 6, and 8, so the third is the answer.

Constraints

  • 1 <= nums.length <= 5 * 10^4.
  • 1 <= k <= 10^9.
  • The answer fits in signed 32-bit range.

More Bloomberg LP Onsite Interview questions

  • N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Top K Frequent WordsONSITE INTERVIEW · Seen Nov 2026
  • Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Add Two Numbers IIPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Decode StringPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Minimum Replacements to Make Two Strings AnagramsPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Currency Conversion RatePHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Search a Row- and Column-Sorted MatrixByteDance · ONSITE INTERVIEWByteDance interview questions
  • First and Last Target Position in a Mountain ArrayGoogle · ONSITE INTERVIEWGoogle interview questions
  • 3Sum SmallerSalesforce · ONSITE INTERVIEWSalesforce interview questions
  • Smallest Batch Size Within a Step LimitMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Peak of an Increasing-Then-Decreasing ArraySnap Inc. · ONSITE INTERVIEWSnap Inc. interview questions
  • Online Meeting Scheduler with Fixed RoomsUber · ONSITE INTERVIEWUber interview questions
  • Search in a Rotated Sorted ArrayAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Search a 2D MatrixWhatNot · PHONE SCREEN · ONSITE INTERVIEWWhatNot interview questions
  • Search in Rotated Sorted ArrayKotak Mahindra Bank · ONSITE INTERVIEWKotak Mahindra Bank interview questions
  • Find First and Last Position in Sorted ArrayPaytm · ONSITE INTERVIEWPaytm interview questions

Bloomberg LP interview experiences

  • Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
  • Bloomberg SWE Intern Interview Questions: 68 Questions
  • Bloomberg Interview Questions, Level Not Reported: 65 Questions
  • Bloomberg Experienced Design & More: 126 Questions (Part 2 of 2)
  • Bloomberg Experienced SWE Interviews: 167 Questions (Part 1 of 2)
  • Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public int missingElement(int[] nums, int k) {
      // Write your code here.
    }
}
Checking account…