Tuesday, January 12, 2016

Amazon written test questions for experienced


Q1)

Problem: Write a methods which accepts the start pointer of single linked-list of integers and returns true if it is a palindrome and false otherwise. 
Condition: Solve the problem by using constant space only . 

Example:

1->2->3->4->5 output: false
1->2->1 output: true
1->1 output: true

Q2)

Given  a Boolean 2D array, where each row is sorted, find the row with the maximum number of 1s

Example:

Input  matrix
0 1 1 1
0 0 1 1
1 1 1 1  // this row has maximum 1s
0 0 0 0 

Output: 2

Q3) 

For example: 1. C*KS matches COOKS
2. AM?Z?N* matches AMAZONINTERVIEW [Note * in the end]
3. AM?Z*N DOES NOT MATCH AMAZING.





No comments:

Post a Comment