📌 Question 1: Infinite Rotation
Problem Description:
Determine whether multiple points moving in 2D space will eventually meet at a single location.
Each point moves at a constant speed. The iᵗʰ point always moves in the direction of the (i+1)ᵗʰ point, and the last point moves toward the first point. As points move, their direction continuously adjusts to keep following their target point.
Example:
locations = [[0, 0], [1, 0], [1, 1], [0, 1]]
Each point starts moving toward the next point in the circular array:
- Point at [0, 0] moves toward Point at [1, 0]
- Point at [1, 0] moves toward Point at [1, 1]
- Point at [1, 1] moves toward Point at [0, 1]
- Point at [0, 1] moves toward Point at [0, 0]
As the points move, their paths follow curves because their targets are also moving. The points will eventually meet at [1, 1], so return True.
Function Description:
Complete the function canMeet in the editor with the following parameters:
canMeet(locations:List[List[int]]) -> bool
- locations: 2D list of coordinates representing the positions of points.
Returns:
boolean:Trueif all points will meet, orFalseif they do not meet.
Constraints:
- Coordinates are given in order.
Sample Input Format for Custom Testing:
1 # number of queries
4 # locations size = n = 4
1 1
-1 1
-1 -1
1 -1 # locations = [[1,1], [-1,1], [-1,-1], [1,-1]]
Sample Output:
[True]
Explanation:
All the points meet at 0, 0.

📌 Question 2: Python: Book Popularity Tracker
Problem Description:
Implement a Python application for managing a bookstore’s inventory. The application should allow adding books, finding highest-rated books, and recommending books by genre.
There are two classes:
Bookclass with attributes:title(string): the book’s titlegenre(string): the book’s genrerating(float): the customer rating
LibraryManagementclass with methods:add_book(Book book): adds a new book to the inventoryget_highest_rated_books(int x): returns the x highest-rated books, sorted by rating (descending) and title (descending) for ties.recommend_top_book_by_genre(string genre): returns the highest-rated book in the specified genre, orNoneif no books exist in that genre.
Constraints:
- The number of recommended books is less than or equal to the number of books in the book list.
Sample Input for Custom Testing:
3
Python Programming,Programming,4.5
Data Science Essentials,Data Science,3.1
C++ Programming,Programming,4.3
1
Programming
Sample Output:
Highest Rated Book: Python Programming, Rating: 4.5
Top Recommended Book in Programming Genre: Python Programming, Rating: 4.5
Explanation:
Here the number of recommended books is 1. The specified genre is “Programming”.

我们长期稳定承接各大科技公司如Visa、TikTok、Google、Amazon等的OA笔试代写服务,确保满分通过。如有需求,请随时联系我们。
We consistently provide professional online assessment services for major tech companies like TikTok, Google, and Amazon, guaranteeing perfect scores. Feel free to contact us if you're interested.

