Tripadvisor Interview Questions
Showing 6 questions
Find the common characters that appear in all strings within a given array of strings. Return these common characters as a list.
#1. Find Common Characters
Determine if a string containing parentheses is valid. A valid string has matching and properly nested opening and closing parentheses.
#2. Valid Parentheses
Design a data structure that acts as a Least Recently Used (LRU) cache. Implement methods to get and put key-value pairs, evicting the least recently used entry when the cache is full.
#3. LRU Cache
You're given daily stock prices. Find the maximum profit you can make by buying and selling the stock once. You must buy before you sell.
#4. Best Time to Buy and Sell Stock
Find two numbers in a given array that add up to a specific target value, and return their indices. Essentially, you need to efficiently locate the pair that satisfies the sum requirement.
#5. Two Sum
Determine if you can construct a ransom note from the letters in a magazine. Each letter in the magazine can only be used once.
#6. Ransom Note