Round 1
Questions:
Find maximum length of a substring of a string with first character lexicographically smaller than its last character.
Assume string length 10^5 characters long, assume 26 lowercase English letters in string.
Solve it in linear time.
Input: "dbabcb"
Output: 4
Candidate's Approach
The candidate approached the problem by iterating through the string while maintaining a record of the first character and checking against the last character of the substring. They utilized a two-pointer technique to efficiently find the maximum length of valid substrings that meet the criteria.
Interviewer's Feedback
The interviewer appreciated the candidate's use of the two-pointer technique and their understanding of linear time complexity. They suggested exploring edge cases and ensuring the solution handles the maximum input size efficiently.