Tech Architect interview questions – page 6

1,161 questions. Tap “Show answer” to check yourself.

Advertisement
  1. Given n points of structure

  2. Design a data structure that supports integer of unlimited size.Assume that you have unlimited memory. Implement functions to support addition and subtraction.

  3. Find all pairs in array such that a+b=x, a != b. you have to specify all space and time complexities...fairly standard problem-

  4. Given two linked list. We have to find that whether the data in one is reverse that of data in other. No extra space is to be used and traverse the lists only once

  5. Given two strings, program to find if one string is cyclic form of the other.

  6. A special type of tree is given, where all leaf are marked with L and others are marked with N. every node can have 0 or at most 2 nodes. Trees preorder traversal is given give a algorithm to build tree from this traversal.

  7. Print the last "k" elements in a singly-linked list.

  8. Reverse the string word by word e.g. "My name is pradeep" .. o/p shd be "pradeep is name My" ...intwer expecting a 1 traversal algo

  9. Merge two linklist without using any extra space...

  10. Given a string, first remove all repeated consecutive substring with length 1, then delete substring of length 2 and so on... Example : string is abcabeccced

  11. Given two strings a and b. Length of b is much smaller than a. Check if a contains an anagram of b

  12. How do you delete duplicate elements from an unsorted array in place(no extra space) Try to do it in time less than O(nlogn)

  13. Advertisement
  14. Given two strings find the combination of strings which can be interleave i/p: if "AB" and "CD" are two strings o/p: ABCD ACBD ACDB ACBD CABD CDAB

  15. Given a root and a node of a binary tree, write a function which finds all the nodes which are a 'k' distance from the give node. (distance can be upwards and downwards)

  16. Inserting an element into a sorted linked list.

  17. Find bugs in the xstrrev function.

  18. Given two n-ary trees T1 and T2. Write a program to check if T1 has T2 in it.

  19. Given a list of words ...you have infinite pre-processing time.Now you are given a word...output all the words from the dictionary that are anagram of this word as efficiently as possible.

  20. Array of integers like 10 12 16 17 24 27 8 6 5 4 2. From 10 to 27 it is in increasing order and then decreasing order starts. So he asked me to find the position from where decreasing starts. it should be done in O(logn).

  21. Given a sorting order string, sort the input string based on the given sorting order string. Ex sorting order string -> dfbcae Input string -> abcdeeabc output -> dbbccaaee

  22. Code your own implementation of Doubly linkedlists, Binary Tree

  23. Given a large file containing orders placed in a day. Find the top k order with maximum costs.

  24. Given a binary tree, find 2 leaf nodes say X and Y such that F(X,Y) is maximum where F(X,Y) = sum of nodes in the path from root to X + sum of nodes in the path from root to Y - sum of nodes in the common path from root to first common ancestor of...

  25. Write your own strcmp and strcat functions in C.

  26. Advertisement
  27. Suppose there is a binary tree having millions of nodes and by mistake one node has two indegree........(i.e. There becomes a cycle/loop in that tree ...u have to find that node which is having two indegree.... Constraint is no extra memory ...

  28. Connect the leafs in a binary tree and return a reference to the first of the linked leafs. This would allow clients of this API to subsequently traverse the leafs. The API has a fLR flag indicating if the leafs should be connected from left-right...

  29. Given a string consisting of a, b and c's, we can perform the following operation: Take any two adjacent distinct characters and replace it with the third character. For example, if 'a' and 'c' are adjacent, they can replaced with 'b'.

  30. Write working code to find the inorder successor of a given node in a bst

  31. Remove duplicates from and unsorted list, optimize it.

  32. Give a good data structure for having n queues ( n not fixed) in a finite memory segment. You can have some data-structure separate for each queue. Try to use at least 90% of the memory space

Advertisement