Amazon written for experience

                                             
For the below written test answer defined with "*" at the end of the options 

NULL is
Top of Form
  • the same as 0 for integer
  • the same as blank for character       *
  • the same as 0 for integer and blank for character
  • the same as 0 for integer and blank for character
The basic function of ____________ is to search for files(or other units of text) that contain a pattern.
Top of Form
  • awk  *
  • search
  • cat
  • cmp
  What will be the output of the program?

class SSBool
{
    public static void main(String [] args)
    {
        boolean b1 = true;
        boolean b2 = false;
        boolean b3 = true;
        if ( b1 & b2 | b2 & b3 | b2 ) /* Line 8 */
            System.out.print("ok ");
        if ( b1 & b2 | b2 & b3 | b2 | b1 ) /*Line 10*/
            System.out.println("dokey");
    }
}

Top of Form
  • ok
  • dokey  *
  • No output is produced
  • Compilation error
  What does the literal “$?” mean in Shell script?
Top of Form
  • Exit status of the previous command executed
  • Exit status of the last command executed   *
  • Exit status of the first command executed
  • Exit status of the last command failed
  If 10 bulls can plough 20 identical fields in 3 days working 10 hours a day, then in how many days can 30 bulls plough 32 same identical fields working 8 hours a day?
Top of Form
  • 2  *
  • 4
  • 8
  • 10
 What will be the output of the following query? SELECT DECODE(TRANSLATE('A','1234567890','1111111111'),'1','YES', 'NO' ) from DUAL;
Top of Form
  • NO  *
  • YES
  • 1234567890
  • 1111111111
Table Employee has 10 records. It has a non-NULL SALARY column which is also UNIQUE. The SQL statement prints? SELECT COUNT(*) FROM Employee WHERE SALARY > ANY (SELECT SALARY FROM Employee);
Top of Form
  • 10
  • 9  *
  • 1
  • 0
  What is the output of the following program?
x = 3; y = 5; z = 10;
if [( $x -eq 3 ) -a ( $y -eq 5 -o  $z -eq 10 )]
then
    echo $x
else
    echo $y
fi

Top of Form
  • 1
  • 3
  • 5
  • Error  *
A train running at the speed of 60 km/hr crosses a pole in 9 seconds. What is the length of the train?
Top of Form
  • 120 metres
  • 180 metres
  • 324 metres
  • 150 metres  *
Predict output of the following program

#include <stdio.h>
typedef struct film{
    int size;
    int pixel;
    float price;
}xyz,pqr;

struct film *jadu(){
    static xyz one={231,12,900.0},*p=&one;
    return p;
}

int main(){
    pqr *ptr;
    ptr=jadu();
    printf("%d",ptr->pixel);
    return 0;
}

Top of Form
  • 231
  • 12  *
  • 900.0
  • Compilation error
Bottom of Form
Bottom of Form
Bottom of Form
Bottom of Form
Bottom of Form
Bottom of Form
Bottom of Form
Bottom of Form
Bottom of Form
Bottom of Form

What will be the output of the following query? SELECT REPLACE(TRANSLATE(LTRIM(RTRIM('!! ATHEN !!','!'), '!'), 'AN', '*'),'','TROUBLE') FROM DUAL;
  • ATHEN
  • **ATHEN
  • ATHEN***
  • None of the above  *

How will you list all the files within a directory including hidden files aka (.) dot files?
Top of Form
  • ls –a   *
  • ls –h
  • ls –q
  • ls –t
How to make any script file executable?
Top of Form
  • $chmod 655 *.sh
  • $chmod 765 *.sh
  • $chmod 755 *.sh  *
  • $chmod 754 *.sh
How to find current running processes in Unix server?
Top of Form
  • $ ps –ef *
  • $ ds –ef
  • $ du –ef
  • $ ls –ef
Bottom of Form

The least significant bit of the binary number, which is equivalent to any odd decimal number is
Top of Form
  • 0
  • 1   *
  • 1 or 0
  • None
Which OSI layer is responsible for Encryption and Decryption?
Top of Form
  • A) Network Layer   *
  • A) Network Layer
  • C) Data Link Layer
  • D) Presentation Layer
Which of the following memories has the shortest access time?
Top of Form
  • Cache memory *
  • . Magnetic Bubble memory
  • Magnetic core memory
  • RAM
Expand the following abbreviation – USB?
Top of Form
  • a) Universal sequence bit
  • b) Universal serial bus *
  • c) Universal sequence byte
  • d) Unique serial bit
How many times printf() will be executed in the below mentioned program? main() { int i; for (i = 0; i < 4; i++) fork(); printf(“my pid = %d\n”, getpid()); }
Top of Form
  • 4
  • 8
  • 16  *
  • 32
Bottom of Form

 What will be the output of the below program?

#include<stdio.h>
int main(){
int far *p=(int *)0X70230000;
int far *q=(int *)0XB0210000;
int near *x,near*y;
x=(int near *)p;
y=(int near *)q;
if(x==y)
printf("Both pointer are equal");
else
printf("Both pointer are not equal");

    return 0;
}

Top of Form
  • Both pointers are equal
  • Both pointer are not equal
  • Segmentation fault
  • Compilation error  *
What is the difference between linux file system and windows file system?
Top of Form
  • A) Under Linux, the various partitions are detected at boot and assigned a drive letter whereas Under windows, unless you mount a partition or a device, the system does not know of the existence of that partition or device. *
  • B) Under Windows, the various partitions are detected at boot and assigned a drive letter whereas Under Linux, unless you mount a partition or a device, the system does not know of the existence of that partition or device
  • C) Under Windows, the various partitions are detected at reboot and assigned a drive letter whereas Under Linux, unless you mount a partition or a device, the system does not know of the existence of that partition or device
  • D) Under Windows, the various partitions are detected at reboot and assigned a drive letter whereas Under Linux, you mount a partition or a deviceBottom of Form
A bitwise operation 'f' has an interesting characteristic, such that, if f(a,b) = c, it always turns out to be the case that f(b,a) = c; f(a,c) = b; f(c,a) = b; f(b,c) = a; f(c,b) = a.
a) Which of these functions could 'f' possibly be?
Top of Form
  • f(a,b) = a XOR b  *
  • f(a,b) = a + b
  • f(a,b) = a - b
  • f(a,b) = a * b
the following crontab file entry
0 17 * * 1,2,3,4,5 /usr/sbin/ckbupscd >/dev/console 2>1
The above entry says to run /usr.. at what time
Top of Form
  • 17 mins pass midnight
  • 5 pm on weekday of each month *
  • Midnight on the 17 day of each month
  • On the 17 day of each month at 1,2,3,4 and 5 pm
Bottom of Form

 How would you sort a file called shopping on column 3?
Top of Form
  • A) Sort –n 3 shopping
  • B) Sort –K 3 shopping *
  • C) Sort –c 3 shopping 
  • D) Sort –c3 shopping
What is the output of following program?

#include <stdio.h>
void print(int n, int j)
{
   if (j >= n)
      return;
   if (n-j > 0 && n-j >= j)
       printf("%d %d\n", j, n-j);
   print(n, j+1);
}
 int main()
{
    int n = 8;
    print(n, 1);
}

Top of Form
  • 1 7 2 6 3 5 4 4 4 4   *
  • 1 7 2 6 3 5 4 4
  • 1 7 2 6 3 5
  • 1 2 3 4 5 6 7 8
 What is 2NF in normalization?
Top of Form
  • A) if the domain of each attribute contains only atomic (indivisible) values, and the value of each attribute contains only a single value from that domain.[
  • if all the attributes in a table are determined only by the candidate keys of that table and not by any non-prime attributes
  • If no non-prime attribute is dependent on any proper subset of any candidate key of the table  *
  • D) None of above
A train running at the speed of 60 km/hr crosses a pole in 9 seconds. What is the length of the train?
Top of Form
  • 120 metres
  • 180 metres
  • 324 metres
  • 150 metres  *
 Predict the output of the following program

#include <iostream>
usingnamespacestd;
intmain()
{
    constchar* p = "12345";
    constchar**q = &p;
    *q = "abcde";
    constchar*s = ++p;
    p = "XYZWVU";
    cout << *++s;
    return0;
}

Top of Form
  • a
  • c
  • b
  • D) Garbage value  *
 Predict output of the following program

#include<iostream>
using namespace std;
class Test
{
protected:
    int x;
public:
    Test (int i):x(i) { }
    void fun() const  { cout << "fun() const " << endl; }
    void fun()        { cout << "fun() " << endl;     }
};

int main()
{
    Test t1 (10);
    const Test t2 (20);
    t1.fun();
    t2.fun();
    return 0;
}

Top of Form
  • Compilation error
  • fun() fun()
  • fun() const fun()
  • fun() fun() const  *
Bottom of Form

   What does the following query find?

(SELECT DISTINCT r.sid
FROM boats b, reserves r
WHERE b.bid = r.bid
AND b.color = 'red')
MINUS
 (SELECT DISTINCT r.sid
FROM boats b, reserves r
WHERE b.bid = r.bid
AND b.color = 'green');

Top of Form
  • Find the sailor IDs of all sailors who have reserved red boats but not green boats
  • Find the sailor IDs of atleast one sailor who have reserved red boats but not green boats  *
  • Find the sailor IDs of at most one sailor who have reserved red boats but not green boats
  • None of the above
Bottom of Form
Bottom of Form
Bottom of Form
Bottom of Form
Bottom of Form
Bottom of Form
Bottom of Form
Bottom of Form

 Size of IPv6 address is
Top of Form
  • 4 bytes
  • 8 bytes
  • 6 bytes
  • 16 bytes  *
What is the probability of getting a sum 9 from two throws of a dice?
Top of Form
  • 1/6
  • 1/8
  • 1/9  *
  • 1/12
What will be output of following program?

#include<stdio.h>
int main(){
static int a=25;
void cdecl conv1() ;
void pascal conv2();
conv1(a);
conv2(a);
return 0;
}
void cdecl conv1(int a,int b){
printf("%d %d",a,b);
}
void pascal conv2(int a,int b){
printf("\n%d %d",a,b);
}

Top of Form
  • 25 0 0 25
  • 25 <null> <null> 25
  • Error will occur   *
  • 25 -99999999 -99999999 25
Which command puts a script to sleep untill a signal is received?
Top of Form
  • sleep
  • suspend   *
  • disown
  • break
Bottom of Form
Bottom of Form
Bottom of Form
Bottom of Form
Bottom of Form
Bottom of Form
Bottom of Form



EmoticonEmoticon