Panda Guru LogoPanda
Guru

Jupiter | SDE 2 | 28 January 2025 | Waiting For Results

Round 1: Technical Interview (1 Hour)

Questions:

Behavioral Questions:

Technical Questions:

1. Minimum Days to Form Bouquets

I was given an array where arr[i] represents the day the i-th rose blooms. The goal was to find the minimum number of days required to form at least m bouquets, each containing exactly k adjacent bloomed roses.

Example Input:
N = 8, arr = {7, 7, 7, 7, 13, 11, 12, 7}, m = 2, k = 3
Expected Output: 12
Approach:
Code Snippet:
public static boolean checkBoquetFormation(int[] arr, int m, int k, int day) { int count = 0, bouquet = 0; for (int bloomDay : arr) { if (bloomDay <= day) { count++; if (count == k) { bouquet++; count = 0; } } else { count = 0; } } return bouquet >= m; } public static int findMinDays(int[] arr, int m, int k) { if (m * k > arr.length) return -1; int left = 1, right = Integer.MAX_VALUE, result = -1; while (left <= right) { int mid = left + (right - left) / 2; if (checkBoquetFormation(arr, m, k, mid)) { result = mid; right = mid - 1; } else { left = mid + 1; } } return result; }
Complexity Analysis:

2. Treasure Hunt in a Sorted Matrix

The problem was to search for a given target in a sorted 2D matrix where:

Example Input:
matrix = [ [1, 4, 7, 11, 15], [2, 5, 8, 12, 19], [3, 6, 9, 16, 22], [10, 13, 14, 17, 24], [18, 21, 23, 26, 30] ] target = 5
Expected Output: true
Approach:
Code Snippet:
public static boolean searchMatrix(int[][] matrix, int target) { int rows = matrix.length, cols = matrix[0].length; int r = 0, c = cols - 1; while (r < rows && c >= 0) { if (matrix[r][c] == target) return true; else if (matrix[r][c] > target) c--; // Move left else r++; // Move down } return false; }
Complexity Analysis:

Performance & Feedback:


My Thoughts:

The problems were well-structured and tested binary search, matrix traversal, and logical thinking. I performed well in solving them but need to refine how I explain my thought process under pressure.