Interview questions
Team Lead/ Tech Lead interview questions – page 4
3,203 questions. Tap “Show answer” to check yourself.
-
Given an array of 50 integers a[50], if one of them a[i] is corrupted and converts to '0' then can you find the original value of the integer ?
-
You have a digital clock having 24 hr format of HH:MM:SS. You have to find following probabilities: 1- Occurence of a particular value(let say 05) in SS 2- As 1st point we have to find probabilities for particular value in hour and min...
-
Swap two variables without using third variable. Do it with different techniques and compare them.
-
Given a polygon and a point, how would you find out whether the point is inside the polygon or not.
-
If pairwise sums of 'n' numbers are given in non-decreasing order identify the individual numbers. If the sum is corrupted print -1 Example: i/p: 4 4 5 7 10 12 13
-
Given a positive integer N, arrange the integers 1 to N such the position of the average of two numbers (if present) falls outside the two numbers. For example, for a[i] and a[j], if b = (a[i] + a[j])/2, then if a[k] = b, k < i or k > j.<br ...>
-
Print the 100th power of a single digit( which is of type int). How do you maintain that big number in memory?
-
How to get the cell value on which we click on Data Grid and how can we high light the clicked area of data grid with some color? For example in Datagrid1 emp details records(empid,empname,empsal...) are displayed if we click on one record how to get tha
-
Given a set of points in a plane. Write a function to check if there exists a vertical line of symmetry in this plane.
-
You have an array of X elements. You have to find a subset of three elements such that their sum is upto a value Y. Try to do it in O(nlogn)
-
Find the longest common subsequence of given N strings each having length between 0 to M. Can anybody give a good approach to the solutions
-
Given a file, write a function that prints all phone numbers in the file.
-
Explain the difference between overloading and overriding?
-
There are N people in a room and one of them is a celebrity. Everybody knows at least the celebrity while the celebrity knows no one. You enter the room to find the celebrity. You are only allowed to pick a person, point to another person, and ask...
-
You have to develop a piece of code that can be attached to a program like Microsoft Word, which would list the last "N" words of the document in descending order of their occurrence, and update the list as the user types. What code would you writ...
-
You are given a String number containing the digits of a phone number (the number of digits, n, can be any positive integer) . To help you memorize the number, you want to divide it into groups of contiguous digits. Each group must contain e...
-
Algorithm to partition a set of numbers into two such that diff bw their sum is min and they have equal number of elements
-
Every number ending in 3 has a multiple of the form "111...111"
-
Given an integer, write a function to check whether the binary representation of the integer is palindrome.
-
Given two integers a, b how to divide (a/b) without using / and % operators (repeated subtraction is not the solution).
-
Really like the linear solution of this problem. You have an array of 0s and 1s and you want to output all the intervals (i, j) where the number of 0s and numbers of 1s are equal.
-
Consider a row of n coins of values v(1) ... v(n), where n is even. We play a game against an opponent by alternating turns. In each turn, a player selects either the first or last coin from the row, removes it from the row permanently, and receiv...
-
You have a sequence where each number is a multiple of 2 or 5 (so: 2^i * 5^j). Given the beginning of the sequence as 1,2,4,5,8,10,16... and find a algorithm to calculate the next number in the sequence?
-
Given an Integer array, find the maximum difference between any of the iterators 'i' and 'j' such that Array[i] < Array[j] and i < j
-
In this, for 75% times A>B and 25% times B>C then, in 10000 instructions F to G [a] 7500:2500 [b] 7500:625 [c] 7500:625 if a=b=c else 7500:2500
-
Given a lot of cuboid boxes with different length, breadth and height. We need to find the maximum subset which can fit into each other.
-
In a given 2D array that has only 1s and 0s, find the maximal 2D sub array which has only 1s.
-
Define three operations LEFT, RIGHT, ENCLOSE .. The result of applying each of these operation on x (x is in itself a combination of such parenthesis) gives the result : ()x , x() and (x) respectively.
-
Suppose we are given an array A[1 .. n] with the special property that A[1] A[2] and A[n 1] A[n]. We say that an element A[x] is a local minimum if it is less than or equal to both its neighbors, or more formally, if A[x â..
-
Given a stream of numbers, write a function that maintains the median of numbers.