Technical Questions PHP.odt

Embed Size (px)

Citation preview

  • 7/31/2019 Technical Questions PHP.odt

    1/8

    2nd May 2012

    TECHNICAL QUESTIONS SETPosition : Software Developer

    NAME : MOBILE :

    1. Find the output of the following code:-

    main(){

    int y = 10;if(y++ == 10 && y++ != 10 && y++ > 11)

    printf("%d",y);

    elseprintf("2y = %d",2*y);

    }a) 12b) 2y =20c) 2y = 22d) 13

    2. Which of the following is the 1's complement of 10?

    a) 01

    b) 110c)11

    d)10

    e)None of the above

    3. Differentiate between hard link and soft link?

    4. Differentiate between SIGABORT and SIGKILL?

    5. Find output:-void funca(p)

    1. int *p;{*p += 20;

    }

    void funcb(m)int *m;{

  • 7/31/2019 Technical Questions PHP.odt

    2/8

    int n;m = &n;*m += 10;

    }

    main(){

    int var = 25;int *varp;varp = &var;funca(varp);*varp += 10;funcb(varp);printf("%d...%d",var,*varp);

    }

    a) 25...25b)35...35c)45...35d)45...45e)55...55

    6. What is nice number in Linux Kernel?

    7. Find output:-int func (int x){if (x

  • 7/31/2019 Technical Questions PHP.odt

    3/8

    8. The commandgrep first second third /usr/you/myfile

    a) prints lines containing the words first, second or third from the file/usr/you/myfileb) searches for lines containing the pattern first in the files second,

    third , and /usr/you/myfile and prints themc) searches the files /usr/you/myfile and third for lines containing the

    word s first or second and prints themd) replaces the word first with the word second in the files third and

    /usr/you/myfilee) None of the above

    9. What is shared library?

    10. The redirection operators > and >>

    a) do the same functionb) differ : > overwrites, while >> appendsc) differ : > is used for input while >> is used for outputd) differ : > write to any file while >> write only to standard outpute) None of these

    11. If a directory contains public files (can be valid and usedby any one ) which should not be altered ,the most liberalpermissions that can be given to the directory isa)755b)777c)757d)775e)None of the above

    12. If the number of address bits in a memory is reduced by 2 and the addressability is doubled,the size of the memory (i.e. the number of bits stored in the memory)

    a) doublesb) remains unchangedc) halvesd) increased by 2^(address bits)/addressability

    13. Circuit A is a 1-bit adder; circuit B is a 1-bit multiplier.

    a) A has more gates than Bb) B has more gates than A

    c) A and B have same number of gates

  • 7/31/2019 Technical Questions PHP.odt

    4/8

    14. A structure that stores a number of bits taken together as a unit is a

    a) Gateb) Muxc) Decoderd) Register

    15. Write the o/p of the following code:-

    void do_fork2(){

    Printf(spawned \n);}

    int main(){

    Fork();Fork();

    }

    16. With an IP address of 100, you currently have 80 subnets. What subnet mask should you useto maximize the number of available hosts?

    192

    224

    240

    248

    252

    17. ICMP (Internet Control Message Protocol) is a TCP/IP protocol used to dynamically bind a high level IP Address to a low-level physical

    hardware address

    a TCP/IP high level protocol for transferring files from one machine to another a protocol used to monitor computers

    a protocol that handles error and control messages

    None of the above

    18. How many hosts are attached to each of the local area networks at your site? 128 254 256

    64 None of the above

  • 7/31/2019 Technical Questions PHP.odt

    5/8

    19. Which of the following is used for modulation and demodulation? Modem Protocols Gateway Multiplexer None of the above

    20. Frames from one LAN can be transmitted to another LAN via the device Router Bridge Repeater Modem

    21. Interprocess communication in UNIX can be achieved using

    a)pipeb)Messagec)Semaphoresd)Shared Memorye)All of the above

    22. Which of the following is true about fork()a) it transforms an executable binary file into a process that overlays

    the process which made the fork() system call.NO new process is created.b) Causes the creation of a new process, the CHILD process, with a new

    process IDc) Causes the creation of a new process, the CHILD process ,with the same

    process ID as the parentd)fork() has nothing to do with processese)fork() is not a system call

    23. Write the output :-

    void main(){

    char *s="hello world";int i;for(i=0; i

  • 7/31/2019 Technical Questions PHP.odt

    6/8

    24. You are sitting in a small boat, holding the end of a rope. The other end of the rope is tied tothe top of a nearby pier, such that it is higher above the water than your end of the rope. You pullon the rope, causing your boat to move toward the pier, stopping directly underneath the pier. Asyou pull on the rope, which is faster, the speed the boat moves across the water or the speed therope moves through your hands?(1) Speed of boat is faster(2) Speed of rope is faster

    (3) Both rope and boat have equal speeds.

    Q25. You have eight marbles and a two-pan balance. All the marbles weigh the same, except forone, which is heavier than all the others. The marbles are otherwise indistinguishable. You maymake no assumptions about how much heavier the heavy marble is. What is the minimum numberof weightings needed to be certain of identifying the heavy marble(1) 2(2) 3(3) 4(4) 5

    Q26. Two guys A & B found out a old coin. On one side of that there is a picture of a king and onthe other side it was written as 200B.CA told that the coin is a fake one but B said the other way. which one is correct ?(1) A is right(2) B is right(3) It cannot be concluded.

    27. Find O/P:-main()

    {int i=10;printf("%d %d %d",i,++i,i++);

    }

    a)10 10 11b)10 11 11c)10 12 12d)12 12 10e)10 11 12

    28. The very first process created by the kernal that runstill the kernal process is haltes isa)init

    b)gettyc)fork

    d)firste)none

  • 7/31/2019 Technical Questions PHP.odt

    7/8

    29. What is the race condition of fork()?

    30. When inorder traversing a tree resulted E A C K F H D B G; the preorder traversal wouldreturn

    a. FAEKCDBHGb. FAEKCDHGBc. EAFKHDCBGd. FEAKDCHBG

  • 7/31/2019 Technical Questions PHP.odt

    8/8

    2nd May 2012

    CODING QUESTIONS

    Position :Software Developer

    NAME : MOBILE :

    1. Write a wrapper to implement malloc() function and use the same to allocate memory to a2-dimensional array.