← Sumo Logic Interview Insights

Sumo Logic·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Got a coding question at Sumo Logic for a software engineer role. Pretty focused problem, nothing drawn out, just the one question as far as I can tell.

Questions Asked (1)

Q1

You're given two lists of web page visits, one per day. Each entry has a user and a URL they visited. Find any user who shows up in both lists but visited a different URL on each day.

Algorithms & Data Structures
Author's notes

My first instinct was to just nest two loops and call it done, but I caught myself and switched to a hash map approach.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem constraints and edge cases first, then propose an efficient solution using hash maps to track each user's visited URLs per day. Compare the sets of URLs for users present in both days to identify those with different visits.

Pro tip: Discuss trade-offs between time and space complexity, and mention how to handle multiple visits per user per day (e.g., using sets or lists) to show thoroughness.

1. Clarify Requirements

Ask about input format, whether a user can have multiple visits per day, and what 'different URL' means (e.g., any difference vs. completely disjoint sets).

2. Choose Data Structures

Use a hash map to map each user to the set of URLs they visited on day 1, and similarly for day 2. Sets allow O(1) lookups and handle duplicates.

3. Find Common Users

Iterate through the keys of one map and check for presence in the other map to identify users who appear in both days.

4. Compare URLs

For each common user, compare their URL sets from day 1 and day 2. If the sets are not equal, the user visited a different URL on each day.

5. Return Results

Collect and return the list of users meeting the condition, ensuring the output format matches expectations.

Key Points to Mention

  • Time complexity: O(N + M) where N and M are the number of visits per day, assuming hash map operations are O(1).
  • Space complexity: O(U * V) where U is the number of unique users and V is the average number of unique URLs per user.
  • Handling multiple visits per user per day: use sets to deduplicate URLs, or lists if order matters.
  • Edge cases: empty lists, users with no visits on one day, users with identical URL sets.
  • Alternative approaches: sorting and two-pointer technique if memory is constrained, but hash maps are generally more efficient.
  • Definition of 'different URL': clarify if it means any difference in the set of URLs or just that the user visited at least one different URL.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.