Status: MS CS at the University of Campinas and Software Developer at SAP
Position: Software Developer full time
Location: São Leopoldo, Brazil
I only show what I think was the most challenging question on my onsite interview because the others were similar to those I saw in this and other sources.
Question:
Given an array V and an integer k. V is filled with 0s and 1s wich represent non-working and working days respectively. Find the largest sub-array that contain at most k working days. Write a function that return the size of the previous sub-array. O(n) expected time complexity.
Variation of https://leetcode.com/problems/max-consecutive-ones-iii
Example 1:
input
V = [0,0,1,0,1,1,0,1] ; k = 2
output
5 // start at index 0 and end at 4 -> [0,0,1,0,1]
Example 2:
input:
V= [0,0,1,0,0,0,0] ; k = 5
output:
7 // the whole array
Example 3:
Input:
V = [1,1,1,1,1,1,1] ; k = 2
output:
2 // any sub-array of length 2Experience
It was a unique and incredible experience. LeetCode helped me so much to improve my abstraction and problem solve skills. In my opinion I think that technical questions went well. I solved them, optimized and explain. However, not everything is perfect, I think that the behavior interview did not go well, and my English skill was not enought to explaint my ideas and way of think. Any way, I learned a lot of this experience and I am so motivated for the next opportunities that come my way.
Let's continue practicing in LeetCode!!! :)