Build Maximum Integer from Subsequence (Google India)
Updated
Problem statement
You are given an array nums of decimal digits and an integer k.
Choose exactly k elements at strictly increasing indices, then concatenate the chosen digits in their original order to form an integer. Leading zeroes are allowed and do not change the integer's numeric value.
Return the largest integer that can be formed.
Function
buildMaximumInteger(nums: int[], k: int) → intExamples
Example 1
nums = [4, 9, 0, 2]k = 2return = 92Choose digits 9 and 2 at indices 1 and 3. They preserve their original order and form the maximum value 92.
Constraints
1 <= k <= min(nums.length, 9)0 <= nums[i] <= 9
More Google Phone Screen questions
- Evaluate a Nested Math ExpressionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Route Pattern MatcherPHONE 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
- Logger Rate Limiter with Every-Arrival HistoryPHONE SCREEN · Seen Nov 2026
Similar questions at other companies
- Most Segments That Sort the ArrayRippling · OARippling interview questions
- Max Chunks to Make SortedBloomberg LP · ONSITE INTERVIEWBloomberg LP interview questions
- Largest Number Below N from Reusable DigitsByteDance · PHONE SCREENByteDance interview questions
- Tennis Court SchedulingAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
- Asteroid CollisionSiemens · PHONE SCREEN
- Jump GamePaytm · PHONE SCREENPaytm interview questions
- Billing Log with Undo and RedoReddit · PHONE SCREENReddit interview questions
- Remove the Fewest Magic BeansThe D.E. Shaw Group · PHONE SCREENThe D.E. Shaw Group interview questions
- Remove K DigitsProcol · PHONE SCREEN
- Compress Editor Actions into Operational Transform OperationsReplit · OA · PHONE SCREEN · ONSITE INTERVIEW
Google interview experiences
- Google L5 Security Engineer Domain Knowledge Round: 1 Experience
- 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
- Google Experienced SWE First Round and Onsite: 1 Experience