2023拉

淘宝笔试题目整理回来

上一篇 / 下一篇  2011-10-25 12:23:48 / 个人分类:软件测试理论

   总体而言,淘宝笔试题目很简单,如下是印象比较深刻的几个试题:

数据库方面】

1、SQL题目,都是一些左连接、右链接,以及多表查询数据(子查询)

2、删除关联多表的数据(级联);题目,大致为:删除A表中订单日期大于2010-10-01的信息,同时,关联表的相关记录自动删除;

【LINUX操作命令】

1、ps -ef|grep-admin/admin  请问admin的作用是什么?作用主要是这一命令将显示进程清单中所有包含单词admin的进程。

2、用两个文件a.txt;b.txt.使用linux命令,复制,a.txt文档倒数第十行的记录to b.txt文档;菜鸟啊,这个没有做出来。只知道一个cp.

【编程随便什么语言没有限制】

1、在一个输入字符的字符串中,查找第一个只出现一次的字符并输出。如下是两种实现的方法,大家可以参考。

=================================================================================================

如输入abaccdeff,输出b

/************************************************************************/
/* 使用multimap查找字符串中第一个只出现一次的字符                       */
/************************************************************************/
#include<map>
#include<iostream>
using namespace std;
int main()
{
char *str;
str=new char[20];
cin>>str;//输入字符串
int i;
int len=strlen(str);
multimap<char,int>m_str;
multimap<char,int>::iterator m1_Iter;
typedef pair<char,int>Int_Pair;
for(i=0;i<len;i++)
{
  m_str.insert(Int_Pair(str[i],i)); //向multimap中插入数据项,str[i]作为第一个key,i作为value
}
for(m1_Iter=m_str.begin();m1_Iter!=m_str.end();m1_Iter++)//输出multimap中的数据
  cout<<" "<<m1_Iter->first<<" "<<m1_Iter->second<<endl;
cout<<endl;
  i=0;
int count;
while(str[i]!='\0')//查找第一个只出现一次的字符
{
    count=m_str.count(str[i]);
cout<<str[i]<<"  count="<<count<<endl;
if(count==1)break;
     i++;
}

cout<<str[i];//输出

}

===================================================================================================

def findFirstOnlyOneChar_PYTHON( s ):
    N = len( s )
    H = { }
    for x in s:
        if not x in H:
            H[x] = 1
        else:
            H[x] = H[x]+1
    for x in s:
        if H[x]==1:
            return x,1
    return "",0
S = "I am a worker. Both you and I are chinese."
x,p = findFirstOnlyOneChar( S )
print ( "S=",S)
if p==1:
    print( " The first char only nce = ", x)
else:
    print( " not find")

print( "--- 使用Python特色的哈希表dict -----")
x,p = findFirstOnlyOneChar_PYTHON( S )
print ( "S=",S)
if p==1:
    print( " The first char only nce = ", x)
else:
    print( " not find")

S = "aabbcc最直观的想法是从头开始"
x,p = findFirstOnlyOneChar_PYTHON( S )
print ( "S=",S)
if p==1:
    print( " The first char only nce = ", x)
else:
    print( " not find")   

S = [12,1,78,12,78,99,100,1]
x,p = findFirstOnlyOneChar_PYTHON( S )
print ( "S=",S)
if p==1:
    print( " The first number only nce = ", x)
else:
    print( " not find")
测试设计
给了一个淘宝登陆页面,设计用例,这个就不用重复了,大家都懂得了。
==========================================================================================
大致就是这些题目,其余的都是一些很基础的。

TAG:

 

评分:0

我来说两句

Open Toolbar