← Reddit Interview Insights

Reddit·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Reddit SWE interview with a logic-based admin permissions question. Pretty focused, just the one problem from what I can tell.

Questions Asked (1)

Q1

Given two admin usernames, write a function that determines whether the first admin can delete the second. The rule is based on which admin was added to the system first. Return a boolean.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Seems straightforward but the interesting part is figuring out how you're supposed to know who was added first.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the data model: admins have an 'added timestamp' or sequence number. The function should compare the two admins' addition times and return true if the first admin was added earlier than the second. If timestamps are equal, define a tie-breaker (e.g., lexicographic order of usernames) and document it.

Pro tip: Mention that in a real system, you'd likely store admin records in a map or database and query by username, so the function should handle missing admins gracefully (e.g., return false or throw an error). Also, discuss whether the rule is transitive and if it could be simplified to a comparison of sequence numbers.

1. Clarify requirements and assumptions

Ask if the admin list is available, how 'added first' is determined (timestamp, insertion order, ID), and what to do if an admin doesn't exist or timestamps are equal.

2. Define the comparison logic

Explain that you'll compare the two admins' addition times (or sequence numbers) and return true if the first admin's time is earlier than the second's.

3. Handle edge cases

Discuss what happens if either admin is not found, if timestamps are equal, or if the input is invalid. Propose a tie-breaker or error handling.

4. Write the function

Sketch pseudocode or actual code: retrieve both admin records, compare their addition times, and return the boolean result.

5. Analyze complexity and trade-offs

Mention time and space complexity (e.g., O(1) if records are in a hash map, O(n) if scanning a list) and discuss alternative data structures for efficiency.

Key Points to Mention

  • Data structure choice: hash map for O(1) lookup of admin records by username.
  • Comparison based on a monotonic sequence number or timestamp to determine order.
  • Edge cases: missing admins, equal timestamps, and invalid inputs.
  • Tie-breaking strategy if timestamps are equal (e.g., lexicographic order).
  • Time and space complexity of the solution.
  • Potential concurrency issues if admins can be added simultaneously.

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