Google Screening question 2024 | L4 | Bangalore India | Reject
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2024-10-23Added By Anonymous
Source:Ā Link
š§ Experience: Gave interview last week.
ā
Outcome: Reject
š° Compensation: unknown
š Location: Bangalore India
š¢ Company: Google
š Education: unknown
š Benefits: unknown
š
Offer Date: unknown
I gave my interview last week with Google.
Problem:
You are given a sequence of positive integers
sequence. Your goal is to divide this sequence into parts non-empty contiguous subsequences. Among these parts subsequences, the number of subsequences whose sum of elements is at least threshold will be called the score. Find the maximum score.
sequence = [1, 4, 2, 8]
parts = 3
threshold = 6
Output:
2
sequence = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
parts = 5
threshold = 2
Output:
5
expected time complexity was O(nlogn)