← 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. Just the one problem, nothing too crazy on the surface, but the edge cases kept me second-guessing myself.

Questions Asked (1)

Q1

You're given two lists of web page visits, each representing one day's activity. Write a solution to find whether any user appears in both lists but visited a different URL on each day.

Algorithms & Data Structures
Author's notes

Looked straightforward until I started thinking about what 'different URL' actually means per user across both lists.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem: each list contains (user, URL) pairs for a day; find users present in both lists with different URLs. Use a hash map to store user→URL from the first list, then iterate the second list to check for matching users with different URLs, collecting results. Discuss time/space complexity and edge cases like duplicate entries.

Pro tip: Mention that if a user appears multiple times in a day, you need to decide how to handle it—e.g., consider all visits or just the first/last. This shows attention to real-world data ambiguity and can lead to a more robust solution.

1. Clarify the problem

Confirm the input format: each list contains (user, URL) pairs. Ask if a user can appear multiple times in a day and how to handle that. Define output: list of users or count.

2. Choose data structures

Use a hash map (dictionary) to map user to URL from the first list. This allows O(1) average lookup when processing the second list.

3. Process first list

Iterate through the first list and populate the hash map. If duplicates exist, decide on a rule (e.g., keep first, last, or store a set of URLs).

4. Process second list and compare

Iterate through the second list. For each (user, URL), check if the user exists in the map and if the URL differs. If so, add the user to the result set.

5. Analyze complexity and edge cases

State time complexity O(n+m) and space O(n). Discuss edge cases: empty lists, no common users, same URL, duplicate users, and large data.

Key Points to Mention

  • Hash map for O(1) lookups to achieve linear time complexity
  • Handling duplicate users within a single day (e.g., using a set of URLs per user)
  • Time and space complexity analysis: O(n+m) time, O(n) space
  • Edge cases: empty lists, no matches, all matches with same URL, duplicate entries
  • Using a set for results to avoid duplicates if multiple URL differences exist
  • Scalability considerations for large datasets (e.g., memory usage, streaming approach)

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