Interview questions · Palo Alto Networks
Implement three whiteboard coding tasks
This set of whiteboard coding tasks evaluates proficiency in algorithmic problem-solving, data structure design, and parsing techniques by covering binary search, randomized set operations with average O(1) complexity, and operator-precedence expression evaluation including nested parentheses.
The interview report described several coding questions in the same category:
-
Binary search: Given a sorted array of integers and a target value, return the index of the target if it exists, otherwise return
-1. The expected time complexity isO(log n). -
Randomized set data structure: Design a data structure that supports the following operations in average
O(1)time:insert(x): addxif it is not already presentremove(x): deletexif it is presentgetRandom(): return a uniformly random element from the current set
-
Expression evaluator: Given a string containing non-negative integers, spaces, and the operators
+,-,*, and/, evaluate the expression while respecting normal operator precedence. As a follow-up, extend the evaluator to support nested parentheses.
Community answers
Nothing here yet.
Join in on CSWork →