queue implementation in python using list
Your Assignment: Build a queue management class that has the following methods:
- add – gets a userId as a parameter. Returns the position it got in the queue.
- removeByUser – gets a userId as a parameter. Removes the user from the queue.
- removeByPosition – gets a position as a parameter (starting from 1). Removes the user at that position.
- move – gets a fromPosition and toPosition as parameters. Moves the user to the new position.
- swap – gets position1 and position2 as parameters. Swaps the users between the positions.
- reverse – reverses the order of the queue: whoever was last is now first.
- print – prints to stdout the queue in correct order in the following format {position}:{userId} Notes: • ● Please start with a basic working implementation and then extend. • ● At the end of 2 hours (or earlier), please email back your deliverables, including test output, based on the sample file. • ● If anything in the question is unclear, make assumptions, write them down as comments in the code and continue. • ● Please write everything from scratch, using only standard objects such as Scalars, Arrays, Hashes, Maps etc. Do not use any frameworks, built in language Queue classes or other reference code from the web.