Skip to main content

Top 20 Programming questions asked in an interview


Programming questions are integral part of an interview for the developer's position. No matter which programming language you master, it is expected that you are familiar with fundamental concepts of programming.

Coding interviews mainly comprise of data structure and algorithm related questions along with logical questions. Coding interview questions are related to array, linked list, string, binary tree, and questions from algorithms. Here are 20 most commonly asked interview questions. You can easily find answers to these questions on Google to prepare yourself for the interview.

  1. How is a bubble sort algorithm implemented?
  2. How to print the first non-repeated character from a string?
  3. How to find the first non repeated character of a given String?
  4. How do you find duplicate numbers in an array if it contains multiple duplicates?
  5. How do you remove duplicates from an array in place?
  6. How are duplicates removed from an array without using any library?
  7. How do you find the middle element of a singly linked list in one pass?
  8. How do you check if a given linked list contains a cycle? How will you find initial node of the cycle?
  9. How do you reverse a singly linked list without recursion?
  10. How is a binary search tree implemented?
  11. How do you traverse a given binary tree in preorder without recursion?
  12. How do you print all nodes of a given binary tree using inorder traversal without recursion?
  13. How is a merge sort algorithm implemented?
  14. How is a radix sort algorithm implemented?
  15. How do you swap two numbers without using the third variable?
  16. How do you design a vending machine?
  17. Write a program to find prime factors of an integer?
  18. What is Depth First Search Algorithm for a binary tree?
  19. Difference between a stable and unstable sorting algorithm?
  20. What is the difference between Comparison and Non-Comparison Sorting Algorithms?


 

Comments

Popular posts from this blog

How to Install PyCharm? (Windows, Mac, Ubuntu)

  A little introduction PyCharm is one of the widely used IDE for python programming and used by many programmers these days. It is available in three editions: Professional, Community and Educational (Edu). We will prefer Edu edition as it is an open source and free to use. Also, it fits our purpose of learning python as a beginner. If you have already installed pycharm or some other compiler you can skip this and read the tutotrial here>>  Let's Get Started with Python Install PyCharm You can go to the official page and follow the guide to installation, to go to the official page  click here  or stick with me and follow the steps below. This is the direct link to install PyCharm Edu>>  click here Already Installed PyCharm Community or Professional? Then you just need to install EduTools Plugin. To install the plugin follow these simple steps: 1.         Go to Files>>Settings... or Press Ctrl+Alt+S to open Se...

How To Create Super User In Django

  1. Install Python 2. Open Command Prompt 3. Type pip install Django 4. Go to your new folder directory 5. Open powershell or CMD 6. Run django-admin 7. Run django-admin startproject projectname 8. And Its Done Creating an admin user ¶ First we’ll need to create a user who can login to the admin site. Run the following command: $ python manage.py createsuperuser Enter your desired username and press enter. Username: admin You will then be prompted for your desired email address: Email address: admin@example.com The final step is to enter your password. You will be asked to enter your password twice, the second time as a confirmation of the first. Password: ********** Password (again): ********* Superuser created successfully. Start the development server ¶ The Django admin site is activated by default. Let’s start the development server and explore it. Recall from Tutorial 1 that you start the development server like so: $ python manage.py runserver Now, open a Web browser and...

Best Python Projects For Final Year Computer Science

Python Final Year Projects :   1. Hangman Project in Python   Python Project Idea – The objective of this project is to implement the hangman game using Python. This project doesn’t require any external modules rather just needs random and time modules of Python. Python functions and loops are enough to develop a hangman game                                                                                                                    2. Rock Paper Scissors Python Game   Python Project Idea – The rock paper scissors is a game played between two players that have few sets of rules. We can define the rules and conditions ...