Solve substring and access-log problems
Company: Sumologic
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Onsite
The interview included the following coding tasks:
1. **Longest uniform substring after limited changes**
Given a string `s` consisting of uppercase English letters and an integer `k`, you may replace at most `k` characters with any uppercase letter. Return the maximum length of a contiguous substring that can be transformed into a string of identical characters after at most `k` replacements.
2. **Detect cross-day URL changes for the same user**
You are given two web access logs, one for each day. Each log is a list of records in the form `(user_id, url)`. Determine whether there exists at least one user who appears in both days and has visited different URLs across the two days. If a user appears multiple times in a day, consider all URLs they visited on that day. Return `true` if such a user exists; otherwise return `false`.
Quick Answer: This question evaluates proficiency in string algorithms, frequency analysis, and set/hash-based data processing by testing substring transformation under constrained edits and cross-day URL comparison for users.