Showing posts with label c interview questions. Show all posts
Showing posts with label c interview questions. Show all posts

Thursday, 29 August 2013

FatPipe Networks Interview Topics held on August 2013

There were 3 rounds for FatPipe Networks for Fresher Job Position held on August 2013

Written test:
Aptitude and basics of c, linux,  TCP/IP.

Technical Rounds
First Technical Round questions:

Difference b/w general purpose OS and Real time OS
 Draw and explain ISO-OSI model and TCP/IP model
 Explain about network topologies
Second Technical Round questions:

Write the logic for finding no of  binary 1's in given unsigned int
How to access the Kth node data in single linked list from last node of the list?
Difference b/w semaphore and mutex
Difference b/w process and thread. Advantage of thread over process
What is PCB? where they will be stored..? 
What is virtual memory? Explain
Draw block diagram of academic project and explain
What is your role in the project implementation.

HR round.

Self introduction
What do u know about company
 About my hobbies.
 About my job role....etc..


Saturday, 24 August 2013

What is the difference between array and linked list - Simple and Easy to Rollout the topic


Memory in Arrays is indeed allocated in a continues manner, that is the reason why arrays can offer random access while linked lists cant.

Arrays are also called Dense lists or static data structures.

Friday, 23 August 2013

How many types of pointers in C

1.         NULL pointer?
A.        A null pointer has a value reserved for indicating that the pointer does not refer to a valid object. Null pointers  are routinely used to represent  conditions such as the end of a list of unknown length or the failure to perform some action

Null pointer in most programming languages means "no value", while null value in relational database means "unknown value".

            Example:       int *p=0;        or        int *p=NuLL;


2.         Based pointer?
A.        A based pointer is a pointer whose value is an offset from the value of another pointer. This can be used to store and load blocks of data, assigning  the address of the beginning of the block to the base pointer.

3.         wild branch?
A.        Wild pointers are pointers that have not been initialized (that is, a wild pointer has not had any address assigned to it) and may make a program crash or behave oddly. In the Pascal or C programming languages,     pointers that are not specifically initialized may point to unpredictable addresses in memory.
           
            The following example code shows a wild pointer:
                       
            int func(void)
            {
                char *p1 = malloc(sizeof(char)); /* (undefined) value of some place on the heap */
                char *p2;       /* wild (uninitialized) pointer */
                *p1 = 'a';      /* This is OK, assuming malloc() has not returned NULL. */
                *p2 = 'b';      /* This invokes undefined behavior */
            }         

4.         autorelative pointer?
A.       The term autorelative pointer may refer to a pointer whose value is interpreted as an offset from the address of the pointer itself; thus, if a data structure,
M, has an autorelative pointer member, p, that points to some portion of M itself, then M may be relocated in memory without having to update the value of p.                       
The cited patent also uses the term self-relative pointer to mean the same thing. However, the meaning of that term has been used in other ways:
It is often used to mean an offset from the address of a structure rather than from the address of the pointer itself.
It has been used to mean a pointer containing its own address, which can be useful for reconstructing in any arbitrary region of memory a collection of data structures that point to each other.

5.         Void Pointers?
A.        Void pointer is generic pointer that can point to any data type.It can hold the base address of another pointer data variable.
                       
            syntax void *vpt;


            int *ptr=&a;


6.         DANGLING POINTER?     
Dangling pointers arise when an object is deleted or deallocated, without modifying the value of the pointer, so that the pointer still points to the memory location of the deallocated memory. As the system may reallocate the previously freed memory to another process, if the original program then dereferences the (now) dangling pointer, unpredictable behavior may result, as the memory may now contain completely different data. This is especially the case if the program writes data to memory pointed by a dangling pointer, a silent corruption of unrelated data may result, leading to subtle bugs that can be extremely difficult to find, or cause    segmentation faults (*NIX) or general protection faults (Windows). If the overwritten data is bookkeeping data used by the system's memory allocator, the corruption can cause system instabilities.

            

Friday, 9 August 2013

FAQ' s on C Language - Embedded Trainees have to know all this


1. what is "little endian" and "big endian" and how to know this?

2. Is it possible to specify width of the data in strings? how? and what happens when that exceded or reduced

3. what are the "unary operators?"

4. Is it possible to assaign a value to a variable before declaring?

5. can you write an inline code for finding largest of three numbers using ternary operator?

6. what is inline function in c?

7. write a program for '/' and '%' operators without using them.

8. Difference between return and goto functions

9. write a program to print pascal triangle

10. where main function return will go

11. where function declarations are present

12. who calls the main() function

13. Difference between recursion and iteration

14. Is it possible to multiply or division of two pointers?what are
the arithmetic operations supported in pointers

15. Difference between pointer to an array and array of pointers

16. How to access last element of the following expression using pointers
a[l][m][n][o][p][q][r]

17. How to return more than one value from a function? program

18. Difference between switch and function pointers

19. what is the use of sprintf() and sscanf() functions

20. Difference between structure and unions .

21. Difference between structure and arrays.

22. "I Love my India, I Love my Country"..write a program that prints how many times that each word occures using pointers
like: I:2 Love:2 my:2 India:1 ,:1 Country:1 <space>:7

23. what is the size of structure when declaring

24. why padding occurs in structures how to reduce it

25. Difference between typedef and #define

26. write a program that accepts input from STDIN and output must be like this...
every line contains exactly 72 characters
if more try to fix in another line
if less fill with spaces

27. Difference between MACRO and FUNCTION

28. What happens in preprocessor stage

29. Using command line arguments take the following input:
like: 10+24$ -34&54+ p54-22
and output must be 10+24-34-22=-22
means remove extra symbols otherthan +,-,*,/,% and consider only values who has prefix these symbols

30. How to mask or unmask bits

31. what is the use of bit fields

32. Difference between enum and #define

33. Difference between static and extern

34. Difference between local static and global static

35. Is it possible to use global static functions in another file

36. Is it possible to declare the global static function in header files to access in only one function

37. what is file scope

38. write a program for the predefine function atoi()

39. return type of malloc write general syntax for it

40. sizeof double pointer

Autoliv India PVT LTD Interview Process and Questions - Held on July 2013

Whole Interview Process conducted in total 3 Rounds.
  • Round 1 : Written Test
  • Round 2 : Technical Interview
  • Round 3 : HR Interview
Written Test: 
Grouped into 3 parts consisting of Basic Electronics, C language and aptitude reasoning.
 
Basic Electronics Questions on following topics  

Voltage gain
Amplifier circuits
Transistor Characteristics.

Technical Round: (Also looking at H.R skills) 

Questions on Academic Project
C Language questions on storage classes, operators, structures.

Sample questions:
1.     Write a program for swapping without using temporary variable.
2.     Write a program using functions to perform both addition and subtraction and print the value in main function.
3.      Bitwise operators, XOR table.

HR Round:
1.     Explain yourself and family background.
2.     Past experiences and hobbies.
3.     How you measure 45 minutes if your given with 2 candles each can burn upto 30mins.

Saturday, 27 July 2013

VVDN Technologies Interview Process and Interview Topics Held at Banglore on June 2013

Written Test

I- 20 questions on aptitude.
II-20 questions on electronics.
III-20 questions on C.

The level of questions was average.
Following are the Topics covered from Electronics
  • Unit of magnetic field.
  • Unit of resistivity.
  • Thevenin's equivalent of the circuit.Find the voltage across the load,the figure will be provided.
  • Find the equivalent capacitance,through the figure provided.
  • Find the equivalent gate,gate will be made by BJT.
  • Find the equivalent gate,gate will be made by Diode.
  • One multiplexer question.
    value of charge on electron.
    More question regarding the charge.
  • Questions on BJT circuit. 
    Effect of temperature on conductivity of the semiconductor.
    Effect of temperature on conductivity of the conductor.
    Find the resistance of the long wire.
    Some Questions on transformer(simple), steady state, 
  • Questions on majority carriers & minority carriers in BJT.

Technical Interview 
  1. It was mostly concentrated on some of the questions from the written test i.e. how you solved them.
  2. Rectifier circuit (HalfWave, FullWave, bridge.)
  3. How to filter pulsating DC from full wave rectifier with circuit
  4. Capacitor alone as a filter.
  5. Your favorite subject and some questions from it. 
 
Technical Interview (2nd round):-    PART- 1
  1. This interview started with electronics i.e. the same rectifiers and diodes.
  2. Then switched onto some digital electronics questions like making gates using transistors, 
    black boxes with input/output conditions given input polarity changed then too output polarity remains same.
  3. Changing duty cycle of pulse
  4. Making Band pass and bandstop filters using low pass and high pass.
  5. C programs:
  6. Multiplication.
  7. Power of 2.  (without loops)

Technical Interview (2nd round):-    PART- 2
  1. Embedded C (KEIL IDE) concepts
  2. Explaining project (B. Tech)
  3. Explain UART protocol.
  4. Write a C program for removing line from a file (For Embedded system)
  5. Explain Termios.

HR Round:
 
It was not a formal HR round as many companies do conduct. Usually there is no HR round here. They just inform us regarding the salary and the date of joining.