Interview questions
Team Lead/ Tech Lead interview questions – page 2
3,203 questions. Tap “Show answer” to check yourself.
-
Given a file and and API containing getline() to read lines from it, how will u print only the unique lines from it.
-
As we know that each user has only 4 digit acc. no. We have billions of user what is maximum bounds on these no. What algo used to generate 4 digit unique no. & what are the possible 4 digit nos. we can have...
-
Consider a datagrid in windows application. Here item, rate, qty, amount field are there. When user enters rate and qty, amount should be automatically calculated. When enter key is pressed, the cursor should go from item to rate and then qty and then amo
-
What does managed mean in the .NET context?
-
3 divides 111 , 13 divides 111111 etc.. find a number having all one's which is shortest divisible by a given number which has 3 as its last digit.
-
What are the different ways to say, the value of x can be either a 0 or a 1. Apparently the if then else solution has a jump when written out in assembly.
-
Write a C function for unsigned power(double x, unsigned int n) using minimum number of multiplications. Count the number of multiplications used.
-
I have an array consisting of 2n+1 elements. n elements in it are married, i.e they occur twice in the array, however there is one element which only appears once in the array. I need to find that number in a single pass using constant memory. {a...
-
Create a fast cached storage mechanism that, given a limitation on the amount of cache memory, will ensure that only the least recently used items are discarded when the cache memory is reached when inserting a new item. It supports 2 functions: S...
-
Given an integer array of which both first half and second half are sorted. Write a function to merge the two parts to create one single sorted array in place [do not use any extra space]. e.g. If input array is [1,3,6,8,-5,-2,3,8] It should...
-
A sequence of numbers is coming ... a) find in constant time if a number has already come b) find in constant time how many time a number has come
-
Consider a scenario where lots of objects are created in runtime and soon after the execution starts, you have millions of objects consuming 90% of JVM memory. What would you do about it?
-
You have given a positive number you have to find a number which is bigger than that by using same digits available in the number. Example :- You have given a number 7585 , your output should be 7855 .
-
Implement function to find needle from a haystack. Interviewer was looking for coding skills.
-
The finally keyword is supported in C#?
-
Function to get count of primes in range 1..n
-
Write a logic to add the digits of an integer, get the sum and again add the digits of the resulted sum. Keep on doing this until the sum reaches to single digit. Ex: number : 3456257672 sum of digits:47 result sum : 47 sum of ...
-
How you will find the lowest common ancestor(LCA) in Binary Tree..its clear its Binary Tree not The4 Binary Search Tree ?
-
Prove The Time Complexity of Sieve of Eratosthenes (prime generation algorithm()) is O(nlog(logn))..Interview wants from clean Mathematical Proof..for this..
-
Which of the following is TRUE about the declaration const char * p a. the pointer cannot be changed but the value to which it points can be changed b. the value is constant but the pointer can be changed c. neither the value nor...
-
Suppose a matrix A (M*N) is given . And A is defined as ..
-
Given a sequence of integers, find a continuous subsequence which maximizes the sum of its elements, that is, the elements of no other single subsequence add up to a value larger than this one. An empty subsequence is considered ...
-
Given an array of integers, find Pythagorean triplets.
-
Given an undirected graph, design a O(V+E) algo to detect whether there is a triangle in the graph ot not.
-
Write a function to compare two xml files
-
Zero Sum sub-array: You are given an array of integers.Find a sub-array whose sum of elements in zero in Linear time.
-
Check Number is perfect Square or Not Give Most Efficient Solution ? most eff. program shouldn't use any memory & variable amount of time followup Did you know what if Number is odd or even what if number can't fit in ...
-
What is the use of run time polymorphism For what kind of requirements, you would make functions virtual?
-
Given a rand(N) a random generator 0 - N-1. now
-
Find maximum repeating number in a given array. optimize it for space then in time. Eg 5 is maximum repeated in array {12, 4, 5, 89, 5, 4, 12, 6, 5, 5}