Panda Guru LogoPanda
Guru

D.E. Shaw Interview Experience | SMTS | oct 2024 | Reject

Online Assessment

Questions: 3 questions focusing on Data Structures and Algorithms (DSA). Topics include dynamic programming, graphs, and tree DP.


Round 1: Data Structures and Algorithms (1 hour 15 min)

Questions:

class MyInt(int): def __new__(cls, value): print(f"Creating MyInt({value})") return super().__new__(cls, value) def __eq__(self, other): print("Checking equality") if isinstance(other, MyInt): return super().__eq__(other) and self.real == other.real return False def __hash__(self): print("Calculating hash") return super().__hash__() a = MyInt(10) b = MyInt(10) print(a == b) print(hash(a) == hash(b))
  1. Explain the purpose of each method in MyInt.
  2. What will be the output of the code above?
  3. Modify the MyInt class to make a == b return False and hash(a) == hash(b) return True without modifying any part of the code that follows the class definition.
Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.


Round 2: Data Structures and Concepts

Questions:

def insert_into_24_tree(tree: 'Node', key: int) -> 'Node': """ Inserts a key into a (2,4) tree and returns the new root node. Parameters: tree (Node): The root node of the (2,4) tree. key (int): The key to insert. Returns: Node: The root node of the updated (2,4) tree. """

Discussion:

  1. How does a (2,4) tree handle balancing differently compared to other self-balancing trees like AVL or Red-Black trees?
  2. What would be the impact on performance if a (2,4) tree had larger nodes (e.g., a (3,5) tree)? How would this affect memory usage?
  3. Can you describe how deletion works in a (2,4) tree and what challenges arise compared to insertion?
Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.


Round 3: Technical Round

Questions:

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.


Round 4: Managerial and Technical

Questions:

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.


Round 5: Techno-Managerial

Questions:

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.