Interview questions
Software Developer interview questions – page 29
945 questions. Tap “Show answer” to check yourself.
-
Given a binary tree, build a doubly linked list for the leaves of the tree in the given order without using any extra space
-
How to make a file mutually exclusive on a shared file system
-
Advantages and disadvantages of amazon.com
-
Why are you leaving your company so early
-
Discussion about project in company and about my college projects as well(It was a deep discussion and I think it can throw us out if we donÂ't give proper answers)
-
Replace each node in BST with sum of its greater nodes. I solved it quite easily after that he applied various constraints on it(around 3 or 4). So the problem became quite hard. But after thinking about it solved it. He was happy after the solutions provided by me
-
After that he discussed about n-ary tree and getting the LCA in n-ary tree of n nodes.(Wrote the code for it and discussed complexity)
-
Frog can jump 1 or 2 steps write the code to find out number of ways to go up to n steps. Discussed the complexity of it with mathematical proof
-
There is a dictionary of billion words and there is one method provided String getWord(int index); We can give it index and it will return the String on that index . Now word is given to us we have to find out its index. O(logn) solution was required
-
After that he moved to Oops concepts asked about abstract classes and interfaces. Also asked when to use interfaces .After that we had discussion on volatile keyword(Asked for program which can show its behavior ) and synchronization
-
He told me if there is a class and if we want to use only 3 methods of it so in that case we should use inheritance or not. Asked for other better options
-
Given array of stock prices get the date of selling and buying so that profit is maximum
-
Given two array , one of size m+n and contains m element and other position are empty , 2nd array is of size n and contains n element. both array are sorted , now merge the second array to first one such that the resultant array is sorted. Expexte time complexity(m+n)
-
Given Two sorted array of size size n each. Find the Kth largest element in these two array (Expected Time Complexity Log(n))
-
Given a Linked list , print yes if it is palindrome else print no
-
Print the level order traversal of the binary tree in the spiral form
-
Maximum of all subarrays of size k(Expected Time Complexity O(N). Input : arr[] = {1, 2, 3, 1, 4, 5, 2, 3, 6} k = 3 Output : 3 3 4 5 5 5 6
-
Given a Binary Tree, if it is a BST or not
-
A stream of numbers are coming and I have to keep track of the kth largest number in it
-
Given an Infix expression, how to evaluate its answer
-
Given 2 integers a and b, the sequence which will be formed is a, b, a+b, a+2bÂ…. i.e Current element = sum of the previous 2 elements. So now given a number k, how to figure out if it lies in the sequence or not
-
Continuation was when more than 1 'n' occur together
-
There is a big file containing numbers and we have to sort all of them
-
How to implement word suggestions like that in Eclipse
-
A String was given and I have to swap word by word from the beginning to the end
-
Minimum number of squares whose sum equals to given number n.
-
Insertion sort for a singly linked list.
-
Search an element in sorted rotated array.
-
What are the different types of hashing? Suggest an alternative and a better way for Linear Chaining.
-
Given a BST containing distinct integers, and a number 'X', find all pairs of integers in the BST whose sum is equal to 'X'.