Role: SDE Intern
Location: Pune
Stipend: 35K/month
Interview Duration: 1 hour
I had a single technical interview where I was asked two problems:
Given:
speed[] arrayefficiency[] arrayK = maximum team sizePerformance formula:
Performance = (sum of speeds in the team) × (minimum efficiency in the team)
Examples:
code```
My Approach:
K speedsO(n log n)Code (similar logic):
#include <bits/stdc++.h>
using namespace std;
int maxPerformance(vector<int>& speed, vector<int>& efficiency, int k) {
int n = speed.size();
vector<pair<int,int>> emp;
for (int i = 0; i < n; i++) {
emp.push_back({efficiency[i], speed[i]});
}
sort(emp.rbegin(), emp.rend());
priority_queue<int, vector<int>, greater<int>> minHeap;
long long sumSpeeds = 0, maxPerf = 0;
for (auto &e : emp) {
int eff = e.first;
int spd = e.second;
minHeap.push(spd);
sumSpeeds += spd;
if (minHeap.size() > k) {
sumSpeeds -= minHeap.top();
minHeap.pop();
}
maxPerf = max(maxPerf, sumSpeeds * 1LL * eff);
}
return (int)maxPerf;
}
Q2. Longest Increasing Subsequence (LIS)
https://leetcode.com/problems/longest-increasing-subsequence/description/
class Solution {
public:
int lengthOfLIS(vector<int>& nums) {
int n = nums.size();
vector<int> dp(n, 1);
for (int i = 1; i < n; i++) {
for (int j = 0; j < i; j++) {
if (nums[i] > nums[j])
dp[i] = max(dp[i], 1 + dp[j]);
}
}
int ans = INT_MIN;
for (int i = 0; i < n; i++) ans = max(ans, dp[i]);
return ans;
}
};
After the Interview
A week later, they asked if I wanted to join .
By then, I had secured an offer from BrowserStack, which I felt had better work culture and reputation.
So, I politely declined to proceed further.