Eatclub (Box8) OA questions (Oncampus) || Intern + FTE
Anonymous User
688

Recently Box8 visited my campus for SDE role and I had the opportunity to crack the round:-

Online Assessment:-
There were two DSA question both were medium level problem. Below is the two questions of it:-

  1. Maximum subarray sum possible after removing at most K array elements
  • Given an array arr[] of size N and an integer K, the task is to find the maximum subarray sum by removing at most K elements from the array.
    Input: arr[] = { -2, 1, 3, -2, 4, -7, 20 }, K = 1
    Output: 26
    Explanation: Removing arr[5] from the array modifies arr[] to { -2, 1, 3, -2, 4, 20 }
    |
    Input:arr[] = { -1, 1, -1, -1, 1, 1 }, K=2
    Output: 3
    Explanation:
    Removing arr[2] and arr[3] from the array modifies arr[] to { - 1, 1, 1, 1}
    Subarray with maximum sum is { 1, 1, 1 }.
  1. Maximum Number of Subsequences After One Inserting
  • You are given a string s consisting of uppercase English letters.You are allowed to insert at most one uppercase English letter at any position (including the beginning or end) of the string. Return the maximum number of "LCT" subsequences that can be formed in the resulting string after at most one insertion.
    Example 1:
    Input: s = "LMCT"
    Output: 2
    We can insert a "L" at the beginning of the string s to make "LLMCT", which has 2 subsequences, at indices [0, 3, 4] and [1, 3, 4].

Interview experience -> Link

Comments (3)