Given an N-ary Tree, Serialize and Deserialize it. Serialization is a basically a representation of a tree in a String format which takes much lesser space than storing the tree itself. Deserialization is constructing the actual tree using the serialized format of the tree.
SDE II Amazon
Bengaluru, Karnataka, India
In an alien language, surprisingly they also use english lowercase letters, but possibly in a different order. The order of the alphabet is some permutation of lowercase letters.
Write a merge function that takes two lists, each of which is sorted in increasing order, and merges the two together into one list which is in increasing order.
Given a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral order.
Given an m x n matrix, return all elements of the matrix in spiral order. The Spiral Matrix problem takes a 2-Dimensional array of N-rows and M-columns as an input, and prints the elements of this matrix in spiral order.
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.
In number theory, a happy number is a number which eventually reaches 1 when replaced by the sum of the square of each digit.
You are given two integer arrays nums1 and nums2 both of unique elements, where nums1 is a subset of nums2. Find all the next greater numbers for nums1’s elements in the corresponding places of nums2. The Next Greater Number of a number x in nums1 is the first greater number to its right in nums2. If it does not exist, return -1 for this number.
You are given a sorted array consisting of only integers where every element appears exactly twice, except for one element which appears exactly once. Find this single element that appears only once.
Write an efficient algorithm that searches for a target value in an m x n integer matrix.