Questions:
1. You have been given 2 special, extremely rugged Xboxes. You are in an office building that is 120 stories high. Using the fewest possible number of drops from windows in your office building, determine the highest floor you can drop an Xbox from and have it survive: for example, they might be able to take the drop from the 30th floor, but not the 31st. You can break both Xboxes in your search. State the worst case number of drops needed and explain how you arrived at that answer.
2. You have a very popular mobile game that supports a variety of multiplayer modes. To help players decide which game mode to play, the game will perform two API operations:
1. The game will report in which region and mode it is being played.
2. The game will query the current most popular game modes for the region in which the player is located.
To standardize the lookup of regions, the game will use 2 letter country codes (ISO 3166) to represent a region.
Your task is to design RESTful web service to support this functionality which will easily scale to millions of concurrent users. Your design should include, but is not limited to:
• A REST API specification (end points, input parameters, and output)
• A service layer design
• A persistence layer design (at a minimum should contain class diagram and how the data is being persisted)
• An explanation of how your design will scale to handle millions of concurrent users
Note: Please respond using Java. We're looking for a detailed, high level design (including the class diagram). We're not looking for actual implementation.
3. Write a function that, given a matrix of integers, builds a string with the entries of that matrix appended in clockwise order. For instance, the 3x4 matrix below:
2, 3, 4, 8
5, 7, 9, 12
1, 0, 6, 10
would make the string “2, 3, 4, 8, 12, 10, 6, 0, 1, 5, 7, 9”.
a) Given your solution, how would you verify the correctness?
4. Write the code for the following function, without using any built-in functions.
String itoa(int value, int base);
Where value is the integer to convert, and base is octal, decimal, or hex.