Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Build a Custom Hash Set

HardPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Build a Custom Hash Set. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Implement a custom set data structure without using any built-in hash tables, trees, or set libraries. The data structure must support add(value), remove(value), contains(value), size(), and iteration over stored unique integers. Return the final contents of the set in sorted order after applying a sequence of operations.

Constraints

  • 1 <= len(operations) <= 10^4
  • Each operation is one of "add", "remove", or "contains"
  • -10^9 <= value <= 10^9
  • Do not use Python set, dict, or tree-based containers in the implementation

Function Signature

def process_set_operations(operations):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output