Interview questions
Algorithm interview questions – page 27
811 questions. Tap “Show answer” to check yourself.
-
Code to flip the image horizontally.
-
Explain any algorithm with flowchart?
-
Pagging and Segmantation
-
You have two lists, each containing position of a word in some document. Write a program that returns minimum distance between the words in the document. For example: Suppose X occurs at places {2, 3, 5, 10, 12, 16, 19, 20} and Y occurs at ...
-
There are few numbers considered to be unlucky(It contains only 4 and 7. ). Our goal is to find count of such nnumbers in the range of positive integers a and b. For Example: Input:: a = 10 b = 20 Output:: 0
-
What is the best approach to implement Fibonacci series?(recursions or without recursion).In case of no recursion could you optimize your approach further?(Consider Branch pruning).
-
There is a sorted array. Some numbers from the start have been rotated left. [ just like left rotate with carry ]. Now give the algo of bin search to find an element in O(lg n) time
-
What is tiny URL? How would you implement?
-
One number is missing from an unordered array of 1-100. How will you find the missing number effectively?
-
Given a circular road and a set of petrol pumps located at distances d1 d2 ... dn away from each other and supplying p1 p2 p3 ... pn amounts of fuel and your vehicle has a mileage of 1km/l. Determine the feasibility of going around the path starti...
-
Given an array and an integer k , find the maximum for each and every contiguous sub array of size k .
-
Given an integer array, sort the integer array such that the concatenated integer of the result array is max. e.g. [4, 94, 9, 14, 1] will be sorted to [9,94,4,14,1] where the result integer is 9944141.
-
Given an array of random numbers. Find the longest consecutive sequence. For ex Array 100 3 200 1 2 4 Ans 1 2 3 4 Array 101 2 3 104 5 103 9 102 Ans 101 102 103 104
-
Given a m*n matrix, find the subset rectangle with max sum (any other rectangle taken would have lesser sum) Best Regards
-
What is the time complexity of Binary Search?
-
How to count inversions in a sorted array?
-
Given a binary tree, implement an iterator that will iterate through its elements?
-
How will you design a Google Search?
-
What are the advantages and disadvantages of circular queue in linked lists?
-
Given a big string of characters, how to efficiently find the first unique character in it?
-
How many degrees (if any) are there in the angle between the hour and minute hands of a clock when the time is a quarter past three?
-
Identify the next number in the sequence - 31, 28, 31, 30, __?
-
What exactly ad-hoc testing is?
-
Given two files that has list of words (one per line), write a program to show the intersection.
-
How do you determine if every digit in the binary representation of a number is a one?
-
How to swap nibbles in a given character?
-
What are dangling and smart pointers? How do you avoid Memory Leaks?
-
Given an array of integers. Modify the array by moving all the zeros to the end (right side). The order of the other elements doesn't matter?
-
Given an array A with n integers. Rearrange array such that A[0]<=A[1]>=A[2]<=A[3]>=A[4]<=A[5] and so on. You have to do it in linear time O(N)
-
Why Should I hire you,As I know you have recently joined One Of The Company from One Month?