<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KVGHS6G" height="0" width="0" style="display:none;visibility:hidden"></iframe>

Nextdoor计算机科学面试真题

职位分类
全部
数据相关
计算机科学
人工智能
产品经理
BQ
面试题
全部(16)
OOD(1)
Algorithm(8)
System Design(4)
高频题(0)
Math(0)
全部(16)
OOD(1)
Algorithm(8)
System Design(4)
高频题(0)
Math(0)
1.Secret Santa Algorithm
2.Print Out Comments with Indentation
3.Secret Santa Arrangement with Constraints
4.Implement View's findViewById
5.URL Sensitive Data Encryption
6.Design a common component for HTTP calls
7.Extend the simulated database with transaction commands
8.Implement a simulated database with specific commands
9.Release Version Comparison
10.In-Memory Database Implementation
11.Design Nextdoor's Posting and Feed System
12.Print Comments in a Hierarchical Structure
13.Print Comment Tree
14.Implement findViewById
15.Print Comment Tree
16.Feed Object List Sorting and Grouping
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)****'.