Cisco - 8+years of exp
Ques: Given an array of n whole numbers, move zeros to right
Approach 1: swap non zero entries with elements at last
Added constraint not to change array ordering
Approach 2: keep two pointers, take a count of zero elements, swap non zero
entries in increasing order of index and fill zeroes at last
Asked about time complexity - came up with O(n)
Struggles with converting thoughts to code
Ques 2: Two linked list with common elements at the end. Tell me the common
starting node.
Able to come up with approach
– Misses edge cases while converting solution to code
– Can't complete a function with all cases