Interview questions

Software Developer/ Programmer interview questions – page 6

2,071 questions. Tap “Show answer” to check yourself.

  1. Support n stacks using an array

  2. Reversing linked list recursively returning the head without any global variables at all

  3. Write ftoa() procedure. i/p: float no. o/p: string representation.

  4. A graph is given with "n" nodes, having the property symmetric and transitive. Write a code to proof all the nodes of the graph can communicate with each other.

  5. You have to read a text file and maintain count of the occurrences of words in the text. for e.g. how are you doing? Are you ok? we have are and you coming twice and all others are occurring just once . So all you have to do i...

  6. 2. Number of times multiplication is required:

  7. How to remove the duplicates in a sorted array and return the number of unique elements in linear time and constant space.

  8. Given a 2D array which has all columns sorted and all rows sorted. Find the kth largest element in such array.

  9. Assume that index i is within the stack size. Stack is implemented using an array A[1, ... N] and index variable is i push and pop operations are defined as below push: start A=x, i=i+1 pop: start i=i-1, x=A to implement stack co...

  10. A sorted array is rotated any number of times now write a code to search a number in this array (without disrupting the original elements in the array)

  11. In a 2D-Matrix, there is one row which is equal to a particular column. Find that particular row and Column in the most efficient way possible. eg. 1 2 4 6 4 7 7 8 3 9 7 2 1 4 8 5

  12. What kind a data structure will you use to implement an Instant Search feature.

  13. In a boolean array, find the maximum size submatrix with all 1s (Note that its not the maximum square submatrix).

  14. Find the element from unsorted array whose sum is equal to given number S.

  15. U have an array of nos write an algo that will place multiplication of other nos at each position (I told them first multiply all elements. Let multiplication be M. Then for each element divide that element by M) He told me to do the s...

  16. 4. Specification of variables in one language: letter follow by letter or digit. options: 1. (LUD)* 2. L.(LUD)* => this one right. 3. L.(L.D)+ 4. L.(L.D)*

  17. You have a file containing lines of text and then each line has words.

  18. Find the longest repeated substring given an input string. eg. given "banana" you should find "anana"

  19. Clone a connected undirected graph. Input is a node*. Return the node* of the cloned graph.

  20. Given one n size array which is filled with only two no. You have to find out which no. occurs more. Do it using minimum number of comparisons.

  21. Efficiently find the number of reptitions of a given number x in a sorted array arr[].

  22. In a stream of numebers, how will you find out n smallest numbers at any moment? how will u store them

  23. Write a function void DrawRectangle(char *Screen, int x1, int y1, int x2, int y2). Height and width of the monitor is known. To set a pixel, you need to set that particular bit of the screen.

  24. Given an integer array. { 1,2,3,4,5 } Compute array containing elements 120,60,40,30,24 (2*3*4*5,1*3*4*5, 1*2*4*5, 1*2*3*5, 1*2*3*4)

  25. You're given a string, and you want to split it into as few strings as possible such that each string is a palindrome. (I guess a one char string is considered a palindrome, i.e. "abc" is split into "a", "b", "c".)

  26. Explain an algorithm for sorting a set of Strings..The constraint here is that all the strings doesn't fit in memory at a time..Please do mention the complexities of ur Algorithm

  27. Spiral printing of a matrix

  28. There is a binary tree. You will need to find out if at any node it behaves as binary search tree if broken at that node in O(N) time complexity

  29. You are given a list of strings. Find a way to combine and store them in such a way that it you can retrieve the original strings.

  30. Find out the no. of vertices in a graph given the graph is: a) Undirected cyclic b) Directed Cyclic c) Undirected non cyclic d) Undirected non cyclic.

Companies that ask Software Developer/ Programmer questions