1. Secret Santa Algorithm
Implement the classic Secret Santa algorithm. The details of the problem are not provided, but it is a classic question from interviews.
2. Print Out Comments with Indentation
Given a data structure representing comments with fields 'id' and 'parentid', write a function to print out the comments with indentation to reflect the hierarchy. If a comment has been deleted, represent it with a blank line. This is a high-frequency question from onsite interviews.
3. Secret Santa Arrangement with Constraints
In a coding interview, you were asked about arranging a Secret Santa event for a group of people, where you need to decide who gives a gift to whom. The follow-up question involved a scenario where each person has a list of people they do not wish to give a gift to. You need to arrange the gift-giving considering these constraints, and you approached it with a brute force depth-first search (DFS), although the final implementation had bugs.
4. Implement View's findViewById
Implement the 'findViewById' method for a View using both BFS (Breadth-First Search) and DFS (Depth-First Search) algorithms. Compare the pros and cons of using each approach.
5. URL Sensitive Data Encryption
Given a URL containing sensitive data, encrypt the sensitive parts. For example, given the input URL 'https://example.com/pathofurl?fi ... e&api_key=abcde' and keys of sensitive data such as 'access_token', 'id_token', 'api_key', 'username', 'password', provide an output URL where these sensitive data values are replaced with asterisks and the length of the original value is indicated. For instance, 'https://example.com/pathofurl?fi ... e&access_token=****(length: 6)****&last_name=mylastname&api_key=****(length: 5)****'.