NetApp Interview Questions
Showing 14 questions
Given an array, rearrange it so that all zeros are moved to the end while maintaining the relative order of the non-zero elements.
#1. Move Zeroes
Given a sorted array, find the first and last position of a given target value. If the target is not found, return [-1, -1].
#2. Find First and Last Position of Element in Sorted Array
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 are given a sorted list of words from an alien language and need to deduce the order of the letters in that language. Determine the alien alphabet order based on the given word sequence.
#4. Alien Dictionary
Implement a basic calculator to evaluate a simple expression string. The expression can contain non-negative integers, '+', '-', '*', '/' operators, and spaces; integer division should truncate toward zero.
#5. Basic Calculator II
You are given the head of a singly linked list. Reverse the list and return the new head.
#6. Reverse Linked List
You're given a string containing scrambled English representations of digits (zero to nine). Reconstruct and return the digits in ascending order based on the input string.
#7. Reconstruct Original Digits from English
Given a list of words, group together all the anagrams. Anagrams are words that contain the same letters rearranged.
#8. Group Anagrams
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.
#9. Two Sum
Traverse a given matrix in a spiral pattern, returning all elements in the order you visit them. Essentially, walk around the matrix layer by layer, adding elements to a list.
#10. Spiral Matrix
Find the number of paths in a binary tree that sum up to a given target value. The paths don't need to start from the root or end at a leaf, but must go downwards.
#11. Path Sum III
You are given k sorted lists. Combine all of their elements into a single sorted list and return it.
#12. Merge k Sorted Lists
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.
#13. Best Time to Buy and Sell Stock
Given a string of digits, find the number of ways to decode it as a sequence of letters based on a simple mapping. Each digit can represent a letter, and pairs of digits can also represent a letter.
#14. Decode Ways