Stripe Interview Question: Create a ServerManager class ... | Glassdoor

Interview Question

Software Development Interview(Student Candidate)

Create a ServerManager class with the functions

  allocate(string) and deallocate(string) to the following specifications: allocate('apibox') = 'apibox1' allocate('apibox') = 'apibox2' allocate('sitebox') = 'sitebox1' allocate('apibox') = 'apibox3' deallocate('apibox2') allocate('apibox') = 'apibox2'
Answer

Interview Answer

2 Answers

0

Use a map> where the key is the string you are allocating, and the value if a vector of allocations of that string. O(1) for insertion in all cases, O(1) for reading/deleting

Anonymous on Sep 18, 2017
0

I think the key in generic questions like this is to be careful to cover the fundamentals, and to be familiar with all the followups so you're prepared for whatever they throw at you. Maybe do a mock interview with one of the Stripe Software Developer experts on PrepTick to get a real-world answer? They give lots of guidance and pro tips on how to deal with this kind of stuff. https://www.preptick.com/practice-interviews-swe

Anonymous on Jan 16, 2020

Add Answers or Comments

To comment on this, Sign In or Sign Up.