⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 蓝色_笔试题.txt

📁 这是我同学在IBM面试的一点资料
💻 TXT
📖 第 1 页 / 共 2 页
字号:

ii) */(a,@(*(a,b)))

16. In UNIX a files i-node ......?

Ans. Is a data structure that defines all specifications of a file like the 
file size, 
        number of lines to a file, permissions etc.


17. The UNIX shell ....

a) does not come with the rest of the system
b) forms the interface between the user and the kernal
c) does not give any scope for programming
d) deos not allow calling one program from with in another
e) all of the above

Ans. (b)


18. enum number { a=-1, b= 4,c,d,e}
      What is the value of e ?

(a) 7
(b) 4
(c) 5
(d) 15
(e) 3


19. The very first process created by the kernal that runs till the kernal 
process is halts is

a) init
b) getty
c) both (a) and (b)
d) none of these

Ans. (a)


20. Output of the following program is

main()
{int i=0;
for(i=0;i<20;i++)
{switch(i)
case 0:i+=5;
case 1:i+=2;
case 5:i+=5;
default i+=4;
break;}
printf("%d,",i);
}
}

a) 0,5,9,13,17
b) 5,9,13,17
c) 12,17,22
d) 16,21
e) Syntax error

Ans. (d)


21. What is the ouptut in the following program

main()
{char c=-64;
int i=-32
unsigned int u =-16;
if(c>i)
{printf("pass1,");
if(c<u)
printf("pass2");
else
printf("Fail2");
}
else
printf("Fail1);
if(i<u)
printf("pass2");
else
printf("Fail2")
}

a) Pass1,Pass2
b) Pass1,Fail2
c) Fail1,Pass2
d) Fail1,Fail2
e) None of these

Ans. (c)


22. In the process table entry for the kernel process, the process id value 
is

(a) 0 
(b) 1 
(c) 2 
(d) 255 
(e) it does not have a process table entry

Ans. (a)


23. Which of the following API is used to hide a window

a) ShowWindow
b) EnableWindow
c) MoveWindow
d) SetWindowPlacement
e) None of the above

Ans. (a)


24. What will the following program do?

void main()
{
int i;
char a[]="String";
char *p="New Sring";
char *Temp;
Temp=a;
a=malloc(strlen(p) + 1);
strcpy(a,p); //Line number:9//
p = malloc(strlen(Temp) + 1);
strcpy(p,Temp);
printf("(%s, %s)",a,p);
free(p);
free(a);
} //Line number 15//

a) Swap contents of p & a and print:(New string, string)
b) Generate compilation error in line number 8
c) Generate compilation error in line number 5
d) Generate compilation error in line number 7
e) Generate compilation error in line number 1

Ans. (b)


25. In the following code segment what will be the result of the function, 

value of x , value of y
{unsigned int x=-1;
int y;
y = ~0;
if(x == y)
printf("same");
else
printf("not same");
}

a) same, MAXINT, -1
b) not same, MAXINT, -MAXINT
c) same , MAXUNIT, -1
d) same, MAXUNIT, MAXUNIT
e) not same, MAXINT, MAXUNIT

Ans. (a)


26. PATH = /bin : /usr : /yourhome
      The file /bin/calender has the following line in it

cal 10 1997

The file /yourhome/calender has the following line in it

cal 5 1997

If the current directory is /yourhome and calender is executed

a) The calendar for May 1997 will be printed on screen
b) The calendar for Oct 1997 will be printed on screen
c) The calendar for the current month( whatever it is) will be printed
d) Nothing will get printed on screen
e) An error massage will be printed


27. What will be the result of the following program ?

char *gxxx()
{static char xxx[1024];
return xxx;
}

main()
{char *g="string";
strcpy(gxxx(),g);
g = gxxx();
strcpy(g,"oldstring");
printf("The string is : %s",gxxx());
}

a) The string is : string
b) The string is :Oldstring
c) Run time error/Core dump
d) Syntax error during compilation
e) None of these

Ans. (b)


28. What will be result of the following program?

void myalloc(char *x, int n)
{x= (char *)malloc(n*sizeof(char));
memset(x,\0,n*sizeof(char));
}

main()
{char *g="String";
myalloc(g,20);
strcpy(g,"Oldstring");
printf("The string is %s",g);
}

a) The string is : String
b) Run time error/Core dump
c) The string is : Oldstring
d) Syntax error during compilation
e) None of these


29. Which of the following function is used to repaint a window immediately

a) Sendmessage(hWnd,WM_PAINt,......)
b) InvalidateRect(.......)
c) MoveWindow
d) WM_COPY
e) None


30. Which function is the entry point for a DLL in MS Windows 3.1

a) Main
b) Winmain
c) Dllmain
d) Libmain
e) None

Ans. (b)


31. The standard source for standard input, standard output and standard 
error is

a) the terminal
b) /dev/null
c) /usr/you/input, /usr/you/output/, /usr/you/error respectively
d) None

Ans. (a)


32. What will be the result of the following program?

main()
{char p[]="String";
int x=0;
if(p=="String")
{printf("Pass 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
else
{
printf("Fail 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
}

a) Pass 1, Pass 2
b) Fail 1, Fail 2
c) Pass 1, Fail 2
d) Fail 1, Pass 2
e) syntax error during compilation


33. Which of the choices is true for the mentioned declaration ?

const char *p;
and
char * const p;

a) You can't change the character in both
b) First : You can't change the characterr & Second : You can;t change the 
pointer
c) You can't change the pointer in both 
d) First : You can't change the pointer & Second : You can't chanage the 
character
e) None


34. The redirection operators > and >>

a) do the same function
b) differ : > overwrites, while >> appends
c) differ : > is used for input while >> is used for output
d) differ : > write to any file while >> write only to standard output
e) None of these

Ans. (b)


35. The command grep first second third /usr/you/myfile

a) prints lines containing the words first, second or third from the file 
/usr/you/myfile
b) searches for lines containing the pattern first in the files
second, third, and /usr/you/myfile and prints them
c) searches the files /usr/you/myfiel and third for lines containing the 
words first or second and prints them
d) replaces the word first with the word second in the files third and 
/usr/you/myfile
e) None of the above

Ans. (b)
====================
1.有3台复印机(copier),平均每台每周工作42小时,每台每周最少工作35小时,问一

台复印机每周最多会工作多少小时?
  42*3 - 35*2 =56
2.在一个长11 meters,宽6 meters的房间里,铺上10 centimeters厚的水泥,问需要多

少水泥?
  11*6*0.1=6.6 cubic meters
3.某公司有两座办公楼,一天,第一座楼20%的复印机和第二座楼40%的复印机需要进
行维护,如果第一座楼拥有公司60%的复印机,问这天在维护的复印机是多少?
   20% * 60% + 40% * (1 - 60%) = 28%
4.要在一个接待室(reception room)里铺瓷砖,接待室的长18 meters,宽12 meters,
同时要修一条从大厅(hall)到楼梯(stair way)的通道(不铺瓷砖)占地50 square 
meters,允许铺设时有35%的浪费(wastage),1平方米瓷砖的价格是10美元,
问大约(approximately)要花多少钱?
   (18 * 12 - 50) * 135% * 10 = 2,200
5.某公司要做一个车辆更新,有2种车型,一种是X(忘了,用X代替),一种是van,新X每
liter油走20公里,新van每liter油走15公里,旧X每liter油走15公里,旧van每liter油

走12公里。现在要开15000公里,其中有60%由van来承担,问更新后将节省多少油?
  (15000 * 60% / 12 + 15000 * 40% / 15) - (15000 * 60% / 15 + 15000 * 40% / 
20) = 250
6.有2个行政打字员(administrative typist),A的速度是B的1 1/4 times,现在要打7
2页文件,问快的那个人打了多少页?
  72* 5/9 = 40
7.有一个呼叫中心,星期二的calls比星期一的1/2还多1/3,星期一和星期二的calls的
和是120,问星期二的calls是多少?
  48
8.有一个软件公司,1/2的人是系统分析员,2/5的人是软件工程师,有1/4的人两者都是

,问有多少人两者都不是?
  1 - 1/2 - 2/5 + 1/4= 0.35
9.有一个crate要做等比例(proportionally)的缩放,为了能够便于运输(shipment),c
rate的尺度(dimension)是72,96,48,如果缩放到三个尺度的和是200,问最长的那个尺
度要缩多少?
  96 * (1 - 200 / 216) = 64 / 9 = 7.1
10. 有一个矩形,长是宽的1 1/3 times,如果把每边增加1,面积将增加85,问长是多
少?
  48
11.有一个printer,一小时能打12,000页,早上8:30开始打印,中途被打断2次,每次5
分钟,13:15打完,问总共打了多少页?
  55,000

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -