Job preparationData structures

Data structure and algorithm interview questions

12 questions · 8 min read

Linked lists, trees, graphs, sorting and dynamic programming — the problems that come round on almost every board.

Data structures and algorithms sound heavy, but what interviews actually ask about is a fairly short list.

Linked lists, trees, graphs, sorting and dynamic programming — get comfortable with those five and you can handle most of what comes. Each one below has a real problem attached.

The problems

একটি লিঙ্কড লিস্ট রিভার্স করার জন্য একটি প্রোগ্রাম লিখুন। (Write a program to reverse a linked list.)

বাইনারি ট্রি ইনঅর্ডার ট্রাভার্সাল প্রিন্ট করার জন্য একটি ফাংশন লিখুন। (Write a function to print the inorder traversal of a binary tree.)

লিংকড লিস্টের মধ্য দিয়ে সার্চ: একটি লিংকড লিস্টে একটি নির্দিষ্ট মান খুঁজুন। (Search through linked list: Find a specific value in a linked list.)

Try thisএকটি লিংকড লিস্টে 5 নম্বরটি রয়েছে কিনা তা পরীক্ষা করুন। (Check if the number 5 is in a linked list.)

বাইনারি সার্চ: একটি সাজানো অ্যারেতে বাইনারি সার্চ প্রয়োগ করুন। (Binary Search: Apply binary search to a sorted array.)

Try thisঅ্যারে [1, 3, 5, 7, 9] এ সংখ্যা 5 খুঁজুন। (Find the number 5 in the array [1, 3, 5, 7, 9].)

অ্যারে থেকে ডুপ্লিকেট অপসারণ: একটি অ্যারে থেকে সমস্ত ডুপ্লিকেট উপাদান অপসারণ করুন। (Remove duplicates from array: Remove all duplicate elements from an array.)

Try thisঅ্যারে [1, 2, 2, 3, 4, 4, 5] থেকে ডুপ্লিকেট অপসারণ করুন। (Remove duplicates from array [1, 2, 2, 3, 4, 4, 5].)

স্ট্যাকের ব্যবহার: স্ট্যাক ব্যবহার করে একটি ইনফিক্স এক্সপ্রেশনকে postfix (পোস্টফিক্স) এক্সপ্রেশনে রূপান্তর করুন। (Using the stack: Convert an infix expression to a postfix expression using the stack.)

Try thisইনফিক্স এক্সপ্রেশন '(A+B)*(C-D)' কে postfix এক্সপ্রেশনে রূপান্তর করুন। (Convert infix expression '(A+B)*(C-D)' to postfix expression.)

হ্যাশ টেবিলের ব্যবহার: একটি হ্যাশ টেবিল ব্যবহার করে একটি অ্যারেতে ফ্রিকোয়েন্সি গণনা করুন। (Use of Hash Tables: Calculate frequencies in an array using a hash table.)

Try thisঅ্যারে [1, 2, 2, 3, 3, 3] এর ফ্রিকোয়েন্সি গণনা করুন। (Calculate the frequency of the array [1, 2, 2, 3, 3, 3].)

ডিপথ ফার্স্ট সার্চ (DFS) ও ব্রেডথ ফার্স্ট সার্চ (BFS): একটি গ্রাফে DFS এবং BFS প্রয়োগ করুন। (Depth First Search (DFS) and Breadth First Search (BFS): Apply DFS and BFS to a graph.)

Try thisগ্রাফের DFS এবং BFS ট্রাভার্সাল প্রক্রিয়া প্রদর্শন করুন। (Demonstrate the DFS and BFS traversal processes of graphs.)

মার্জ সোর্ট (Merge Sort): মার্জ সোর্ট অ্যালগরিদম প্রয়োগ করুন। (Implement the merge sort algorithm.)

Try thisঅ্যারে [3, 1, 4, 1, 5, 9, 2] মার্জ সোর্টের মাধ্যমে সাজান। (Sort array [3, 1, 4, 1, 5, 9, 2] by merge sort.)

কুইক সোর্ট (Quick Sort): কুইক সোর্ট অ্যালগরিদম প্রয়োগ করুন। (Implement quick sort algorithm.)

Try thisঅ্যারে [10, 7, 8, 9, 1, 5] কুইক সোর্টের মাধ্যমে সাজান। (Sort the array [10, 7, 8, 9, 1, 5] by quick sort.)

ডাইনামিক প্রোগ্রামিং (Dynamic Programming): একটি নির্দিষ্ট সমস্যায় ডাইনামিক প্রোগ্রামিং প্রয়োগ করুন, যেমন 'নাপ স্যাচিং' বা 'ফিবোনাচ্চি সিরিজ'। (Apply dynamic programming to a specific problem, such as 'Knap Satching' or 'Fibonacci Series'.)

Try thisফিবোনাচ্চি সিরিজের n-তম মান ডাইনামিক প্রোগ্রামিং ব্যবহার করে নির্ণয় করুন। (Determine the nth value of the Fibonacci series using dynamic programming.)

গ্রাফের শার্টেস্ট পাথ (Dijkstra's Algorithm): গ্রাফে শার্টেস্ট পাথ নির্ণয় করার জন্য ডাইকস্ট্রা অ্যালগরিদম প্রয়োগ করুন।

Try thisগ্রাফে একটি নির্দিষ্ট শীর্ষ থেকে অন্যান্য শীর্ষে শার্টেস্ট পাথ নির্ণয় করুন।

Tips for this round

  • After every problem, ask yourself what its time complexity is. That is the board's next question.
  • Do not try to finish this in a day. Two problems a day, but every day.

Want to learn this hands-on? Take a look at the related course.

Browse courses