uber logo
Uber· Senior

Node sharing question Uber

Location
San Francisco
Posted
19 Mar 2021
338 reads

Summary

I was asked a challenging node-sharing system design question during my Uber interview for a Senior position in San Francisco, involving the implementation of hardware request and release functions.

How it went

During my interview for a Senior position at Uber in San Francisco, I encountered a practical problem related to managing nodes within a server cluster. The core task involved designing and implementing two primary functions: one to request_hardware and another to release_hardware. I had to consider different node types (T1, T2, T3), ensuring each node was unique and tied to its specific type. The problem specified constraints such as handling zero available nodes and preventing the release of an already free node. A crucial part of the discussion also involved analyzing the time and space complexity of my chosen data structures and algorithm.

Questions asked (1)

  1. 01

    Node Sharing in Server Cluster

    Data Structures & Algorithms

    In a server cluster, there are three different types of nodes, denoted by T1, T2, T3. Each node is unique and limited to one fixed type. The minimum quantity of nodes that can exist in the cluster for each type (T1, T2, T3) is 0 (zero), with no upper limit on availability. Implement the following functions:

    1. request_hardware function:

    • Given a valid requested node type, it looks up the collection of available nodes of that type.
    • Returns one available node of the requested type and sets its state to 'in use'.
    • If there are zero or no available nodes of the requested type, it cannot be requested.

    2. release_hardware function:
    • Given a valid node whose state is 'in use', it releases the node back to the server cluster.
    • Sets the state of the released node as 'free'.
    • If the given node is already set to a state of 'free', it cannot be released.

    Ending question: What is the time/space complexity of the data structure/algorithm?

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Uber recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!