Interview questions
System Administrator interview questions – page 2
2,099 questions. Tap “Show answer” to check yourself.
-
Discuss time and space complexities of merge sort. When is it preferred over quick sort?
-
If the Fibonacci series is 1, 2, 3, 5, 8, 13,... then 10 can be written as 8 + 2 ==> 10010 and 17 can be written as 13 + 3 + 1 ==> 100101.
-
You have to write a function checkRegex() which takes two strings as input, one string represents a regex expression and other is an input string to match with the regex expression passed as the other parameter. Return true if it matches, else fal...
-
You are given a function (say func1). When it is called, it returns 0 with 60% probability, and 1 with 40% probability. Now using this function, write a new function(say func2) that returns 0 with 50% probability and 1 with 50% probability.
-
Given an array of size n wherein elements keep on increasing monotonically upto a certain location after which they keep on decreasing monotonically, then again keep on increasing, then decreasing again and so on. Sort the array in O(n) and O(1). ...
-
If the sum of the roots of the equation ax2 + bx + c=0 is equal to the sum of the squares of their reciprocals then a/c, b/a, c/b are in
-
How will you implement pow(a,b) without using multiplication or division operators. You can use only add/substract operators.
-
The input number is n. Find the closest Fibonacci series number i where i < n. Show the time complexity of the problem. For eg : if n = 10, the output "i" should be 8
-
Design an algorithm to sort an array whose first n-sqrt(n) elements are already sorted. What is the complexity of the algorithm
-
Suggest Data structure and algo to implement undo and redo operations in MS Word.
-
Given a array A[] and a number x, find the subarray who's sum is equal to x. A[] contains both positive and negative numbers.
-
Given a number, describe an algorithm to find the next number which is prime.
-
We are given 4 numbers say n1, n2, n3, n4. We can place them in any order and we can use mathematical operator +, -, *, / in between them to have final result as 24. Write an algorithm for this, it will take 4 numbers and return false or true whet...
-
There are set of coins of {50, 25, 10, 5, 1} paise in a box. Write a program to find the number of ways a 1 rupee can be created by grouping the paise.
-
Suppose you are a search engine owner and want to show adv to make money. How will you filter the advertisements to be shown when users searches for something. Take into consideration that advertisers will not be interested in showing adds to all ...
-
There is a town which is a square grid.. every point can be reached from any other point.. there are 10 peoples in the grid.. find a common meeting ground for them such that the total distance travelled by those 10 people are the least
-
Give a set of phone numbers. How to check if there are any duplicates.
-
You are given a stream of bits (0 or 1), program an approach that prints "Multiple of 3" when the binary stream becomes multiple of 3.
-
Given two sets, Write a function to provide the union of them. STL not allowed to be used. Optimise for Time and space
-
Reflection is used to ?
-
Sort a given data according to its weight and relevance.(relevance was provided)
-
You are getting a number of two-tuple values <time, val>, where time is non-decreasing. Then a query asks for the value at a particular time. If a tuple exists for that time, it returns the val. Otherwise it returns val from the tuple that i...
-
Given natural numbers 1 to infinity
-
Lucky numbers are numbers whose prime factors are just 2, 3, 5. Find the first k lucky numbers.
-
Reverse n-Ary Tree and Return List of Leaf Nodes as Output
-
Given an unsorted array and two numbers, find the minimum distance between them. For example, if the array is {1,2, 10, 2, 3, 5, 2, 1, 5} distance between 2 and 5 is 1.
-
What is the shortest single line in a C program which will take more than a google years to execute, but will eventually complete? You are permitted to have code before or after the line, but execution of the code must remain on that line, meaning...
-
How do you partition an array into 2 parts such that the two parts have equal average?...each partition may contain elements that are non-contiguous in the array...
-
Processing times for 5 processes were given. You need to find out the minimum average waiting time the processes have to wait in order to get executed if TWO PROCESSORS are given.
-
What is the complexity for finding all the leaders in an array? A leader is defined as an element which is greater than all the elements to its right.