Jay Taylor's notes

back to listing index

Top 30 Programming questions asked in Interview - Java C C++ Answers

[web search]
Original source (javarevisited.blogspot.com)
Tags: interviewing interview-questions javarevisited.blogspot.com
Clipped on: 2013-11-20

Top 30 Programming interview questions

Programming questions are integral part of any Java or C++ programmer or software analyst interview. No matter on which language you have expertise it’s expected that you are familiar with fundamental of programming and can solve problems without taking help of API. Programming questions like How to reverse String using recursion or How to find if Array contains duplicates  are some popular examples of programming question in Java.  Programming questions present lot of challenges Especially to Java developers as compared to C++ programmer and I think, One reason for this is powerful Java API; Which has method for almost every need and you rarely need to write by your own or there are lots of third party library from Apache, Spring, Google and other open source. These programming interview questions are from my personal collections and I have only chosen those which are not very difficult, can be solved easily but at same time can become too complex or confusing, present lots of follow-up questions and test fundamentals of programming, OOPS and design. I have not given answers of these programming questions but those can be found by google and I will try to post links of answers here sometime later but at same time I will try to provide quick tips or hints on some questions. If you like to read programming books, you can check out Programming Interviews Exposed and 10 coding questions asked in Google with solution, that helps a lot while preparing for any programming Job interview.



Anyone who is following programming questions must be familiar with these questions and also knows answer for most of these but for new guys and even for intermediate its worth refreshing it before going to any programming job interview e.g. Core Java interview.


String Programming Interview Questions

String is the primary and probably most common thing you come across on any programming language and so is with any programming interview. There is almost always a question on String whether its related to length or replace but I have always find one or two String programming questions on interviews.
1) Write code to check a String is palindrome or not?

Palindrome are those String whose reverse is equal to original.This can be done by following technique demonstrated in How to reverse String in Java without using API
2) Write a method which will remove any given character from a String?
3) Print all permutation of String both iterative and Recursive way?
4) Write a function to find out longest palindrome in a given string?



Some more String related Questions which mostly appear in Java programming interviews:

Difference between String and StringBuffer in Java

Why String is final in Java

How to Split String in java 

Why Char array is preferred over String for storing password?


Programming questions on Array

Image (Asset 1/1) alt=