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:
- DSA Problem 1: Find all the articulation points in a graph.
- DSA Problem 2: Partition an array into two subsets such that the absolute difference between the sums of the subsets is minimized.
- DSA Problem 3:
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))
- Explain the purpose of each method in MyInt.
- What will be the output of the code above?
- Modify the MyInt class to make
a == b
return False andhash(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:
- DSA Problem 1: What is Best-First Search? Questions on its properties and applications.
- DSA Problem 2: What are the key properties of a (2,4) tree, and how do these properties impact the efficiency of search and insertion operations?
- Follow-up Question: Write a function that inserts a key into a (2,4) tree, performing node splits and necessary rebalancing.
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:
- How does a (2,4) tree handle balancing differently compared to other self-balancing trees like AVL or Red-Black trees?
- 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?
- 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:
- Algorithmic Proof: Prove the correctness of your implementation of a merge sort that minimizes the number of inversions. Discuss the invariant maintained at each recursive level of the algorithm.
- Python Application: Write Python code to manage a priority queue efficiently, implementing insertions and extractions in O(log n) time.
- Discussion:
- How would you handle thread safety when accessing a shared priority queue in Python, considering the Global Interpreter Lock (GIL)?
- How does reference counting in CPython impact multi-threaded programs, and what alternatives would you suggest for high concurrency?
- Discuss the difference between eager and lazy evaluation in Python.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 4: Managerial and Technical
Questions:
- Behavioral Question: Describe a time when you had to manage multiple conflicting deadlines in a high-stakes project. How did you ensure successful delivery?
- Brain Teaser: Imagine you're in a room with 100 doors, each numbered from 1 to 100. You toggle the state of doors following a pattern: first toggle every door, then every second door, every third door, and so on, until the 100th door. After completing the toggling process, how many doors will remain open?
- Scenario-based Question: You’re leading a cross-functional team that is facing resistance to a new technology stack being introduced. How would you manage the transition and align team members with different perspectives?
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 5: Techno-Managerial
Questions:
- Market Volatility: Explain how you would leverage implied volatility in a financial trading strategy to hedge against market risks. How do you model market sentiment when making risk management decisions?
- You’re building an API that supports both RSQL and GraphQL queries for a financial system. The API needs to handle nested filters, custom exception handling, and maintain query efficiency. How would you manage errors from deeply nested queries or malformed RSQL filters while providing clear error messages to users? Address edge cases like circular dependencies and unexpected inputs.
- Behavioral Question: When did you demonstrate academic excellence in your work? Why do you believe academic excellence and ethics are essential, not just for an organization but for your own personal and professional growth?
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.