Data Structures & Coding Interviews

Data Structures & Coding Interviews

April 7, 2018 Uncategorized 0

In today’s blog post, I will be discussing the importance of data structures while preparing for the coding interviews.

WHY LEARN DATA STRUCTURES

What’s the point? Why should I learn data structures?

Data Structures & Cracking the coding interview

As an interviewer, it tells me how deep is your understanding of Computer Science Fundamentals.

Do you know the right tool (data structure) to organize data in specific scenarios. Do you understand memory and performance implications of using these data structures and make a wiser decision accordingly. For companies, especially with huge user base, usage of correct data structure can mean the difference between high performance v/s bad performance.

Furthermore, during an interview, it gives me a common language to talk with you. For example, if I am discussing Linked list, I don’t have to explain everything to you. I expect you to know certain things about it. Instead of these common data structures, if I start explaining to you some problem from my domain (for example medical or Human resource, etc), then explaining the domain itself might take more than half an hour. And we have limited time during the interviews. I would rather spend that time to judge your problem solving skills and knowledge as compared to explaining the domain.

WHAT TO LEARN

Although there are lots of data structures to learn. But at a very high level, these are the most important ones to learn as they are interviewers’ favorites:

  • Array
  • Linked List
  • Stack
  • Queue
  • HashMap
  • Trees

 

Think of these as the basic building blocks. With each of these, you should know how they work internally. You should know how adding an element works, how retrieving an element works. How they are stored in memory. What happens when you try to delete an element, etc. For each of these scenarios, you should be able to explain the Big(O) notation, to demonstrate you understand the efficiency associated with each data structure and algorithm.

Once you understand the basics, you will be able to handle problems with higher complexity which are more common in the technical interviews.

CONCLUSION

Having a solid understanding of data structures is very important for interviews as well as for writing good code.