What went wrong with programmer A?

 

The solutions of both programmers A and B were correct, but programmer B is found to be efficient and more proficient in using the correct data structure and algorithms to solve a particular problem given. The problem mentioned above takes O(N) time by the solution of programmer A whereas it takes O(LogN) time by the solution of programmer B. 

With the increasing demands and competition in the software engineering industry, companies these days not only look for hard-working developers but also for developers who can solve a problem as optimally as possible to meet customer satisfaction and are not afraid of paying high. 

Some surveys conducted about the salary reports of software developers in India say that anyone who has a good and fair understanding of how DSA work earns around 20-30 Lakhs per annum. 
 

Data Structures and Algorithms Online Courses : Free and Paid

Data Structures and Algorithms is one of the most important skills that every computer science student must-have. It is often seen that people with good knowledge of these technologies are better programmers than others and thus, crack the interviews of almost every tech giant. Now, you must be thinking to opt for a quality DSA Course to build & enhance your data structures and algorithms skills, right…??

If yes, then you’ve ended up at the right place as here we’ll let you know about several most recommended and worthwhile DSA Courses that will help you to learn and master all the DSA concepts from basics to the advanced level!

Choosing the correct data structure or algorithm to solve a particular problem affects a lot on the efficiency of the solution. 

These skills not only help a programmer to land a high-paying job but also to sustain and perform well in the Job. Let’s see how? 

Consider the scenario of an interview, where two programmers A and B applied for a software developer role and were asked to solve the below problem. 

Problem: Given a sorted array and a key to search. Check if the key is present in the array or not. 

Programmer A solves the above problem by performing a linear search operation and programmer B solves the above problem by performing the Binary Search operation. 

After the results are announced, programmer B got selected and programmer A got rejected

Similar Reads

What went wrong with programmer A?

...

Data Structures and Algorithms Online/Live Courses

At GeeksforGeeks, we have a vast library of articles on DS and Algo contributed by some of the renowned and good Competitive Programmers around the globe which is accessible for free at GeeksforGeeks....