Tech Architect interview questions – page 5
1,161 questions. Tap “Show answer” to check yourself.
-
Given a sorted array arr[] and a number a, count the no. of occurences of x in arr[]. Logn solution expected.
-
More on Hash tables, Chaining, Modulus, and Linked Hashing.
-
You have 1000 names in random order and i ask you to pick any name of my choice randomly and then give me complete info of that person so what data structure yuo will use to store person info?
-
Initially next_larger of every node is point to NULL. now write a c code which set all node's next_larger pointer. where next_largest point ...
-
An array of integers. The sum of the array is known not to overflow an integer. Compute the sum. What if we know that integers are in 2's complement form?
-
In the given linked list, odd numbered nodes are in increasing order and even numbered nodes are in decreasing order. How it can be sorted in increasing order?
-
Given a very large file (millions of record), find the 10 largest numbers from it.
-
Check for duplicates in an unsorted array in O(n) without using any extra space
-
Design a data structure that can be used instead of an array and avoids the "high-cost" (i.e. O(n)) of initializing the array. the data structure ought to holds n items and supports the following operations in O(1) time: * Init Initializ...
-
Given a text file, implement a solution to find out if a pattern similar to wild cards can be detected. For example, find if a*b*cd*, or *win or *def* exists in the text.
-
How will you raise a n x n matrix to the power k efficiently. What's the time complexity and space complexity of you algorithm? How will you optimize this?
-
In a game, you bet using the following strategy. Whenever you lose a bet, you double the value of the bet for the next round. Whenever you win, the bet for the next round will be one dollar.
- Advertisement
-
There is a file system on the disc. the disc has many sectors. Always the first sector has the information about all the files.
-
Print all the paths from root to leaf nodes of binary tree depth of the tree is provided
-
Print permutations of a given string in sorted order
-
Suggest a data structure for finding median of a set. The data structure should also support efficient insertion and deletion.
-
Maximum Sum of Sub Array in an Array.
-
Given an array of n elements and a number x, find if there exist 3 elements in the array whose sum is equal to x. Do it in O(nLogn) time complexity
-
You have given an array having alternative positive and negative number . you have to find out the longest subsequece having maximum sum.in the complexity o(n).
-
There is a parking lot with n slots.. and n-1 cars with 1 free slot. given an initial arrangement of cars how will u arrive at a desired arrangement E.g say n = 5 .initial..{free, 1, 3, 4, 2} ..required ..{1, free, 2, 4, 3}.. the numbe...
-
Suggest a data structure and algo to implement T9 dictionaries. Your solution should be optimized for adding a new word.
-
Given an array such that the array will be sorted if we sort the elements between two indicies i an j. Find i and j for such an array such that abs(i-j) is minimum.
-
Given a snapshot of an ongoing chess game, which probably is a one vs many game, identify whether it is a valid game or not.
-
You are given a Linklist, you have to rotate it in order 3.
- Advertisement
-
You have two arrays A and B of strings. In the array B all element are from A except one. ex: A = {"abc", "bcd", "dpr"}; B = {"abc", "mnp", "bcd", "dpr"}; You have find out the string which is extra in B in O(n) time. In the abov...
-
Given an array of integers..... Imagine it as a pyramid as below:
-
U r given an integer array of size n, filled with numbers 1 to n randomly. Each number occurs exactly once. Two of them are replaced by 0(zero). Find out those numbers in O(n) time.
-
Function to display the directory structure in a user friendly way taking root dir as arg for a general OS. You may assume and state some basic APIs available in that OS
-
What data structure would you use to store distances between all the planets in a galaxy. (So there could be like a billion planets)
-
Giving a Grid in 2D array like this where each cell has a cost from 1-9