北电——又一份没有用到的笔试题

来源:互联网 发布:我的网络文明宣言 编辑:程序博客网 时间:2024/05/16 10:16

今年北电不来我们这招聘,郁闷。笔试题又白收集了。

 

发信人: ub (windows), 信区: Job
标 题: 北电笔试题目回忆
发信站: 珞珈山水 ( 2003101509:02:17 星期三), 站内信件
 
1,In a N*N int matrix, there is a Max int in every row,
so there are N Max ints in the N*N matrix, write a function
to find out and return the Min int among the N Max ints.
example:
N=3;
4 6 5
9 3 7
2 0 4
the function should return 4.
各行的最大值集合中的最小值
 
发信人: Lastcool (晃晃悠悠), 信区: Job
标 题: 北电笔试题目
发信站: 一网深情 (2003101323:06:09 星期一), 站内信件
 
一共4题
1.一道汉译英,没做,不知道内容
2.写个函数,把 '<' 和 '>' 和其中的字符全删掉,'<'和'>'个数是匹配的。
 比如"abc <ad<aa>aa> haha",删完后就是"abc haha"
char * change(const char *string)
{
       char * string2 = (char *)malloc(strlen(string)+1);
       const char *p = string;
       char *q = string2;
       int n = 0;
       while(*p)
       {
              if(*p == '(')
                     n++;
              else if(*p == ')')
                            n--;
              else {
                     if(!n)
                            *q++ = *p;
              }
              p++;
       }
       *q = '/0';
       return string2;
}
3.一个程序改错
4.一个C++程序,定义了一个State虚基类,再定义3个子类和一个Connection
 类,一个只有4,5行的main(),问输出结果,还要写出3个优点(极faint)
 
 
发信人: yike (以客), 信区: job
标 题: 广东北电面试题目
发信站: 饮水思源 (2003101722:43:37 星期五), 站内信件
 
 ★广东北电面试题目★
1.Tranlation(Mandatory)
    CDMA venders have worked hard to give CDMA roaming capabilities via t
he development of RUIM-essentially,a SIM card for CDMA handsets curren
tly being deployed in China for new CDMA operator China Unicom. Korean
 cellco KTF demonstrated earlier this year the ability to roam between
 GSM and CDMA using such cards.However,only the card containing the us
er's service data can roam-not the CDMA handset or the user's number (
except via call forwarding).
翻译:CDMA开发商一直致力于RUIM卡的开发,以此赋予CDMA漫游的能力。RUIM卡类似于SIM卡,事实上目前它已经被中国的CDMA运营商中国联通广泛使用。韩国手机制造企业KTF今年早些时候展示了使用此种卡在GSMCDMA网络中漫游的功能,但是,只有该卡包含的用户服务数据能够漫游,CDMA手机本身及用户号码则不能(除了呼叫前转业务)。
2.Programming(Mandatory)
Linked list
a.Implement a linked list for integers,which supports the insertafter(
insert a node after a specified node) and removeafter(remove the node
aftera specified node) methods;
b.Implement a method to sort the linked list to descending order.
答:题目的意思是实现一个整型链表,支持插入,删除操作(有特殊要求,都是在指定节点后进行操作),并写一个对链表数据进行降序排序的方法。
那我们不妨以一个线性链表进行编程。
 
// 单链表结构体为
typedef struct LNode
{
 int data;
 struct LNode *next;
}LNode, *pLinkList;
 
// 单链表类
class LinkList
{
private:
 pLinkList m_pList;
 int m_listLength;
public:
 LinkList();
 ~LinkList();
 bool InsertAfter(int afternode, int data);//插入
 bool RemoveAfter(int removenode);//删除
 void sort();//排序
};
 
 
实现方法
//insert a node after a specified node
 
bool LinkList::InsertAfter(int afternode, int data)
{
 LNode *pTemp = m_pList;
 int curPos = -1;
 if (afternode > m_listLength ) // 插入点超过总长度
 {
    return false;
 }
 while (pTemp != NULL)    // 找到指定的节点
 {
    curPos++;
    if (curPos == afternode)
    break;
    pTemp = pTemp->next;
 }
 if (curPos != afternode)   // 节点未寻到,错误退出
 {
    return false;
 }
 LNode *newNode = new LNode; // 将新节点插入指定节点后
 newNode->data = data;
 newNode->next = pTemp->next;
 pTemp->next = newNode;
 m_listLength++;
 return true;
}
 
 
//remove the node after a specified node
 
bool LinkList::RemoveAfter(int removenode)
{
 LNode *pTemp = m_pList;
  int curPos=-1;
 if (removenode > m_listLength) // 删除点超过总长度
 {
    return false;
 }
 
 // 找到指定的节点后一个节点,因为删除的是后一个节点
 while (pTemp != NULL)   
 {
    curPos++;
    if (curPos == removenode+1)
    break;
    pTemp = pTemp->next;
 }
 if (curPos != removenode)   // 节点未寻到,错误退出
 {
    return false;
 }
 LNode *pDel = NULL;    // 删除节点
 pDel = pTemp->next;
 pTemp->next = pDel->next;
 delete pDel;
 m_listLength--;
 return true;
}
 
 
//sort the linked list to descending order.
 
void LinkList::sort()
{
 if (m_listLength<=1)
 {
    return;
 }
 LNode *pTemp = m_pList;
 int temp;
 // 选择法排序
 for(int i=0;i<m_listLength-1;i++)
    for(int j=i+1;j<m_listLength;j++)
      if (pTemp[i].data<pTemp[j].data)
      {
        temp=pTemp[i].data;
        pTemp[i].data=pTemp[j].data;
        pTemp[j].data=temp;
      }
}
 
 
前两个函数实现了要求a,后一个函数sort()实现了要求b
 
3.Debugging(Mandatory)
a.For each of the following recursive methods,enter Y in the answer bo
x if themethod terminaters(assume i=5),Otherwise enter N.
static int f(int i){
    return f(i-1)*f(i-1);
    }
Ansewr: N,明显没有返回条件语句,无限递归了
static int f(int i){
    if(i==0){return 1;}
    else {return f(i-1)*f(i-1);}
    }
Ansewr: Y,当i0时可结束递归
static int f(int i){
    if(i==0){return 1;}
    else {return f(i-1)*f(i-2);}
    }
Ansewr: N因为i=1时,f(i-2)=f(-1),进入一个无限递归中
 
b.There are two errors in the following JAVA program:
static void g(int i){
    if(i==1){return;}
    if(i%2==0){g(i/2);return;}
    else {g(3*i);return;}
    }
please correct them to make sure we can get the printed-out result as below:
3   10 5   16 8   4   2   1
答:在第一个if语句前加 System.out.print(i+" ");
  else 里面的g(3*i)改为g(3*i+1)
发信人: dalumian (dlm), 信区: job
发信人: bclover (bclover), 信区: Job
标 题: Re: 北电的笔试题N简单
发信站: 武汉白云黄鹤站 (Sun Nov 12 11:11:47 2000), 站内信件
 
一段专业英语翻译 , 其它都是关于C/C++语言编程的
考Internet和浏览器和WWW万围网的知识 很容易翻译
两道编程:
1、数组合并 求最大公约数
2、括号匹配 数组局部返回无效 -- 考堆栈
两道程序调试(找错)
1、程序功能是判断A串是否B串的子串
2、一个简单的C++程序,找出其中的BUGS
easy!!
不过面试时对英语水平要考核哦!!
 
 
发信人: Bambu (竹蜻蜓※飞翔的☆)
发信站: 武汉白云黄鹤站 (2002112921:12:48 星期五)
 
广州北电目前由北电控股62%。
总部在顺德,研发中心在中山大学内。
 
今天的笔试题目一共4道。
前三道必答,最后一道选答。(嗨,估计只有答了最后一道的人才有资格
面试)
1、翻译题目:
optical ethernet is always available,global and univeral。。。
2、a、写出stack类,实现pop、push方法。
b、用以上stack类实现get、put方法。
用两个栈表示队列的方法
思路:
 假设两个栈 A B,且都为空。
 可以认为栈 A 为提供入队列的功能,栈 B 提供出队列的功能。
 入队列:入栈 A
 出队列:
 1 如果栈B 不为空,直接弹出栈 B 的数据。
 2 如果栈 B 为空,则依次弹出栈 A 的数据,放入栈 B 中,再弹出栈 B 的数据。
 
3、C++改错,一道用循环方法计算n!的题目。
4、一道C的改错题目。找到错误并改正。
关于二叉树遍历的。
 
人太多,必须全对才有面试机会
 
标 题: 北电网络(西交)笔试题
发信站: 兵马俑BBS (Sun Oct 19 08:04:46 2003), 转信(bbs.xjtu.edu.cn)
 
 
第一题:汉译英
        北电网络的开发者计划使来自于不同组织的开发者能够在北电网络的
        平台上开发全满的补充业务.北电网络符合工业标准的开放接口为补充
        业务的开展引入了无数商机.开发者计划为不同层面的开发者提供不同
        等级的资格,资格的划分还考虑到以下因素:补充业务与北电网络平台的
        集合程度,开发者团体与北电网络的合作关系,等等.
第二题:编程:
        将整数转换成字符串: void itoa(int,char);
        比如 itoa(-123,s[])则s="-123";
先确定int的位数,然后反序生成string
第三题:找BUG,在string1中查找string2的第一个位置,如果存在的话.否则返回NULL
        查找思路就是首先在string1中找到string2的首字母位置,计为cp,然后
        接着判断后继字母是否相同.如果遍历至string2结束符前都相同,则返回
        cp.
第四题:读C++代码,写出输出,并分析得益于什么结构
        使用的是"OBSERVER"设计模式,详见<<设计模式>>.
 
发信人: jviewer (jviewer), 信区: Job
标 题: 昨晚北电的笔试题
发信站: 武汉白云黄鹤站 (2003101510:23:44 星期三), 站内信件
 
前面3题打印出来,供大家参考:
1. Translation
Please translate the following paragraph into English:
北电网络是全球信息沟通变革的业界主导和先锋。它致力于为服务提供商
及企业级客户提供通信技术和基础设施。基于北电的技术和设备,我们的
客户能够自己创建包含IP数据,语音,多媒体的增值业务。这些业务遍布
无线网络,有线网络,企业网络和光纤网络。作为一家跨国公司,北电网
络业务涵盖全球超过150个国家。如想了解更多的资料,可以浏览
www.nortelnetworks.com
2. Programming
Write a function to merge two ascending order arrays a and b to another asce
nding order array c.
The elements of three arrays are all integer.
Note:arguments n, m of function merge() indicate the length of array a and
b respectively.
将两升序的数组ab合并成另一升序数组cnm分别是ab的长度
void merge(int a[],int n,int b[],int m,int *c)
{
……
}
 
3. Debugging
These procedure perform the encode/decode function such as the encode() changes the string "26a3t2" to "666_a_tttt_2".Please understand the code, find out the 2 bugs and offer your fix to them. Please note that the first parameter of encode does not include the underline char '_'.
加密解密,找出2bugencode第一个参数不能有--
int encode(char *instr,char *outstr)
{
       char *ip,*op,c;
       int t,n;
       ip=instr;
       op=outstr;
       while(*ip)
       {
              if(*ip>='0'&&*ip<='9'&&*(ip+1))
              {
                     n=*ip-'0';
                     c=*++ip;
                     for(int k=0;k<n;k++)
                            *op++=c;
              }
              else
                     *op++=*ip;
              *op++='_';
              ip++;
       }
       if(op>outstr)
              op--;
       *op='/0';
       return op-outstr;
}
int decode(char *instr,char *outstr)
{
       char *ip,*op,c;
       int n;
       ip=instr;
       op=outstr;
       while(*ip)
       {
              c=*ip;n=0;
              while(*ip==c&&n<10){ip++;n++;}
              if(n>1)*op++='0'+n;
              *op++=c;
              if(*ip=='_')ip++;
       }
       *op='/0';
       return op-outstr;
}
void main()
{
       char ins1[]="26a3t2";
       char ous1[20]="";
       char ins2[]="666_a_tttt_2";
       char ous2[20]="";
       int irc1=encode(ins1,ous1);
       int irc2=decode(ins2,ous2);
       printf("%s/n%s/n",ous1,ous2);
}
N应该为n+1
4.一个类似于windows命令Tracert命令的函数,看路由和网络时延。
题目给出了程序原代码,涉及socket编程,不过也不需看那些函数,只需看printf输出
些什么即可:)
问了5问:(我的解答)
q1此程序作用
a1:看路由和网络时延
q2此程序用法
a2:traceroute 服务器ip地址或域名
q3给定网络状况,写出程序输出
a3:略
q4:main函数作用
a4:接受并判断输入参数,调用traceloop
a5:traceloop函数作用
得到网络路由和网络时延