2026年后端开发工程师笔试面试题及答案.docxVIP

  • 2
  • 0
  • 约7.13千字
  • 约 20页
  • 2026-01-26 发布于福建
  • 举报

2026年后端开发工程师笔试面试题及答案.docx

第PAGE页共NUMPAGES页

2026年后端开发工程师笔试面试题及答案

一、编程基础(共5题,每题10分,总分50分)

题目1(10分)

请用Python实现一个函数,接收一个字符串参数,返回该字符串中所有唯一字符的列表(字符不区分大小写)。例如,输入HelloWorld,输出[H,e,l,o,W,r,d]。

python

defunique_chars(s):

seen=set()

unique=[]

forcharins.lower():

ifcharnotinseen:

seen.add(char)

unique.append(char)

returnunique

解析:使用集合跟踪已见字符,列表存储唯一字符。通过转换为小写实现不区分大小写的比较。时间复杂度O(n),空间复杂度O(n)。

题目2(10分)

请写出一段Java代码,实现快速排序算法,并对数组[12,5,7,3,11,2,9]进行排序。

java

publicclassQuickSort{

publicstaticvoidquickSort(int[]arr,intlow,inthigh){

if(lowhigh){

intpivotIndex=partition(arr,low,high);

quickSort(a

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档