Interview level Programs in ‘C’ Lang..

Hi, here I post few C lang programming questions,  you can try on. I am not covering few very basic C programs. This programs are generally posed in interviews for experienced/freshers in companies such as Qualcomm, Broadcom, securify, moschip, Global Edge, Aricents, Mirafa, Graphene, Mojo Networks, Lantronix, Adtran, Votary Softech. I will be updating this post when I encounter some tricky program. For queries add a comment, I will respond…

Write a code which is best, shortest and efficient…..Or else start with functionally correct code and then try to optimize it.

Be an Embedded Programmer……Be proud to be so…

String Operations

  1. Reverse a string using recursion
  2. Concatenate two strings
  3. Reverse alphabets of words in a sentence
  4. Reverse order of words in a sentence
  5. Reverse a string without using Temp variable
  6. Compare strings without strcmp
  7. Convert capital letters to small and vice versa in a sentence

Bitwise Operations

  1. Swap adjacent bits in a 32bit unsigned integer
  2. Swap variable values without using temp
  3. Swap first and last, 2nd and last 2nd  bits of a 32bit integer
  4. Set a bit in a 32bit no.
  5. Clear a bit in 32bit no.
  6. Find number of bits high in a number
  7. Find either a number is divisible by 8 or not ?
  8. Fun to find a number in a array which repeats odd number of times
  9. Find either a number is 2s power or not ?
  10. How to double a number in shortest way?

Linked List

  1. Add a link at Nth position
  2. Remove a element of certain value from a linked list
  3. Add a element into a sorted linked list, in a sorted order
  4. Reverse a single linked list normally and recursively
  5. Reverse a double linked list
  6. Binary search on linked list
  7. Find middle point in a linked list
  8. Find either linked list is circular?
  9. Remove duplicates from a sorted linked list
  10. Program to implement circular Q using arrays

Pattern Based

  1. To print
    1
    23
    345
    6789
  2. To print
    1
    22
    333
    4444
    55555
  3. To print
    A B C D E D C B A
    A B C D C B A
    A B C B A
    A B A
    A
  4. To print Pascal Triangle
  5. To print Floyd’s Triangle
  6. To print
    *
    **
    **
    ***
    *   *
    ***
    ****
    *     *
    *     *
    ****

General Questions

  1. Write a function equivalent to malloc
  2. Program to find either a system is bigendian or not ?
  3. Transpose of a matrix
  4. Matrix multiplication
  5. Wrapper function to malloc to give ‘x’ aligned addresses
  6. Perform division without ‘/’ operator
  7. Function which works as ‘sizeof’
  8. Generate rand_7 using rand_5 fun
  9. Rotate a matrix by 90 degrees
  10. Ascii to Hex conversion
  11. Find either a number is even/odd/palindrome/prime/armstrong
  12. Fibonacci series
  13.  Factorial of no.
  14. Square-root of a number
  15. Sorting methods(selection/bubble/insertion/quick/heap/merge)
  16. Search methods(binary/linear)
  17. Program to demonstrate usage of function pointers.
  18. What can be the reason if a program on Linux doens’t even enter main().
  19. How to debug a program on linux with just an executable?
  20. What all can be the reasons for a application to generate segmentation fault on Linux ?
  21. Will be updated soon…

 

Links useful to crack interviews on C language

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s