0% found this document useful (0 votes)
3 views

AlgoBasedQuestions_CodeStore

The document outlines various interview questions focused on algorithms and their complexities, covering topics such as sorting algorithms, dynamic programming, data structures, and graph algorithms. It details the structure of interview rounds, including technical assessments and coding challenges. Additionally, it includes specific algorithmic problems and their expected solutions, emphasizing the importance of understanding algorithm efficiency and implementation details.

Uploaded by

Harshit Joshi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

AlgoBasedQuestions_CodeStore

The document outlines various interview questions focused on algorithms and their complexities, covering topics such as sorting algorithms, dynamic programming, data structures, and graph algorithms. It details the structure of interview rounds, including technical assessments and coding challenges. Additionally, it includes specific algorithmic problems and their expected solutions, emphasizing the importance of understanding algorithm efficiency and implementation details.

Uploaded by

Harshit Joshi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Interview Questions based on Algorithm and their complexity

1. 2 rounds : Technical Round : 3 Questions • Pattern Printing


• Question on Prime numbers + sorting • React Development
question. Personal Interview Round.

2. There were three rounds- 1. Online Assessment MCQ


(Quant, Reasoning, Verbal, OS, CN, SQL, and one coding
question) *Coding question was of moderate level 2.
Technical Interview- face to face 3. HR Interview- formal talk.
3. They asked to make a car insurance policy calculator. They
have given a complete day for rnd and coding

4. What are Divide and Conquer algorithms? Describe how


they work. Can you give any common examples of the types
of problems where this approach might be used?

5. How would you optimally calculate p^k, where k is a non-


negative integer? What is the complexity of the solution?

6. How do Insertion sort, Heapsort, Quicksort, and Merge sort


work?

7. What are the key advantages of Insertion Sort, Quicksort,


Heapsort and Mergesort? Discuss best, average, and worst
case time and memory complexity.
8. What is a Hash Table, and what is the average case and
worst case time for each of its operations? How can we use
this structure to find all anagrams in a dictionary?

9. A numeric array of length N is given. We need to design a


function that finds all positive numbers in the array that have
their opposites in it as well. Describe approaches for solving
optimal worst case and optimal average case performance,
respectively.
10. How would you, in general terms, describe dynamic
programming? As an example, how would you find the length
of the longest common subsequence of elements in two
arrays by using this method?

11. Design an algorithm that finds the number of ways in


which you can traverse N meters by doing jumps of 1, 2, 3, 4,
or 5 meter lengths. Assume that N can be a very large number.
What is the resulting complexity?

12. What are Red-Black Trees and B-Trees? What is the best
use case for each of them?

13. You are given a matrix of MxN boolean values


representing a board of free (True) or occupied (False) fields.
Find the size of the largest square of free fields.

14. What are the Dijkstra and Prim algorithms, and how are
they implemented? How does the Fibonacci heap relate to
them?
15. What is the Bellman-Ford algorithm for finding single
source shortest paths? What are its main advantages over
Dijkstra?

16. What is A*, what are its implementation details, and what
are its advantages and drawbacks in regard to traversing
graphs towards a target?

17. We are given an array of numbers. How would we find the


sum of a certain subarray? How could we query an arbitrary
number of times for the sum of any subarray? If we wanted to
be able to update the array in between sum queries, what
would be the optimal solution then? What’s the
preprocessing and query complexity for each solution.
18. You need to design a scheduler that to schedule a set of
tasks. A number of the tasks need to wait for some other
tasks to complete prior to running themselves. What
algorithm could we use to design the schedule and how
would we implement it?

19. A significantly large static set of string keys has been given,
together with data for each of those keys. We need to create
a data structure that allows us to update and access that data
quickly, with constant time even in worst cases. How can we
solve this problem?
20.
21. You have a set of date intervals represented by StartDate
and EndDate. How would you efficiently calculate the longest
timespan covered by them?What will be the time complexity?

22. You are given the task of choosing the optimal route to
connect a master server to a network of N routers. The
routers are connected with the minimum required N-1 wires
into a tree structure, and for each router we know the data
rate at which devices (that are not routers) that are
connected to it will require information. That information
requirement represents the load on each router if that router
is not chosen to host the master. Determine which router we
need to connect the master to in order to minimize
congestion along individual lines.

23. Write down a string reversal algorithm. If the given string


is "kitiR," for example, the output should be "Ritik".

24. What are recursive algorithms? State the important rules


which every recursive algorithm must follow.
25. Can we use the binary search algorithm for linked lists?
Justify your answer.

You might also like