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

Pure Storage计算机科学面试真题

职位分类
全部
数据相关
计算机科学
人工智能
产品经理
BQ
面试题
全部(9)
OOD(1)
Algorithm(4)
System Design(2)
高频题(0)
Math(0)
全部(9)
OOD(1)
Algorithm(4)
System Design(2)
高频题(0)
Math(0)
1.Implement an O(1) Set with a clear() method
2.Implement the set_bits function
3.Implement the clear_bits function
4.Identify Bugs in Binary Search Code
5.Calculate Maximum Palindrome Count from a String
6.Implement a Stack-based Thread Manager
7.Minimum Bytes to Represent Page Data
8.Calculate Time to Fill Hard Drives
9.Evaluate a C++ function with thread locks
1. Implement an O(1) Set with a clear() method
Design a data structure that supports all the following operations in average O(1) time: insert, remove, contains, and clear. The clear operation should also be O(1), and it should reset the set so that it contains no elements. Discuss how you would implement this data structure, and explain how the clear operation can be made O(1).
2. Implement the set_bits function
Following up on the clear_bits function, implement a function set_bits(start: int, length: int) that flips bits to 1 instead of 0. The method is similar, but when determining the range of the parent, consider the head and tail bits. Describe how you would modify the clear_bits function to implement set_bits.
3. Implement the clear_bits function
Implement a function clear_bits(start: int, length: int) that flips bits from the start index to the specified length to 0, and also flips all the parents. A parent is 1 if and only if both children are 1. The bits are represented in a full binary tree structure.
4. Identify Bugs in Binary Search Code
Review the provided binary search code and check for potential bugs. If any are found, provide a corner case input that would cause the bug to manifest.
5. Calculate Maximum Palindrome Count from a String
Given a string, calculate the maximum number of palindromes that can be constructed. Use a set to count the number of each palindrome, starting from the center and expanding outwards to check if it is a palindrome.