C interview questions

This is a discussion on C interview questions within the C Programming forums, part of the General Programming Boards category; Hi for all. these are some of the interview questions..please help me by answering these questions...thanks in advance 1)A static ...

  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    6

    C interview questions

    Hi for all. these are some of the interview questions..please help me by answering these questions...thanks in advance



    1)A static function
    a) accesses external functions that reside in separate files.
    b)limits its scope to the file it resides in.
    c) accesses external functions that reside in one specific file.
    d)limits its scope to the variable it resides in.
    e)I donít know



    2)what should yo do with command-line arguments ?
    a)comment them out
    b)use them in the header
    c)document them
    d)use them after the fclose()

    3)Initialization in a C program does not occur

    a)in Variable protolypes.
    b) in variable declarations.
    c)as function arguments.
    d) as the result of a return argument within a function.
    e)I donít know

    4)Which is not true to create a structure that contains another structure as one of its members?
    a) Declare a structure variable of the type to be nested.
    b) Define the structure that is to be nested.
    C) Define the structure that will hold the nested structure.
    d)Define the variable that will house the nested structure.
    e) donítknow


    5)Which is not a component that makes up the ANSI standard C function?
    o The function start.
    o The function prototype or declaration.
    o The function call.
    o The function code or definition.
    o I donít know


    6)A common Link-Time Error is
    o in the source file, either with misspelled names of external functions or with a missing reference to an appropriate header file.
    o improperly spelled keywords.
    o improperly delimited code blocks involving either too few or too many braces.
    o a missing semi-colon following a C statement.
    o I donít know


    7)Which of the following is nota conditional compilation directive?
    o #if, #endif
    o #if, #eldef, #endif
    o #if, #else, #endit
    o #if, #elif, #endif
    o I donít know


    8)A constant cannot be
    o a character.
    o a number.
    o a word.
    o a symbol.
    o I donít know


    9)The notation to refer to an individual structure in the array
    o structure_variable_name[size]
    o array_name[element_number]
    o element_number[array_name]
    o size[structure_variable_name]
    o I donít know

    10)After you have created a source file,
    o the source code must be translated into a binary version.
    o the source code must be translated into an include statement.
    o the source code must be translated to a human-readable version.
    o the source code must be translated into library functions.
    o I donít know




    11)With which alternative I/O function do you press [ENTER] every time you enter a single character, to send the
    contents of the buffer to your program?
    0 getche()
    0 getchr()
    0 getchar()
    0 getch()
    0 I donít know


    12)When passing a structure member to a function, which lype does not need to match?
    o Function call
    o Structure definition
    o Function variable
    o Function prototype
    o I dont know



    13)The following is an example of what kind of argument:
    add_nums 12 24 36

    Ď argf
    0 argz
    0 argc
    ģ argv
    0 I dont know


    14)A general strategy for reading larger C programs is to first
    o locate the function maino.
    o locate the function printf.
    o read any programmer comments at the beginning of the program.
    o locate the function <studio.h>
    o I dont know


    15)The variables that comprise the structure are called the
    o members of the structure.
    o definitions of the structure.
    o functions of the structure.
    o templates of the structure.
    o I donít know

    16)You cannot use symbolic constants to define constants with
    o symbols.
    o floating-point values.
    o characters.
    o formulas.
    o I dont know


    17)Which is not a rule and/or guideline for preprocessor directives?
    o A directive can appear aníywhere in the program, but some, especially the #include and #define directives, are usually located at the beginning of the program.

    o The directive is in effectfrom its location in the program to the
    end of the program.

    o A directive is not limited to one logical line in length, or until the first new line is encountered.

    o The directive must begin with the # character.

    o I donít know


    18)What are the unary operators involved in setting up the pass-by reference?
    o address and indirection
    o variable and constant
    o declaration and definition
    o Integer and character
    o I dont know


    19)To create an array, which of the following would you not need to specil\i?
    o The location.
    o The name
    o The size, or number of elements
    o The data type.
    o I dont know


    20)The files that comprise the C standard library usually reside in two locations:
    o A directory containing the library files and a directory containing the function files.
    o A directory containing the header files and a directory containing the prototype
    o A directory containing the libraryfiles and a directory containing the header files.
    o A directory containing the header files and a directory containing the footer files.
    o I dont know


    21)Which is not a type of problem that you should check for with any user-input data?
    o That data is in the format you expect for example, that users actually input numbers or characters when your program calls for such data.
    o That the data users enter is always limited to 10 characters.
    o That the length is within the range you require and that it wonít exceed the capacily of the variables that youíll use to hold that input.
    Thatthe data users enter is logically correct.
    o I donít know


    22)Output cannot be directed from the following place:
    o The screen (default I/O device).
    o Atape.
    o Afile on disk.
    o A different form that it is translated into and sent as a signal.
    o I dont know


    23)When youíre moditqing a program, you should follow an orderly process. Which is not a procedure you should follow?

    o Understand how the program works from the developerís standpoint.
    o Determine the relationships between those segments and any others connected to them.
    o Determine which code segments you need to work with.
    o Organize and review any documentation that relates to the portion of the code you will work with.
    o I donít know

    24)To determine which code has been written as functions
    o examine the definition prototype list.
    o examine the function prototype list.
    o examine the argument definition list.
    o examine the function definition list.
    o I dont know


    25)A Pointer cannot be used to
    o improve the efficiency of your program.
    o allow you to modiIi variable arguments passed to a function.
    o allowyouto modiIí the variableís location in memory.
    o use the dynamic memory allocation routines.
    o I donít know


    26)Which of the following is not an advantage of C?
    o C compilers can generate machine code that executes extremely fast.
    o C is a structured language.
    o C programs are portable.
    o C has only one distinct operator.
    o I dont know


    27)Which pointer does not refer to a standard stream in the C language?
    o stdin
    o stdout
    o stderr
    o stddef
    o I dont know

  2. #2
    The larch
    Join Date
    May 2006
    Posts
    3,573
    I don't see what's your problem. If I were you, I'd just check the "I don't know" options.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  3. #3
    Registered User
    Join Date
    Apr 2009
    Posts
    6
    hi ,aron


    why are you discouraging me? i tried to find these answers..but i didnt... thats why i posted here..please help me if u dont mind

  4. #4
    The larch
    Join Date
    May 2006
    Posts
    3,573
    If you can't find these answers yourself, you are most probably not suitable for the job. If you are telling that you are just testing your C knowledge, you could start from a beginner's tutorial.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  5. #5
    Registered User
    Join Date
    Sep 2008
    Posts
    58
    1 is rather straight forward. It's obviously not A or C since they deal with external functions. D is just completely wrong so its obviously B.

  6. #6
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    If we answer these questions for you and you somehow manage to get this job, how long do you think you'd last there before they figured out you don't know enough about programming to do the job properly?
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  7. #7
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    If these are interview questions for a real job, I'd turn down any offer they make you and run. The chance of you getting a good job at a company that asks these ridiculous questions in an interview are vanishingly small. They'll hire exactly what they deserve: a clueless, useless beginner.

    On the other hand, if, as I suspect, these are questions from a programming class assignment, you're encouraged to do your own damn homework.
    My best code is written with the delete key.

  8. #8
    Registered User
    Join Date
    Dec 2010
    Posts
    1
    can somone explain to me what is keywords mean please ??

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. interview questions
    By mixalissen in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 05-03-2008, 02:00 PM
  2. Replies: 1
    Last Post: 06-17-2005, 07:29 AM
  3. Companies and their stupid interview questions...
    By Cheeze-It in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 01-30-2003, 05:00 PM
  4. Interview questions
    By Stony in forum Tech Board
    Replies: 0
    Last Post: 11-11-2002, 07:10 PM
  5. a list of interview questions...
    By BrianK in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 10-29-2002, 01:29 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21