After applying for a position of SDE 2 on microsoft career page. Got a call for 28th Nov hiring drive.
R1 : Intervier was SDE-2 with 4 Yoe
Given BST, return true if two element exists s.t their sum is k
My approach: Inorder Traversal + Two pointer
Time : O(n)
Space: O(n)
Expected : BST Iterator
Time : O(n)
Space: O(h)
Given a string s consisting of uppercase English letters (A–Z), and an integer k, return the length of the longest substring that can be transformed into a substring containing only one distinct character by changing at most k characters.
(424. Longest Repeating Character Replacement)
My approach : Was not able to code it fully, after receiving hints, gave the sliding window solution
Os fundamentals
R2: Intervier was SDE-2 with 9 Yoe
Question on Resume,
LeetCode 1309 – Decrypt String from Alphabet to Integer Mapping
Fumbled up big time!
You are given an array profits[] of size n where:
profits[i] > 0 → month had profit
profits[i] < 0 → month had loss
Find the maximum possible sum of a contiguous subarray whose length is ≤ k.
Even after hints, I was not able to come up with correct solution!