Skip to main content

50 Programs for software engineers looking for jobs

Loops and Variables
  1. Write a program to swap two numbers without using an additional variable.
    Solution : vb.net
  2. Write a program to find the biggest number in n numbers without using arrays.
    Solution : vb.net
  3. Write a program to find the second biggest number in n numbers without using arrays.
  4. Write a program to find the smallest number in n numbers without using arrays.
  5. Write a program to find out m * n without using the * operator.
  6. Write a program to find out m / n without using the / operator.
  7. Write a program to find out m ^ n without using the ^ operator.
  8. Write a program to find out m % n without using the % operator.
  9. Write a program to find out the average of n numbers.
  10. Convert a number in String format to integer - Number entered as "1234" should come as 1234 and "1234a" should come as an error.
  11. Write a program to find the factorial of a number.
  12. Write a program to find out 1+2+3+4+...+n
  13. Write a program that sums up the digits of a number until it is a single number
    Eg: 2748303 = 2+7+4+8+3+0+3 = 27 = 2+7 = 9
  14. Write a program that accepts a base ten integer number and outputs the binary, octal and hexadecimal representations of that number.
  15. Write a program that accepts a hexadecimal representation of a number and outputs the decimal representation of that number.
  16. Write a program to print all the prime numbers between m and n where m is less than n.
  17. Write a program to find all the prime factors of a number.
  18. Write a program which reverses the numerals in an integer, that is 326 becomes 623
Patterns
  1. Write a program to print the pascal's triangle. The way to compute any given position's value is to add up the numbers to the position's right and left in the preceding row. For instance, to compute the middle number in the third row, you add 1 and 1; the sides of the triangle are always 1 because you only add the number to the upper left or the upper right (there being no second number on the other side).
                                                        1
                                                   1        1
                                               1        2        1
                                           1       3        3        1
                                      1       4        6        4        1
                                 1        5      10      10       5        1
  2. Write a program that prints
                                *
                           *        *
                       *       *        *
                  *       *        *        *
             *        *        *        *       *  
  3. Write a program that prints
                                *
                           *        *
                       *                 *
                  *                           *  
             *        *        *        *       *  
  4. Write a program that prints
    *   *  *  *  *  *  *   *
    *                            *
    *                            *
    *                            *
    *                            *
    *                            *
    *   *  *  *  *  *  *   *
Arrays
  1. Write a program to find out the median of n numbers.
  2. Write a program to find out the mode of n numbers.
  3. Write a program to sort numbers using bubble sort.
  4. Write a program to sort numbers using quick sort.
  5. Write a program to find the sum of two m x n matrices.
  6. Write a program to find the product of two matrices.
  7. Write a program to find the transpose of a matrix.
Fibanocci Series
  1. Write a program to print the first n numbers of the fibanocci series.
  2. Write a program to print only the first 10 odd numbers in a fibanocci series.
  3. Write a program to print the list of numbers in a fibanocci series that adds up to n.
Strings
  1. Write a program to reverse a string
    - "My name is sudeep" should become "peedus si eman yM"
  2. Write a program to find the length of a string.
  3. Write a program to reverse the words in a string
    -"My name is sudeep" should become "sudeep is name My"
  4. Write a program to display all possible permutations of a given input string
    - if the string contains duplicate characters, you may have multiple repeated results.
    Input should be of the form
    permute string
    and output should be all the combinations of the letters. Here is a sample for the input
    cat cat cta act atc tac tca 
  5. Write a program that takes an integer and displays the English name of that value. You should support both positive and negative numbers.
    Examples:
    10 -> ten 121 -> one hundred twenty one
    1032 -> one thousand thirty two
    11043 -> eleven thousand forty three
    1200000 -> one million two hundred thousand 
  6. Write a program that takes two arguments at the command line, both strings. The program checks to see whether or not the second string is a substring of the first (without using the substr -- or any other library -- function). One caveat: any * in the second string can match zero or more characters in the first string, so if the input were abcd and the substring were a*c, then it would count as a substring. Also, include functionality to allow an asterisk to be taken literally if preceded by a \, and a \ is taken literally except when preceding an asterisk.
  7. Given a pair of words (the first is the correct spelling and the second is the contestant’s spelling of the word) determine if the word is spelled correctly. The degree of correctness is as follows:
    CORRECT if it is an exact match
    ALMOST CORRECT if no more than 2 letters are wrong
    WRONG if 3 or more letters are wrong
  8. Write a program to read a sentence and calculate the average word value for that sentence. Word value is calculated by finding the average of the ASCII values of all of the letters in a word. Average word value is the average of the word values of all of the words in the sentence rounded to the nearest integer. All letters are upper case. Any non-letter characters are not part of the word in which they are located.
    Eg: MY NAME IS SUDEEP
    = (77+89)/2 + (78+65+77+69)/4 + (73+83)/2 + (83+85+68+69+69+80)/6
    = 83 + 72.25 + 78 + 75.67 = 83 + 72 + 78 + 76
    = 309 / 4
    = 77.25
    = 77
  9. To convert a word to Pig Latin, the first letter of the word was moved to the end (after the last letter of the word) and the letters “AY” were added. For example, PIG becomes IGPAY. Write a program to convert a given sentence to pig latin.
    Eg. MY NAME IS SUDEEP.
    In Pig latin : YMAY AMENAY SIAY UDEEPSAY
 Files
  1. Write a program to find the number of lines in a file new line defined as "\n" and the number of words in a file. A word is defined as two patterns of characters separated by one or more spaces.
  2. Count the number of times a word occurs in a file - the word and the location of the file are inputs to the program.
  3. Write a program that will merge two files and give an output of 1 file.
Linked Lists
Note : The format for the node should be a struct containing an integer value, val, and a next pointer to the following node.
  1. Write a program to find out the length of a linked list.
  2. Write a program to find out if the linked list has a loop.
  3. Write a program to print a singly linked list in reverse.
  4. Write a program to reverse the entire linked list in place. By in-place, I mean that no memory can be allocated. The resulting code should be function that takes the head of a list and returns a the new head of the reversed list. 
  5. Write a program to implement push and pop functions in a linked list.
  6. Write a program which can insert a new node at any index within a list. The program may specify any index in the range [0..length], and the new node should be inserted so as to be at that index. The index is calculated as the position from the beginning of the linked list.

Comments

Thanks for sharing great Questions
Fabulous blog information
PWT Health Tips said…
Good work Thanks for sharing
JAY said…
It's really very helpful,for getting the basic concept of each and every topic of the programming language.It also support for getting the job opportunity.
Uma said…
Super useful, Sudeep. Thanks!
خقق said…
مشكوور والله يعطيك العافيه




goood thenkss
Unknown said…
These questions stand as a litmus test for programmers :)
Coolmons Blog said…
I enjoyed reading your post interesting topic
Unknown said…
Very useful contents of this site.
Anonymous said…
Please post solutions of the questions...for beginners..
Anonymous said…
great collection..thankx for collecting and sharing it..
Nanocell Networks Pvt Ltd is famous for providing 5G Technology Training to the aspirants who wish to make their career in the Telecomm industry. Do not waste your time, come here and take admission and take training from a professional trainer. Those who train here have full knowledge of the Telecomm industry and they know how to train you.

Popular posts from this blog

Online Encumbrance Certificate in Andhra Pradesh

You can get an encumbrance certificate online in AP now. In order to get it you have to perform the following steps. Go to the website http://igrs.ap.gov.in/ Click on Citizen Services -> encumbrance -> Search Click on Yes in the screen that appears Fill in the entries that appear in the search screen. You will have to get quite a few details in so it will help to have a copy of the registration document available with you. Once you finish entering all the details click on Submit. It will then go to a new page with the list of items that matched the search displayed. Click on the check box of the list of encumbrance certificates that are needed and click on submit. This will open a new popup window with the encumbrance certificate. You can then print this certificate. What is this useful for Anyone buying new property can go and verify the current owners of the property that is shown on this certificate in the column Name of PartiesExecutant(EX)&Claimants(CL) with the copy of

Cricket Grounds in Hyderabad

This is a repost of the article I published on the 10th of Jan, 2008 as I have added a new ground - Lahari Resorts. View Larger Map In this post I will try and update the list of cricket grounds that i know in Hyderabad. The grounds that I have listed till now are MCH Play ground, Ameerpet Francis (Do not have the contact number but go to the ground and ask for him). The charges are Rs. 1100 for the ground. They do not charge for anything more. You get the ground from 9:00 AM to 4:00PM. The ground is small. Welfare Center, Sanath Nagar Dhanraj Babu (+91 9394556356). The charges are Rs. 1100 for the ground. They charge you an additional Rs. 500 for the mat and Rs. 100 for cleaning and drawing lines and stuff. They are supposed to give you the ground from 9:00 AM to 4:00PM but what they do is that they pocket extra money from another team wanting to play and give the ground out to them for the remainder of the day assuming that you won't play for the whole day. So what happened th

Problogger guest post

Today my guest post appeared on problogger.net . I wrote about 9 Tips to Start Blogging Successfully . Let me give you a bit of a background about where this article originated from. I have been blogging for close to 3 years now but I have been doing it seriously only for the last 2 months. I then analysed what were the things that I should have done in order to have become a successful blogger based on what I have noticed on the ones that have become successful. The final analysis of my study is what I put into that article and it is what I am trying to implement since the last 2 months. Reading the comments it was exhilarating to notice that some of the readers actually thought Darren was writing the post :-). It was also nice to notice that many readers agreed with my analysis and that strengthened my belief that what I have written if followed will work. How did I get to do a guest post on problogger.net ? A little more than a week ago Darren invited bloggers to do guest pos