本段 530 题 | 来源:backend + general + design | 知识点:其他/未分类
1. Q1. Which Google product do you use most frequently? Any suggestions on improving the same?
问题1. 你最常使用哪个谷歌产品?对改进它有什么建议?
- 知识点: 其他/未分类 (标签: Google product, improvement)
- 类型: technical | 难度: easy | 子类型:
- 分类: general
- 公司: Google
- id: 696470f0a9243c30c87057b8 | 官方: 是 | 付费: 否
答案:
(补充答案·AI 生成(AI-Generated))
示例:最常用 Google 搜索与 Gmail。改进建议:①搜索结果可增加「来源可信度/时效」一键过滤与可解释的排序依据;②Gmail 可在收件箱内置更强的自然语言检索(natural language search)与自动分类(如按项目/待办聚合)。回答要点是选一个你真用过的产品,给出具体、可落地的改进点,而不是泛泛而谈。
2. Q2. Can you provide some insight into the history of Google?
问题2. 你能谈谈谷歌的历史吗?
- 知识点: 其他/未分类 (标签: Google history)
- 类型: technical | 难度: easy | 子类型:
- 分类: general
- 公司: Google
- id: 696470f0a9243c30c87057bb | 官方: 是 | 付费: 否
答案:
(补充答案·AI 生成(AI-Generated))
要点:1996 年 Larry Page 与 Sergey Brin 在斯坦福启动 Backrub,基于 PageRank 做网页排序;1998 年在车库创立 Google,核心是把「组织全世界的信息」作为使命;1999 年后依靠搜索广告(AdWords/AdSense)建立商业模式;后续推出 Gmail(2004)、Google Maps(2005)、Android(2008)、Chrome(2008)、YouTube 收购(2006)、Google Cloud 等,发展为多元化科技公司。
3. 1. Which Google product do you use most frequently? Any suggestions on improving the same?
- 你最常使用哪个谷歌产品?对改进它有什么建议?
- 知识点: 其他/未分类 (标签: Google product, improvement)
- 类型: technical | 难度: easy | 子类型:
- 分类: general
- 公司: Google
- id: 696470f1a9243c30c87057d6 | 官方: 是 | 付费: 否
答案:
Your knowledge of Google’s services will be determined by your response to this question. Whatever response you give, make sure it’s enthusiastic and highlights how the company has impacted your life in some way.
你对谷歌服务的了解程度将由你对这个问题的回答决定。无论你给出什么回答,都要确保它充满热情,并突出该公司在某种程度上如何影响了你的生活。
I use the Google search engine a lot. The way we obtain information has been completely transformed by the Google search engine. I use Google Search to gain new information, learn new things, read news, etc. With its wide range of information and user-friendly interface, it is one of the most popular search engines.
我经常使用谷歌搜索引擎。谷歌搜索引擎彻底改变了我们获取信息的方式。我用谷歌搜索来获取新信息、学习新东西、阅读新闻等。凭借其广泛的信息资源和用户友好的界面,它是最受欢迎的搜索引擎之一。
Although the majority of Google’s search results are text-based, there is an increasing need for multimedia search, notably for images and videos. The user experience might be improved by increasing the precision and relevancy of multimedia search results.
尽管谷歌的大部分搜索结果都是基于文本的,但对多媒体搜索的需求日益增长,尤其是对图片和视频的搜索。提高多媒体搜索结果的精确度和相关性可以改善用户体验。
4. What is XML?
什么是XML?
- 知识点: 其他/未分类 (标签: interviewbit, accenture, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accenture
- id: 69b3791a58d557c902b97359 | 官方: 否 | 付费: 否
答案:
XML (Extensible Markup Language) is a mark-up language that states rules for document encoding formatting in such a way that it can be easily understood by both humans and machines. It is useful to describe the data, develop information formats, and share structured data through the internet.
XML(可扩展标记语言)是一种标记语言,它规定了文档编码和格式化规则,使得文档容易被人类和机器理解。它用于描述数据、开发信息格式以及通过互联网共享结构化数据。
- Data Science
- All Events
- My Events
5. Distinguish between Array and ArrayList provided by Java.
区分Java提供的Array和ArrayList。
- 知识点: 其他/未分类 (标签: interviewbit, accenture, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accenture
- id: 69b3791b58d557c902b97371 | 官方: 否 | 付费: 否
答案:
| Array | ArrayList |
|---|---|
| An array is of fixed length 数组长度固定 | ArrayList is of variable length ArrayList长度可变 |
| Length of the array cannot be changed once created 数组创建后长度不可更改 | Length of the array can be changed after creation 数组长度在创建后可以更改 |
| It can store both primitive types and objects 它可以存储基本类型和对象 | It can store only objects, not primitives(it automatically converts primitive type to object) 它只能存储对象,不能存储基本类型(它会自动将基本类型转换为对象) |
| Using an assignment operator we can store elements into an array 使用赋值运算符可以将元素存储到数组中 | With the help of add() method elements are stored into an ArrayList 借助add()方法将元素存储到ArrayList中 |
| An array can be multi-dimensional 数组可以多维 | ArrayList is always one-dimensional ArrayList始终是一维的 |
6. Can you differentiate between “var++” and “++var”?
你能区分“var++”和“++var”吗?
- 知识点: 其他/未分类 (标签: interviewbit, accenture, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accenture
- id: 69b3791b58d557c902b9737a | 官方: 否 | 付费: 否
答案:
Expressions “var++” and “++var” are used for incrementing the value of the “var” variable.
表达式“var++”和“++var”用于增加“var”变量的值。
“var++” will first give the evaluation of expression and then its value will be incremented by 1, thus it is called as post-incrementation of a variable. “++var” will increment the value of the variable by one and then the evaluation of the expression will take place, thus it is called pre-incrementation of a variable. Example:
“var++”将首先给出表达式的求值结果,然后其值将增加1,因此它被称为变量的后自增。“++var”将首先将变量的值增加1,然后进行表达式的求值,因此它被称为变量的前自增。示例:
/ C program to demonstrate the difference between var++ and ++var /
/ 用于演示 var++ 与 ++var 区别的C程序 /
include<stdio.h>
int main()
int main()
{
int x,y;
int x,y;
x=7, y=1;
x=7, y=1;
printf("%d %d\n", x++, x); //will generate 7, 8 as output
printf("%d %d\n", x++, x); //将生成7, 8作为输出
printf("%d %d", ++y, y); //will generate 2, 2 as output
printf("%d %d", ++y, y); //将生成2, 2作为输出
}
7. Explain memory allocation process in C.
解释C语言中的内存分配过程。
- 知识点: 其他/未分类 (标签: interviewbit, accenture, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accenture
- id: 69b3791b58d557c902b9737d | 官方: 否 | 付费: 否
答案:
- Memory allocation process indicates reserving some part of the memory space based on the requirement for the code execution.
- There are two types of memory allocation done in C:
Static memory allocation: The memory allocation during the beginning of the program is known as static memory allocation. In this type of memory allocation allocated memory size remains fixed and it is not allowed to change the memory size during run-time. It will make use of a stack for memory management.
静态内存分配:程序开始时进行的内存分配被称为静态内存分配。在这种内存分配类型中,分配的内存大小保持固定,并且不允许在运行期间改变内存大小。它将使用栈进行内存管理。
Dynamic memory allocation: The memory allocation during run-time is considered as dynamic memory allocation. We can mention the size at runtime as per requirement. It will make use of heap data structure for memory management. The required memory space can be allocated and deallocated from heap memory. It is mainly used in pointers. Four types of the pre-defined function that are used to dynamically allocate the memory are given below: malloc() calloc() realloc() free()
动态内存分配:运行期间进行的内存分配被视为动态内存分配。我们可以根据需求在运行时指定大小。它将使用堆数据结构进行内存管理。所需的内存空间可以从堆内存中分配和释放。它主要用于指针。以下是四种用于动态分配内存的预定义函数:malloc() calloc() realloc() free()
8. Interview Preparation Tips
面试准备技巧
- 知识点: 其他/未分类 (标签: interviewbit, accenture, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accenture
- id: 69b3791b58d557c902b9738f | 官方: 否 | 付费: 否
答案:
The interview is basically a way of testing your ability to think, code and solve problems. The technical interview round may seem tough at first, but with appropriate preparation, you can easily ace it. Some tips to help you get succeeded in your Accenture interview are mentioned below: - Learn all the concepts: If you have to ace the technical interview at Accenture, you have to learn the concepts such as coding, algorithm, data structures, etc. When preparing & practicing for the interview, focus on algorithm-based and system design problems.
面试基本上是一种测试你思考、编码和解决问题能力的方式。技术面试轮次起初可能看起来困难,但通过适当的准备,你可以轻松应对。以下是一些帮助你在埃森哲面试中成功的提示:- 学习所有概念:如果你要在埃森哲的技术面试中表现出色,你必须学习编码、算法、数据结构等概念。在准备和练习面试时,重点关注基于算法和系统设计的问题。
- Improve your problem-solving skills: With proper practice, you will be able to solve any type of problem. This specific skill can only be perfected when you consistently solve questions every day and helps you in changing the way you understand and approach any given problem.
- Clarify your doubts: Join some relevant online forums or take the help of any useful resources to clarify your doubts before the interview process. You should be well-prepared to face any kind of question during the interview.
- Take up mock interviews: Try to practice through mock interviews, which will essentially help you to get feedback on areas that you need to improve on. Also, the mock preparations will boost your confidence to face real interviews.
- Be calm and composed: You have to stay calm during the interview. Take your time to properly understand the questions given to you. If needed, try to draft out a strategy before you start solving any coding questions.
- Ask questions: At the end of the interview, you have to be prepared to ask questions to the interviewer. This will definitely show your interest and insight into the company and the position that you are applying for.
9. Does Accenture ask coding questions?
埃森哲会问编码问题吗?
- 知识点: 其他/未分类 (标签: interviewbit, accenture, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accenture
- id: 69b3791b58d557c902b97392 | 官方: 否 | 付费: 否
答案:
Yes, the candidates will be asked coding questions in technical interviews. In this particular round, the candidates have to face questions based on programming concepts of different technologies like C, C++, Java, etc.
是的,候选人将在技术面试中面临编码问题。在特定轮次中,候选人必须面对基于不同技术(如C、C++、Java等)的编程概念问题。
10. How do I prepare for Accenture interview?
我如何准备埃森哲面试?
- 知识点: 其他/未分类 (标签: interviewbit, accenture, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accenture
- id: 69b3791b58d557c902b97395 | 官方: 否 | 付费: 否
答案:
Following are the few points that you can take care of while preparing for the Accenture interview: - Do your homework: Mainly Understand the job role for which you are applying and also learn a few company-related information about Accenture. Research on these things in advance, whether that is exploring the Accenture’s company website or discussing with a friend who works in Accenture.
以下是在准备埃森哲面试时需要注意的几个要点:- 做好功课:主要了解你申请的职位角色,并学习一些关于埃森哲的公司相关信息。提前研究这些事情,无论是浏览埃森哲的公司网站,还是与在埃森哲工作的朋友讨论。
- Think through your answers: While the Accenture interview topics can range from different technical aspects and personal skills, prepare in advance as to how you can answer the questions. Think about the requirements of the role, your accomplishments, and your personal aspirations, which essentially helps you in preparing for the interview conversations.
- Have questions ready: Most of the time, your interviewer will give you time for asking questions. So it is important to have a question ready to ask! Not one that has already been answered, but one that demonstrates your insightfulness & interest in the position and also about the company. For more tips check the above section.
11. Is Accenture interview hard?
埃森哲面试难吗?
- 知识点: 其他/未分类 (标签: interviewbit, accenture, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accenture
- id: 69b3791b58d557c902b97398 | 官方: 否 | 付费: 否
答案:
The Accenture interview might be a bit challenging, but can easily be cracked with proper preparations. Since Accenture is a high-performing company that wants to hire the best people possible, the different interview rounds at Accenture are challenging compared to regular interviews at large corporate companies. But the fact is that, with the perfect preparations, the interview can actually become relatively easy to succeed in the Accenture recruitment process.
埃森哲的面试可能颇具挑战性,但只要做好充分准备,就能轻松应对。由于埃森哲是一家追求卓越的公司,希望招募最优秀的人才,其面试环节相比大型企业的常规面试更具挑战性。但事实上,只要准备充分,在埃森哲的招聘流程中取得成功实际上会变得相对容易。
12. Why should we hire you in Accenture?
为什么我们要在埃森哲聘用你?
- 知识点: 其他/未分类 (标签: interviewbit, accenture, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accenture
- id: 69b3791b58d557c902b9739b | 官方: 否 | 付费: 否
答案:
The above question can essentially be answered in the following way- “It is a wonderful opportunity for me to get interviewed in such a renowned company. I’m confident that Accenture is an excellent platform for me to prove my skills & knowledge in the corporate world. Well, this job role is what I am interested to work for. Even though I am a fresher, I assure you that I will give my best and work to my fullest potential, so that I can contribute as much as I can towards the growth and success of this great brand. So I’m really excited to work with Accenture.”
上述问题基本上可以这样回答:“能有机会在这样一家知名公司参加面试,对我来说是一次绝佳的机会。我相信埃森哲是一个优秀的平台,可以让我在企业界展示自己的技能和知识。而且,这个职位正是我感兴趣的工作方向。尽管我是应届生,但我保证会尽最大努力,充分发挥我的潜力,为这一伟大品牌的发展与成功贡献我的全部力量。所以,我非常期待能与埃森哲合作。”
13. What is the kind of work environment in Accenture?
埃森哲的工作环境是怎样的?
- 知识点: 其他/未分类 (标签: interviewbit, accenture, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accenture
- id: 69b3791b58d557c902b9739e | 官方: 否 | 付费: 否
答案:
The prime reason why Accenture is a great place to work or build your career is because of its robust work environment. From varied areas of expertise to backgrounds, from everywhere around the world, you will work and learn from some of the smartest, most generous people anywhere. Irrespective of the work locations, Accenture’s multi-functional areas essentially support creativity, innovation, learning & development, and teamwork.
埃森哲之所以是工作或发展职业生涯的理想之地,主要原因是其稳健的工作环境。从专业领域到背景,来自世界各地的你,将与最聪明、最慷慨的人一起工作和学习。无论工作地点在哪里,埃森哲的多职能领域都大力支持创造力、创新、学习与发展以及团队协作。
14. What is the freshers’ salary in Accenture?
埃森哲的应届生薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, accenture, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accenture
- id: 69b3791b58d557c902b973a1 | 官方: 否 | 付费: 否
答案:
Accenture pays a competitive salary package for freshers. The salary for freshers at Accenture can range from Rs 2.2 Lakhs to Rs 5 Lakhs per annum. Typically, the average fresher's salary in Accenture is Rs 3.9 Lakhs per annum as per the details furnished in Ambitionbox .
埃森哲为应届生提供具有竞争力的薪资待遇。埃森哲应届生的年薪范围大约在22万卢比至50万卢比之间。根据Ambitionbox上提供的信息,埃森哲应届生的平均年薪通常为39万卢比。
15. Why do you want to join Accenture?
你为什么想加入埃森哲?
- 知识点: 其他/未分类 (标签: interviewbit, accenture, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accenture
- id: 69b3791b58d557c902b973a4 | 官方: 否 | 付费: 否
答案:
This question can be answered by mentioning the following major points with respect to Accenture: - Brand Name: Accenture is a renowned brand in the market, which is a prime reason to pursue a job in this organization. The company is more into technology and operations that can be a perfect fit for any IT professionals.
回答这个问题时,可以提及以下关于埃森哲的主要要点:- 品牌知名度:埃森哲是市场上的知名品牌,这是在此组织求职的主要原因。该公司更侧重于技术和运营,非常适合IT专业人士。
- Work-Life Balance: Accenture offers a good work-life balance to its employees. Essentially you can give the time to your personal and family aspects also.
- Colleagues: The company recruits candidates in different levels - entry, mid, and top, which is making the employees with diverse experience and knowledge come forward and work as a team. The Accenture employees like working in this organization due to co-operative team members & colleagues.
- Work Environment: Accenture provides a favorable work environment and compels the employees to work together in a learning environment.
- Quality of Work: The Employees are offered qualitative work that makes it more exciting to work at Accenture. The company offers plenty of opportunities to learn and grow from time to time.
16. How long is the interview process at Accenture?
埃森哲的面试流程需要多长时间?
- 知识点: 其他/未分类 (标签: interviewbit, accenture, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accenture
- id: 69b3791b58d557c902b973aa | 官方: 否 | 付费: 否
答案:
On average, the Accenture interview process will usually go around one month from beginning to end, although it might take longer during busy recruitment periods. Once the online application and interviews of a particular candidate are completed, Accenture normally aims to respond to their decision within 10–15 working days. So if you have cleared an assessment test, you should be receiving positive feedback within 2 weeks from its conclusion.
平均而言,埃森哲的面试流程从开始到结束通常大约需要一个月,但在招聘高峰期可能会更长。一旦某位候选人的在线申请和面试完成,埃森哲通常会在10至15个工作日内回复结果。所以,如果你通过了评估测试,你应该会在测试结束后两周内收到积极反馈。
Accenture receives a large number of applications for different roles every year. So there is a higher chance that it can close the applications earlier than expected, so be sure to apply early.
埃森哲每年都会收到大量不同职位的申请。因此,申请提前关闭的可能性较大,所以请务必尽早申请。
17. Where do you want to see yourself in 5 years from now in Accenture?
在埃森哲,你希望5年后的自己处于什么位置?
- 知识点: 其他/未分类 (标签: interviewbit, accenture, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accenture
- id: 69b3791b58d557c902b973ad | 官方: 否 | 付费: 否
答案:
The above tricky question can be answered as mentioned below: “In the next five years, I want to see myself in a senior role or leading a team, working with a great bunch of professionals at Accenture. I would like to be known globally as a passionate expert in my area of expertise. Overall, I will definitely want to cherish the journey at Accenture, which I hope probably going to be one of the best in the world.”
上述棘手问题可以这样回答:“在接下来的五年里,我希望自己能在埃森哲担任高级职位或领导一个团队,与一群优秀的专业人士共事。我希望在全球范围内被认可为我专业领域内充满热情的行家。总的来说,我一定会珍惜在埃森哲的旅程,我希望这可能会是世界上最好的经历之一。”
18. What are the rounds in Accenture interview?
埃森哲面试包括哪些环节?
- 知识点: 其他/未分类 (标签: interviewbit, accenture, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accenture
- id: 69b3791b58d557c902b973b0 | 官方: 否 | 付费: 否
答案:
The Accenture interview process will generally involve the following three rounds:
埃森哲的面试流程通常包括以下三个环节:
Online Assessment Test 2. Technical Interview 3. HR Interview
- 在线评估测试 2. 技术面试 3. 人力资源面试
For experienced candidates also, the interview rounds will usually remain the same. But in the case of some prominent roles or based on your experience level, you may have to face two or more rounds of technical interviews followed by an HR interview. Check the above section for a detailed interview process.
对于有经验的候选人,面试轮次通常也会保持相同。但在某些重要职位或根据您的经验水平,您可能需要面对两轮或更多轮技术面试,之后再进行HR面试。请查看上述部分以了解详细的面试流程。
Coding Problems
0/9
Easy Problems
简单问题
Math
数学
Arrays
数组
Strings
字符串
Time Complexity
时间复杂度
Sum of 7's Multiple
7的倍数之和
Easy
简单
29.52 Mins
29.52分钟
Solve
解答
Find Last Digit
查找最后一位数字
Easy
简单
29.59 Mins
29.59分钟
Solve
解答
Last digit K count
最后一位数字K计数
Very Easy
非常简单
28.36 Mins
28.36分钟
Solve
解答
Greater of Lesser
较大与较小
Very Easy
非常简单
15.0 Mins
15.0分钟
Solve
解答
Frequency of Characters
字符频率
Very Easy
非常简单
17.54 Mins
17.54分钟
Solve
解答
Spiral Matrix
螺旋矩阵
Easy
简单
30.41 Mins
30.41分钟
Solve
解答
Collatz Conjecture
考拉兹猜想
Very Easy
非常简单
23.58 Mins
23.58分钟
Solve
解答
Digital Root
数字根
Easy
简单
16.27 Mins
16.27分钟
Solve
解答
Product of All
所有元素的乘积
Easy
简单
34.4 Mins
34.4分钟
Solve
解答
0/1
Intermediate Problems
中级问题
Dynamic Programming
动态规划
Double Increasing Series
双重递增数列
Medium
中等
43.9 Mins
43.9分钟
Solve
解答
19. What do you understand by Paging and Segmentation? Differentiate between them.
你如何理解分页和分段?它们之间有什么区别?
- 知识点: 其他/未分类 (标签: interviewbit, accolite, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accolite Digital
- id: 69b3791b58d557c902b973cb | 官方: 否 | 付费: 否
答案:
- Paging: Paging is a memory management approach in which the process address space is divided into uniformly sized pieces known as pages (size is the power of 2, between 512 bytes and 8192 bytes). The number of pages in the process is used to determine its size. Similarly, main memory is partitioned into small fixed-size blocks of (physical) memory called frames, with the size of a frame being the same as that of a page in order to maximize main memory utilization and avoid external fragmentation.
- Segmentation: Segmentation is a memory management strategy in which each job is broken into numerous smaller segments, one for each module, each of which contains parts that execute related functions. Each segment corresponds to a different program's logical address space. When a process is ready to run, its associated segmentation is loaded into non-contiguous memory, though each segment is placed into a contiguous block of available memory. Memory segmentation is similar to paging, except that segments are changeable in length, whereas paging pages are fixed in size.
The following table lists the differences between Paging and Segmentation :
下表列出了分页和分段之间的区别:
| Paging 分页 | Segmentation 分段 |
|---|---|
| A process address space is divided into fixed-size pieces called pages in paging. 在分页中,进程地址空间被划分为固定大小的片段,称为页。 | A process address space is divided into pieces of differing sizes during segmentation. 在分段中,进程地址空间被划分为大小不同的片段。 |
| The memory is divided into pages by the operating system. 内存由操作系统划分为页。 | The compiler is in charge of determining the segment size, virtual address, and actual address. 编译器负责确定段大小、虚拟地址和实际地址。 |
| The size of a page is governed by the amount of memory available. 页的大小由可用内存量决定。 | The user determines the size of each section. 用户决定每个部分的大小。 |
| In terms of memory access, the paging strategy is faster. 在内存访问方面,分页策略更快。 | Segmentation is slower than paging. 分段比分页慢。 |
| Internal fragmentation might result from paging because certain pages may go unused. 分页可能导致内部碎片,因为某些页可能未被使用。 | Because certain memory blocks may not be accessed at all, segmentation might result in external fragmentation. 分段可能导致外部碎片,因为某些内存块可能完全无法访问。 |
20. Given an array of distinct integers, you need to find all the triplets whose sum is equal to 0.
给定一个由不同整数组成的数组,你需要找出所有和为0的三元组。
- 知识点: 其他/未分类 (标签: interviewbit, accolite, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accolite Digital
- id: 69b3791b58d557c902b973d4 | 官方: 否 | 付费: 否
答案:
Example:
示例:
Input: arr = {1, -2, 1, 0, 5}
输入:arr = {1, -2, 1, 0, 5}
Output: [1, -2, 1]
输出:[1, -2, 1]
Explanation: In the given array, only the triplet [1, -2, 1] sums up to 0.
说明:在给定的数组中,只有三元组 [1, -2, 1] 的和为 0。
Input: arr = {0, -1, 2, -3, 1}
输入:arr = {0, -1, 2, -3, 1}
Output: [0, -1, 1], [2, -3, 1] - Approach 1: The basic approach involves running three loops and checking if the total of three elements is zero or not one by one. Print elements if the sum of the three elements is 0. Since this is a very straightforward approach, we are not providing the implementation of this approach.
输出:[0, -1, 1], [2, -3, 1] - 方法 1:基本方法涉及运行三个循环,并逐一检查三个元素的总和是否为零。如果三个元素的和为 0,则打印元素。由于这是一种非常直接的方法,我们不提供此方法的实现。
Approach 2: In this approach, we use the concept of hashing. We run a nested loop with two loops, the outer loop from 0 to n-2 and the inner loop from i+1 to n-1. We check whether the hashmap contains the sum of the ith and jth elements multiplied by -1. If the hashmap contains the element, we have found a triplet and we print it.
Solution Code:解决方案代码:
//function to print all the triplets in a given array whose sum equals 0.
//函数用于打印给定数组中所有和为 0 的三元组。
void printTriplets(int arr[], int n)
void printTriplets(int arr[], int n)
{
bool flag = false;
bool flag = false;
for (int i=0; i<n-1; i++)
for (int i=0; i<n-1; i++)
{
unordered_sethash_map;
unordered_sethash_map;
for (int j=i+1; j<n; j++)
for (int j=i+1; j<n; j++)
{
int third_element = -(arr[i] + arr[j]);
int third_element = -(arr[i] + arr[j]);
if (hash_map.find(third_element) != hash_map.end())
if (hash_map.find(third_element) != hash_map.end())
{
cout << third_element << arr[i] << arr[j] << "\n";
cout << third_element << arr[i] << arr[j] << "\n";
flag = true;
flag = true;
}
else
else
hash_map.insert(arr[j]);
hash_map.insert(arr[j]);
}
}
if (flag == false)
if (flag == false)
cout << "There is no such triplet in the given array." << endl;
cout << "给定数组中没有这样的三元组。" << endl;
}
Time Complexity: O(n^2)
时间复杂度:O(n^2)
Space Complexity: O(n)
空间复杂度:O(n)
Here, n is the size of the array
这里,n 是数组的大小
Explanation: In the above code, the function printTriplets() takes input of an array of distinct elements and prints all the triplets whose sum equals 0. We keep track of the element visited with the help of a hashmap.
解释:在上述代码中,函数 printTriplets() 接收一个包含不同元素的数组作为输入,并打印所有和为 0 的三元组。我们借助哈希表来跟踪已访问的元素。
Approach 3: In this approach, we aim to optimize the space complexity of the above approach. We first sort the input array in ascending order. We create two variables low = i + 1 and high = n – 1 for each index i. - If the total of array[i], array[low], and array[high] is equal to zero then print this triplet and increment low and decrement high.
方法 3:在这种方法中,我们旨在优化上述方法的空间复杂度。我们首先将输入数组按升序排序。对于每个索引 i,我们创建两个变量 low = i + 1 和 high = n – 1。 - 如果 array[i]、array[low] 和 array[high] 的总和等于零,则打印此三元组,并递增 low、递减 high。
- If the sum is less than zero, increase the value of low; as the array is sorted, the sum will increase as the value of low is increased, so array[low+1] > array [low].
- If the sum is larger than zero, reduce the value of high; as the array is sorted, the sum will decrease as the value of high is decreased, so array[high-1] Solution Code:
void printTriplets(int arr[], int n)
void printTriplets(int arr[], int n)
{
bool flag = false;
bool flag = false;
// Sorting the given input array
// 对给定的输入数组进行排序
sort(arr, arr+n);
sort(arr, arr+n);
for (int i=0; i<n-1; i++)
for (int i=0; i<n-1; i++)
{
// initialize left and right
// 初始化左和右
int low = i + 1;
int low = i + 1;
int high = n - 1;
int high = n - 1;
int cur = arr[i];
int cur = arr[i];
while (low < high)
while (low < high)
{
if (cur + arr[low] + arr[high] == 0)
if (cur + arr[low] + arr[high] == 0)
{
// We print the elements if it's sum is zero
// 如果三个元素的和为零,则打印这些元素
cout << cur << arr[low] << arr[high] << "\n";
cout << cur << arr[low] << arr[high] << "\n";
low++;
low++;
high--;
high--;
}
// If sum of three elements is less than zero then we increment in left
// 如果三个元素的和小于零,则在左侧增加索引
else if (cur + arr[low] + arr[high] < 0)
else if (cur + arr[low] + arr[high] < 0)
low++;
low++;
// if sum is greater than zero then we decrement in right side
// 如果和大于零,则在右侧减少索引
else
else
high--;
high--;
}
}
if (flag == false)
if (flag == false)
cout << " No Triplet flag" << endl;
cout << " 没有三胞胎三元组" << endl;
}
Time Complexity: O(n^2)
时间复杂度:O(n^2)
Space Complexity: O(1)
空间复杂度:O(1)
Explanation: In the above code, the function printTriplets takes an array and the size of the array as an input parameter. We first sort the array and then iterate through every possible triplet that may sum up to 0.
解释:在上述代码中,函数printTriplets将数组和数组大小作为输入参数。我们首先对数组进行排序,然后遍历所有可能的和为0的三元组。
21. What is the Accolite Eligibility Criteria for Software engineers?
Accolite软件工程师的资格标准是什么?
- 知识点: 其他/未分类 (标签: interviewbit, accolite, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accolite Digital
- id: 69b3791b58d557c902b973f1 | 官方: 否 | 付费: 否
答案:
Generally, the eligibility criteria for a job opening at Accolite includes the following: - B.E/ B. Tech / Master’s Degree Graduates with 60% throughout the academics and no backlogs
一般来说,Accolite职位空缺的资格标准包括以下内容:- 工程学士/技术学士/硕士毕业生,学业成绩达到60%且无挂科记录
- Domain – Engineering & Technology
- Courses & Discipline: Students from BE/ B.Tech/ ME/ MTech/ MCA/ M.Sc. from any specialization offered by a recognized university/ college are eligible.
22. Why should I hire you Accolite?
为什么我应该聘用你,Accolite?
- 知识点: 其他/未分类 (标签: interviewbit, accolite, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accolite Digital
- id: 69b3791b58d557c902b973f4 | 官方: 否 | 付费: 否
答案:
The duty of the interviewer is to find the best candidate for the job. The majority of candidates that advance to the interview stage are qualified for the position. So simply possessing the qualifications will not be enough to set you apart from the competition. Once you've been asked to an interview, it's largely a competition to see who can pitch themselves the best. This is why one of their favourite inquiries is "why should we hire you." Your interviewer is asking you to pitch yourself and your qualifications as the best candidate for the job with this question. It's your task to persuade him that: - YOU have the ability to complete the task and provide the firm with outstanding outcomes.
面试官的职责是为职位找到最佳候选人。进入面试阶段的大多数候选人都符合职位要求。因此,仅仅具备资格不足以让你在竞争中脱颖而出。一旦你被邀请参加面试,这基本上是一场看谁推销自己最好的竞争。这就是为什么他们最喜欢问的问题之一是“为什么我们应该聘用你”。你的面试官通过这个问题要求你推销自己和你的资格,作为该职位的最佳候选人。你的任务是说服他:- 你有能力完成任务并为公司带来卓越成果。
- YOU will blend in seamlessly and make a valuable contribution to the team because you have a unique combination of talents and experience.
Hiring YOU will make him appear intelligent while making his life easier.
The better you are at persuasion (or selling yourself), the more likely you are to be chosen for the job. So, let's get you ready with some tried-and-true "why should we hire you" responses.你越擅长说服(或推销自己),就越有可能被选中担任该职位。所以,让我们为你准备一些经过验证的“为什么我们应该聘用你”的回应。
23. What is the Accolite digital lateral hiring challenge?
什么是Accolite数字横向招聘挑战?
- 知识点: 其他/未分类 (标签: interviewbit, accolite, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accolite Digital
- id: 69b3791b58d557c902b973f7 | 官方: 否 | 付费: 否
答案:
The Accolite Digital Hiring Challenge is a Fresher Hiring competition for the position of Software Engineer. The competition usually runs through for about one and a half months. To take part in the hiring process, go to www.eduthrill.com and create an account. Usually, there are five rounds in total, each of which is an elimination round.
Accolite数字招聘挑战是一项针对软件工程师职位的应届生招聘竞赛。该竞赛通常持续大约一个半月。要参加招聘流程,请访问www.eduthrill.com并创建一个账户。通常,总共有五轮,每轮都是淘汰赛。
24. Is Accolite a product based company?
Accolite是产品型公司吗?
- 知识点: 其他/未分类 (标签: interviewbit, accolite, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Accolite Digital
- id: 69b3791b58d557c902b973fa | 官方: 否 | 付费: 否
答案:
No, Accolite is a service-based company.
不,Accolite是一家服务型公司。
25. How do you calculate the size of the structure?
如何计算结构体的大小?
- 知识点: 其他/未分类 (标签: interviewbit, amdocs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Amdocs
- id: 69b3792d58d557c902b98473 | 官方: 否 | 付费: 否
答案:
The size of the structure can be calculated straightforwardly in C using the sizeof() operator.
在C语言中,可以使用sizeof()操作符直接计算结构体的大小。
Example:
示例:
include <stdio.h>
// Declaring a structure named "student"
// 声明一个名为“student”的结构体
struct scaler {
struct scaler {
int emp;
int emp;
char name[20];
char name[20];
char position;
char position;
};
int main()
int main()
{
struct scaler ib; // Declaring a structure type data named "ib"
struct scaler ib; // 声明一个名为“ib”的结构体类型数据
int size = sizeof(ib);
int size = sizeof(ib);
printf("Size of Structure : %d", size);
printf("结构体大小:%d", size);
return 0;
return 0;
}
Output:
输出:
Size of Structure : 28
结构体大小:28
26. Can two numbers be swapped without the use of a third variable?
不使用第三个变量能否交换两个数字?
- 知识点: 其他/未分类 (标签: interviewbit, amdocs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Amdocs
- id: 69b3792d58d557c902b98476 | 官方: 否 | 付费: 否
答案:
Yes, two numbers can be swapped without using a third variable.
是的,两个数字可以在不使用第三个变量的情况下交换。
//Java program to swap two numbers
//用于交换两个数字的Java程序
//without using third variable
//不使用第三个变量
import java.util.Scanner;
import java.util.Scanner;
public class Main
public class Main
{
public static void main(String args[])
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
Scanner sc = new Scanner(System.in);
System.out.println("Enter two numbers: ");
System.out.println("输入两个数字:");
//consider two numbers as 20 and 10
//假设两个数字为20和10
int num1 = sc.nextInt();
int num1 = sc.nextInt();
int num2 = sc.nextInt();
int num2 = sc.nextInt();
num1 = num1 + num2; //num1 = 20 + 10 = 30
num1 = num1 + num2; //num1 = 20 + 10 = 30
num2 = num1 - num2; //num2 = 30 - 10 = 20
num2 = num1 - num2; //num2 = 30 - 10 = 20
num1 = num1 - num2; //num1 = 30 - 20 = 10
num1 = num1 - num2; //num1 = 30 - 20 = 10
System.out.println("Numbers after swapping");
System.out.println("Numbers after swapping");
System.out.println("Num1= " + num1 + " " + "Num2= " + num2);
System.out.println("Num1= " + num1 + " " + "Num2= " + num2);
}
}
Input:
输入:
Enter two numbers:
输入两个数字:
20
10
Output:
输出:
Numbers after swapping
交换后的数字
Num1= 10 Num2= 20
Num1= 10 Num2= 20
27. Write a program to count the number of non-leaf nodes in a tree.
编写程序统计树中非叶节点的数量。
- 知识点: 其他/未分类 (标签: interviewbit, amdocs, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Amdocs
- id: 69b3792d58d557c902b98479 | 官方: 否 | 付费: 否
答案:
When a node does not have any child nodes (both left and right), it is referred to as a leaf node, while nodes that contain either left or right child nodes or both are referred to as non-leaf nodes.
当一个节点没有任何子节点(左和右)时,它被称为叶节点,而包含左或右子节点或两者的节点则被称为非叶节点。
Example:
示例:
Given a BST, count the total number of non-leaf nodes in the tree.
给定一个BST,统计树中非叶节点的总数。
Input:
输入:
Code:
代码:
// Java program to count number of non-leaf nodes in BST
// 用于统计BST中非叶节点数量的Java程序
class Main
class Main
{
static class Node
static class Node
{
int data;
int data;
Node left;
Node left;
Node right;
Node right;
}
static Node newNode(int data)
static Node newNode(int data)
{
Node node = new Node();
Node node = new Node();
node.data = data;
node.data = data;
node.left = null;
node.left = null;
node.right = null;
node.right = null;
return (node);
return (node);
}
//Computes number of non-leaf nodes in a tree
//计算树中非叶子节点的数量
static int countNonleaf(Node root)
static int countNonleaf(Node root)
{
if (root == null || (root.left == null &&
if (root == null || (root.left == null &&
root.right == null))
root.right == null))
return 0;
return 0;
// If root is not NULL and a child of root is also NULL
//如果根不为空且根的子节点也为空
return 1 + countNonleaf(root.left) + countNonleaf(root.right);
return 1 + countNonleaf(root.left) + countNonleaf(root.right);
}
public static void main(String[] args)
public static void main(String[] args)
{
Node root = newNode(70);
Node root = newNode(70);
root.left = newNode(32);
root.left = newNode(32);
root.right = newNode(85);
root.right = newNode(85);
root.left.left = newNode(15);
root.left.left = newNode(15);
root.left.right = newNode(44);
root.left.right = newNode(44);
root.right.left = newNode(74);
root.right.left = newNode(74);
root.right.right = newNode(98);
root.right.right = newNode(98);
System.out.println(countNonleaf(root));
System.out.println(countNonleaf(root));
}
}
Output:
输出:
3
Explanation: The nodes 70, 32, and 85 are non-leaf nodes in the given tree because they have both right and left child nodes.
解释:在给定的树中,节点70、32和85是非叶节点,因为它们同时具有右子节点和左子节点。
28. Explain calloc(), malloc(), free(), and realloc().
解释calloc()、malloc()、free()和realloc()。
- 知识点: 其他/未分类 (标签: interviewbit, amdocs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Amdocs
- id: 69b3792d58d557c902b98488 | 官方: 否 | 付费: 否
答案:
In C language, dynamic memory allocation allows programmers to allocate memory at runtime. C provides four library functions for dynamic memory allocation that are defined in header file. These library functions are as follows: - malloc(): Allocates one large block of memory dynamically of the specified size. In Malloc, memory is allocated dynamically, and the default value for the allocated memory is garbage, while in Calloc, it is 0 (zero).
在C语言中,动态内存分配允许程序员在运行时分配内存。C提供了四个用于动态内存分配的库函数,这些函数定义在<头文件>中。这些库函数如下:- malloc():动态分配指定大小的单个大内存块。在Malloc中,内存是动态分配的,分配内存的默认值是垃圾值,而在Calloc中,默认值是0(零)。
- calloc(): Allocates a specified number of blocks of memory dynamically of the specified size.
- free(): Dynamically de-allocate the memory created with either calloc() or malloc() as it doesn't get freed automatically.
- realloc(): Dynamically alter the memory allocation of previously allocated memory. Basically, if the memory previously allocated using malloc() or calloc() is inadequate, realloc() can perform a dynamic reallocation of memory.
29. Distinguish between internal and external fragmentation in memory management. Suggest ways of reducing external fragmentation.
区分内存管理中的内部碎片和外部碎片。提出减少外部碎片的方法。
- 知识点: 其他/未分类 (标签: interviewbit, amdocs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Amdocs
- id: 69b3792d58d557c902b9848e | 官方: 否 | 付费: 否
答案:
Fragmentation is an undesirable occurrence within an operating system when processes are loaded/unloaded from memory and free memory space is fragmented (divided into smaller pieces/fragments). Since memory blocks are small, processes cannot be assigned to them, and the memory blocks remain unused. There are two types of fragmentation in OS as given below: - Internal fragmentation: Any time a memory block is assigned to a process if the allocated memory is greater than the requested memory, a free space is created within the memory block. This causes the free space of the memory block to be unused, which results in internal fragmentation.
碎片化是操作系统中的一种不良现象,当进程从内存中加载/卸载时,空闲内存空间被碎片化(分割成更小的片段/碎片)。由于内存块太小,进程无法被分配到这些内存块,导致内存块保持未使用状态。操作系统中有两种碎片类型,如下所示:- 内部碎片:当内存块被分配给进程时,如果分配的内存大于请求的内存,就会在内存块内部产生空闲空间。这导致内存块中的空闲空间无法使用,从而产生内部碎片。
- External fragmentation: External fragmentation is a situation when there is an adequate amount of space in the memory to satisfy the memory requirements of a process, but the memory offered is not contiguous so the request cannot be fulfilled.
As you can see above, there is enough memory (70 KB) to run a process (03) (needs 60KB), but the memory is not contiguous. Use paging, compaction, and segmentation to make use of the free space.
如上所示,有足够的内存(70KB)来运行一个进程(03)(需要60KB),但内存不是连续的。使用分页、紧凑和分段来利用空闲空间。
30. State the difference between overloading and overriding.
说明重载(overloading)和重写(overriding)之间的区别。
- 知识点: 其他/未分类 (标签: interviewbit, amdocs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Amdocs
- id: 69b3792d58d557c902b98491 | 官方: 否 | 付费: 否
答案:
In Java programming, overriding and overloading are the basic concepts that allow for polymorphism.
在Java编程中,重写和重载是实现多态性的基本概念。
| Overloading 重载 | Overriding 重写 |
|---|---|
| In method Overloading, a class contains more than one method with the same name but different parameters. 在方法重载中,一个类包含多个同名但参数不同的方法。 | In method Overriding, methods of the superclass and the child class contain the same names and parameters/arguments. 在方法重写中,父类和子类的方法具有相同的名称和参数。 |
| Overloading requires different parameters. 重载需要不同的参数。 | When overriding, the parameters must be the same. 重写时,参数必须相同。 |
| Overloading is performed within a class. 重载发生在一个类内部。 | Normally, overriding occurs when two classes share an IS-A (inheritance) relationship. Overriding requires both the base and the child class. 通常情况下,重写发生在两个类具有IS-A(继承)关系时。重写需要基类和子类。 |
| For method overloading, static binding is used. 方法重载使用静态绑定。 | For method overriding, dynamic binding is used. 方法重写使用动态绑定。 |
| This is an example of compile-time polymorphism. 这是编译时多态性的一个例子。 | While Overriding breaks can result in serious problems since the effects are visible during runtime. 而重写出错可能导致严重问题,因为其影响在运行时可见。 |
| When overloading breaks, a compile-time error will appear, which can be easily fixed. 当重载出错时,会出现编译时错误,这种错误易于修复。 | This is an example of run-time polymorphism. 这是运行时多态性的一个例子。 |
| - Overriding Example: - 重写示例: |
class InterviewBit
class InterviewBit
{
void show()
void show()
{ System.out.println("InterviewBit");
{ System.out.println("InterviewBit");
}
}
class Scaler extends InterviewBit
class Scaler extends InterviewBit
{
void show()
void show()
{
super.show();
super.show();
System.out.println("Scaler by InterviewBit");
System.out.println("Scaler by InterviewBit");
}
}
class Main
class Main
{
public static void main(String args[])
public static void main(String args[])
{
InterviewBit ob = new Scaler();
InterviewBit ob = new Scaler();
ob.show();
ob.show();
}
}
Output:
输出:
InterviewBit
InterviewBit
Scaler by InterviewBit
InterviewBit 的 Scaler
- Overloading Example:
class Main
class Main
{
static int add(int x, int y)
static int add(int x, int y)
{
return x + y;
return x + y;
}
static int add(int x, int y, int z)
static int add(int x, int y, int z)
{
return x + y + z;
return x + y + z;
}
public static void main(String args[])
public static void main(String args[])
{
System.out.println("x + y = " + add(4, 5));
System.out.println("x + y = " + add(4, 5));
System.out.println("x + y + z = " + add(4, 5, 6));
System.out.println("x + y + z = " + add(4, 5, 6));
}
}
Output:
输出:
x + y = 9
x + y = 9
x + y + z = 15
x + y + z = 15
31. What do you mean by a Hierarchy of exception classes?
异常类的层次结构是什么意思?
- 知识点: 其他/未分类 (标签: interviewbit, amdocs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Amdocs
- id: 69b3792d58d557c902b98497 | 官方: 否 | 付费: 否
答案:
The class Throwable is the root class (base class) of the hierarchy and is present in java.lang package. This class contains two subclasses, namely Error and Exception .
Throwable 类是层次结构的根类(基类),位于 java.lang 包中。该类包含两个子类,即 Error 和 Exception 。
- Error Class: An Error class is a superclass of all runtime error classes and a subclass of Throwable. Errors generally represent a problem or situation that is hard to solve. It is not the result of programming errors but occurs when the system does not work properly or a resource is not allocated as it should be. VirtualMachineError, LinkageError, OutOfMemoryError, AssertionError, InternalError, etc., are some examples of errors.
- Exception Class: The exception class is a superclass of all the exception classes and a subclass of the Throwable. It is used for exceptional conditions that user programs need to catch and handle. ClassNotFoundException, IllegalArgumentException, NullPointerException, etc., are some examples of exceptions.
32. Explain checked and unchecked exceptions.
解释受检异常和非受检异常。
- 知识点: 其他/未分类 (标签: interviewbit, amdocs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Amdocs
- id: 69b3792d58d557c902b9849a | 官方: 否 | 付费: 否
答案:
An exception is a situation that occurs unexpectedly while executing the program, i.e. at run time, that disrupts the normal flow of the program. Java has two types of exceptions: - Checked exceptions: These are the exceptions that are checked at compile time. During compilation, the Java compiler determines whether the method that has thrown the exception contains the code to handle it properly with the try-catch block or the throws keyword is used to declare the method. If the compiler fails to find either of those two cases, then it gives an error. Examples of checked Exceptions:
异常是在程序执行过程中意外发生的情况,即在运行时发生,它会中断程序的正常流程。Java 有两种类型的异常: - 受检异常:这些是在编译时检查的异常。在编译期间,Java 编译器判断抛出异常的方法是否包含使用 try-catch 块正确处理该异常的代码,或者是否使用 throws 关键字来声明该方法。如果编译器未能找到这两种情况中的任何一种,则会给出错误。受检异常的例子:
SQLException IOException InvocationTargetException FileNotfound Exception ClassNotFoundException, etc. - Unchecked exceptions: Also known as runtime exceptions, these exceptions are encountered during the execution of a program. Unchecked exceptions are mostly caused by programming errors, such as trying to access an element with an invalid index, or calling a method with invalid arguments. Examples of unchecked exceptions:
SQLException IOException InvocationTargetException FileNotfound Exception ClassNotFoundException 等。- 非受检异常:也称为运行时异常,这些异常在程序执行期间遇到。非受检异常大多由编程错误引起,例如尝试以无效索引访问元素,或以无效参数调用方法。非受检异常的示例:
ArithmeticException NullPointerException llegalStateException Missing Resource Exception NumberFormatException Undeclared Throwable Exception ArrayIndexOutOfBoundsException, etc.
ArithmeticException NullPointerException llegalStateException Missing Resource Exception NumberFormatException Undeclared Throwable Exception ArrayIndexOutOfBoundsException 等。
33. Describe the different types of errors that commonly occur while programming.
描述编程中常见的不同类型的错误。
- 知识点: 其他/未分类 (标签: interviewbit, amdocs, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Amdocs
- id: 69b3792d58d557c902b9849d | 官方: 否 | 付费: 否
答案:
Some types of errors that can occur while programming: - Syntax Errors: Computer languages have specific grammar rules. If these rules aren't followed (for instance, omitting parentheses while writing code), an application won't run.
编程中可能发生的一些错误类型:- 语法错误:计算机语言具有特定的语法规则。如果不遵循这些规则(例如,编写代码时省略括号),应用程序将无法运行。
- Logic Errors: A logic error occurs when the programmer did not program the machine to do the correct thing. It can be extremely frustrating to deal with because there's nothing wrong with the code itself.
- Compilation Errors: Compilation is the conversion of high-level coding languages into lower-level languages that computers can understand. A compiler error occurs when it is unable to properly translate high-level code into lower-level code.
- Runtime Errors: Runtime errors occur while the user is executing your program. In these cases, a programmer's code doesn't work with another computer even if it works perfectly on his or her own system.
- Arithmetic Errors: These errors involve mathematical errors in the programming code.
34. Explain type casting in C++.
解释 C++ 中的类型转换。
- 知识点: 其他/未分类 (标签: interviewbit, amdocs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Amdocs
- id: 69b3792d58d557c902b984a3 | 官方: 否 | 付费: 否
答案:
Essentially, typecasting refers to the process of converting a variable from one data type to another. As an example, for a given set of operations, an integer type variable can be treated as a character type. In C++, there are two types of typecasting, Implicit Type Conversion, and Explicit Type Conversion. - Implicit Type Conversion/Casting: Also known as 'automatic type conversion', this conversion type is executed by the compiler automatically, without user intervention.
本质上,类型转换指的是将变量从一种数据类型转换为另一种数据类型的过程。例如,对于一组给定的操作,整数类型变量可以被视为字符类型。在 C++ 中,有两种类型转换:隐式类型转换和显式类型转换。- 隐式类型转换/强制转换:也称为“自动类型转换”,这种转换类型由编译器自动执行,无需用户干预。
// C++ program for implicit conversion
// 用于隐式转换的 C++ 程序
include
using namespace std;
using namespace std;
int main()
int main()
{
short a = 50;
short a = 50;
int y;
int y;
//a is implicitly converted to short type
//a 被隐式转换为 short 类型
y = a;
y = a;
int x = 50;
int x = 50;
char ch = 'c';
char ch = 'c';
//ch is implicitly converted to int type
//ch 被隐式转换为 int 类型
//ASCII value of 'c' is 99
//'c'的ASCII值是99
int num = x + ch;
int num = x + ch;
//x is implicitly converted to float type
//x被隐式转换为float类型
float z = x + 5.0;
float z = x + 5.0;
cout << "Typecasting short a to int data type y= " << y << endl;
cout << "将short a类型转换为int数据类型y = " << y << endl;
cout << "Typecasting char ch to int data type num= " << num << endl;
cout << "将char ch类型转换为int数据类型num = " << num << endl;
cout << "Typecasting int x to float data type z= "<< z << endl;
cout << "将int x类型转换为float数据类型z = " << z << endl;
return 0;
return 0;
}
Output:
输出:
Typecasting short a to int data type y= 50
将short a类型转换为int数据类型y = 50
Typecasting char ch to int data type num= 149
将char ch类型转换为int数据类型num = 149
Typecasting int x to float data type z= 55
将int x类型转换为float数据类型z = 55
- Explicit Type Conversion/Casting: Explicit conversions involve the user manually converting the data from one type to another.
Example:
示例:
// C++ program for explicit conversion
// C++程序用于显式转换
include
using namespace std;
using namespace std;
int main()
int main()
{
double x=25.5;
double x=25.5;
int y;
int y;
// Explicit conversion from double type to int
// 从双精度类型到整型的显式转换
y = (int)x + 5;
y = (int)x + 5;
cout<< "y= " << y << endl;
cout<< "y= " << y << endl;
return 0;
return 0;
}
Output:
输出:
y= 30
y= 30
35. What is the Eligibility Criteria at Amdocs?
Amdocs的资格标准是什么?
- 知识点: 其他/未分类 (标签: interviewbit, amdocs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Amdocs
- id: 69b3792e58d557c902b984bb | 官方: 否 | 付费: 否
答案:
| Eligibility Criteria 资格标准 | Details 详细信息 |
|---|---|
| Graduation 学历 | Eligible: BE/ME/B.Tech/M.Tech/MCA 合格:BE/ME/B.Tech/M.Tech/MCA |
| Streams 专业 | Eligible: CSE/IT/ECE/ENTC/ENC Not Eligible: Mechanical/ Civil allied branches 合格:CSE/IT/ECE/ENTC/ENC 不合格:机械/土木及相关分支 |
| Academic and Graduation Criteria 学术和毕业标准 | 60% or 6.0 CGPA throughout 10th, 12th, and UG/PG 10年级、12年级和本科/研究生阶段全程60%或6.0 CGPA |
| Backlogs 挂科情况 | No active/current Backlogs 无当前或未解决挂科 |
36. How long is the Interview Process at Amdocs?
Amdocs的面试流程多长时间?
- 知识点: 其他/未分类 (标签: interviewbit, amdocs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Amdocs
- id: 69b3792e58d557c902b984be | 官方: 否 | 付费: 否
答案:
The Amdocs interview process involves 3-4 rounds. It takes at least one-two week for the interview process to be completed, depending on your technical skills. In most cases, once a person has been told that he or she has cleared all rounds, he can expect to receive the offer letter in approximately 5–7 working days. They will contact you right away if they have a vacancy for you.
Amdocs的面试流程包括3-4轮。根据您的技术技能,面试流程完成至少需要一到两周时间。在大多数情况下,一旦被告知已通过所有轮次,候选人可以在大约5-7个工作日内收到录用通知书。如果有适合您的职位空缺,他们会立即联系您。
37. Does Amdocs give a joining bonus?
Amdocs提供入职奖金吗?
- 知识点: 其他/未分类 (标签: interviewbit, amdocs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Amdocs
- id: 69b3792e58d557c902b984c3 | 官方: 否 | 付费: 否
答案:
Yes, Amdocs offers a joining bonus to new employees. Generally, it is around 10% of your CTC.
是的,Amdocs为新员工提供入职奖金。通常,约为您CTC(总薪酬包)的10%。
38. Is Amdocs interview hard?
Amdocs面试难吗?
- 知识点: 其他/未分类 (标签: interviewbit, amdocs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Amdocs
- id: 69b3792e58d557c902b984c8 | 官方: 否 | 付费: 否
答案:
The Amdocs interview is pretty straightforward, and most people seem to breeze through it without a problem. It is only the Amdocs written test that might be challenging. Preparation is key to a successful job interview since you will appear relaxed, calm, and collected to your potential employer, which is what employers seek in the ideal candidate.
Amdocs的面试相当直接,大多数人似乎都能轻松通过,没有问题。只有Amdocs的笔试可能具有挑战性。准备是成功求职面试的关键,因为您会在潜在雇主面前显得放松、冷静和沉着,这正是雇主在理想候选人身上寻求的品质。
39. What is the salary for freshers in Amdocs?
Amdocs 对应届生的薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, amdocs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Amdocs
- id: 69b3792e58d557c902b984cd | 官方: 否 | 付费: 否
答案:
Among the entry-level roles offered by Amdocs are Associate software engineer, Software Support Engineer, Analyst, etc. Associate Software Engineer salaries at Amdocs in India range from ₹ 4 Lakhs to ₹ 9 Lakhs. The average Amdocs fresher salary can be ₹ 5.5 Lakhs for less than one year of experience.
Amdocs 提供的入门级职位包括助理软件工程师、软件支持工程师、分析师等。Amdocs 在印度的助理软件工程师薪资范围为 40 万卢比至 90 万卢比。对于经验不足一年的应届生,Amdocs 的平均薪资约为 55 万卢比。
40. Why Amdocs?
为什么选择 Amdocs?
- 知识点: 其他/未分类 (标签: interviewbit, amdocs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Amdocs
- id: 69b3792e58d557c902b984d2 | 官方: 否 | 付费: 否
答案:
With its innovative, award-winning technology, Amdocs is driving the digital society forward. Amdocs is an incredible organization from every angle, be it learning, money, fun, professional life, corporate, and so forth. It's a great place to work where you can have fun as well as learn. The company is well known for its employee-friendly culture. Among the perks of working at Amdocs is the exposure to legacy technologies as well as the use of the latest technology in certain projects. Amdocs also offers a competitive salary.
凭借其创新的、屡获殊荣的技术,Amdocs 正在推动数字社会向前发展。无论从学习、金钱、乐趣、职业生活、企业文化等各个方面来看,Amdocs 都是一家令人惊叹的组织。这是一个既能享受乐趣又能学习的好工作场所。该公司以其员工友好的文化而闻名。在 Amdocs 工作的福利之一是能接触到传统技术,同时也能在某些项目中使用最新技术。Amdocs 还提供有竞争力的薪资。
41. What do you understand about the SLIP protocol?
你对 SLIP 协议有什么理解?
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b99196 | 官方: 否 | 付费: 否
答案:
SLIP is an acronym for Serial Line Internet Protocol. It is basically a TCP/IP based fundamental protocol that is used for communication through serial ports and routers. They allow machines to connect with one another that was previously configured for direct communication.
SLIP 是串行线路互联网协议的缩写。它基本上是一种基于 TCP/IP 的基础协议,用于通过串行端口和路由器进行通信。它允许原本配置为直接通信的机器相互连接。
For example, a customer could be connected to the Internet Service Provider (ISP) over a slower SLIP line. When a client needs a service, he or she contacts the ISP and makes a request. The ISP responds to the request by sending it to the Internet on high speed multiplexed lines. The Internet Service Provider then sends the results back to the client over SLIP lines. A SLIP frame has a straightforward format, consisting of a payload and a flag that serves as an end delimiter. A special character with a decimal value of 192 is commonly used as the flag. If this flag is present in the data, it is preceded by an escape sequence that prevents the receiver from interpreting it incorrectly.
例如,客户可以通过较慢的 SLIP 线路连接到互联网服务提供商(ISP)。当客户需要服务时,他或她联系 ISP 并发出请求。ISP 通过高速多路复用线路将请求发送到互联网来响应请求。然后,互联网服务提供商通过 SLIP 线路将结果发送回客户。SLIP 帧具有简单的格式,由有效载荷和一个作为结束分隔符的标志组成。一个十进制值为 192 的特殊字符通常用作该标志。如果此标志出现在数据中,它会前面带有一个转义序列,以防止接收方错误解释它。
42. Highlight the differences between the SLIP and Point to Point protocol (PPP).
突出 SLIP 和点对点协议(PPP)之间的区别。
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b99199 | 官方: 否 | 付费: 否
答案:
The differences between the SLIP and Point-to-Point protocol are given below:
以下是SLIP和点对点协议之间的区别:
| SLIP | PPP |
|---|---|
| It is an acronym for Serial Line Internet Protocol. 它是串行线路互联网协议的缩写。 | It is an acronym for Point to Point Protocol. 它是点对点协议的缩写。 |
| SLIP is a predecessor of the PPP. SLIP是PPP的前身。 | PPP is the successor of the SLIP. PPP是SLIP的后继者。 |
| The internet protocol packet is covered by SLIP. 互联网协议数据包由SLIP封装。 | Datagram is covered by PPP. 数据报由PPP封装。 |
| Authentication mechanisms are not provided by SLIP. SLIP不提供认证机制。 | Authentication mechanisms are provided by PPP. PPP提供认证机制。 |
| SLIP is a static IP addressing assignment. SLIP是静态IP地址分配。 | PPP is a dynamic IP addressing assignment. PPP是动态IP地址分配。 |
| Data is transferred in a synchronous form in SLIP. 数据在SLIP中以同步形式传输。 | Data is transferred both in a synchronous and asynchronous form in PPP. 数据在PPP中以同步和异步形式传输。 |
43. State a few functionalities of Operating Systems.
列举操作系统的一些功能。
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b991c1 | 官方: 否 | 付费: 否
答案:
A few functionalities of Operating Systems are as follows: - Provides a user interface: Operating systems serve as a link between computer hardware and the people who use it. It allows the user to access the hardware in a methodical fashion.
操作系统的一些功能如下:- 提供用户界面:操作系统作为计算机硬件和用户之间的桥梁。它允许用户以系统化的方式访问硬件。
- File Management: To make navigation and usage more effective, a file system is organized into directories. These directories may include additional directories and files. Among other things, the operating system keeps track of where data is stored, user access settings, and the condition of each file.
- Security: Password protection and other security features are used by the operating system to protect user data. It also guards against unauthorized access to programmes and user data.
- Maintains system performance: By keeping an eye on the overall health of the system, it might help you get more out of it. Keep track of the time between service requests and system responses to get a complete picture of the system's health. This can help with performance by providing important information for debugging.
Memory Management: The operating system is in charge of the primary memory, also known as main memory. The main memory is made up of a large number of bytes or words, each with its own address. Main memory is a type of fast storage that the CPU can directly access. Before a programme can be executed, it must first be loaded into the main memory. An operating system manages memory by performing the following tasks:
It keeps track of primary memory, that is, which user programmes use specific memory bytes. Memory addresses that have already been assigned as well as those that have not yet been used. In multiprogramming, the OS sets the order in which processes are allowed memory access and for how long. When a process requests memory, it is allocated, and memory is released when the process quits or performs an I/O activity. - Error detection: The operating system continuously monitors the system in order to detect errors and keep the machine from failing.它跟踪主内存,即哪些用户程序使用特定的内存字节。已分配的内存地址以及尚未使用的地址。在多道程序设计中,操作系统设置进程被允许访问内存的顺序和时间长度。当进程请求内存时,会被分配,当进程退出或执行I/O操作时释放内存。- 错误检测:操作系统持续监控系统以检测错误并防止机器故障。
- Device Management: Drivers are used by an operating system (OS) to handle device connectivity. It keeps track of all of the system's connected gadgets. The Input/Output controller is a programme that manages all of the devices in the system. Determines which processes and for how long are permitted access to a device. Devices are distributed in an effective and efficient manner. A device gets deallocated when it is no longer required.
- Processor Management: The operating system determines the order in which processes access the processor and the amount of processing time each process has in a multiprogramming environment.
44. Define IPSec and state its components.
定义IPSec并说明其组件。
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b991ca | 官方: 否 | 付费: 否
答案:
IP security (IPSec) is a set of protocols developed by the Internet Engineering Task Force (IETF) to provide data authentication, integrity, and confidentiality between two communication points over an IP network. It also specifies the encryption, decryption, and authentication of packets. It defines the protocols for secure key management and key exchange.
IP安全(IPSec)是由互联网工程任务组(IETF)开发的一组协议,用于在IP网络上两个通信点之间提供数据认证、完整性和机密性。它还规定了数据包的加密、解密和认证。它定义了安全密钥管理和密钥交换的协议。
It is made up of the following components: - Encapsulating Security Payload (ESP): Data integrity, encryption, authentication, and anti-replay are all supplied by the Encapsulating Security Payload (ESP). Payload authentication is also supported.
它由以下组件组成:- 封装安全载荷(ESP):数据完整性、加密、认证和防重放全部由封装安全载荷(ESP)提供。还支持载荷认证。
- Header of Authentication (AH): Data integrity, authentication, and anti-replay are also supported by this header, but not encryption. Unwanted packet transmission is protected by anti-replay protection. It does not guarantee data privacy.
- IKE (Internet Key Exchange): IKE (Internet Key Exchange) is a network security protocol that allows two devices to communicate across a Security Association by dynamically exchanging encryption keys (SA). The Security Association (SA) creates common security features between two network entities to facilitate secure communication. IKE (Internet Key Exchange) secures message content and provides an open framework for implementing standard algorithms such as SHA and MD5. The IP sec users of the technique assign a unique identifier to each packet. Using this identifier, the device can assess whether a packet is correct or not. Unauthorized packets are discarded and do not reach their intended receiver.
45. Define Macros in C/C++. Explain with an example.
定义C/C++中的宏。用一个例子解释。
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b991cd | 官方: 否 | 付费: 否
答案:
Macros in C/C++ are constants in the preprocessor that are replaced at compile time. As a result, a macro is a named block of code within a programme. When the compiler detects this name, it replaces it with the actual piece of code. The disadvantage of macros is that they are not function calls, but rather code changes. Similarly, when substituting the identical values, they have the advantage of saving time.
C/C++中的宏是预处理器中的常量,在编译时被替换。因此,宏是程序中的命名代码块。当编译器检测到该名称时,会用实际的代码片段替换它。宏的缺点是它们不是函数调用,而是代码替换。同样,当替换相同的值时,它们具有节省时间的优点。
In the sample code snippet given below, all instances of the phrases TEXT, EVEN, and SUMMATION will be replaced with whatever is in their body.
在下面给出的示例代码片段中,所有TEXT、EVEN和SUMMATION短语的实例都将被替换为其主体中的内容。
include <bits/stdc++.h>
// Macros are being defined below
// 下面正在定义宏
define HELLOWORLD "HELLO WORLD!"
define EVENNUMBER 4
define ODDNUMBER 3
define ADD (4 + 3)
// Main function of the C++ Program
// C++程序的主函数
int main()
int main()
{
cout << "String: " << HELLOWORLD << "\n";
cout << "字符串:" << HELLOWORLD << "\n";
cout << "Even Number is: << EVENNUMBER << "\n";
cout << "偶数是:" << EVENNUMBER << "\n";
cout << "Odd Number is: << ODDNUMBER << "\n";
cout << "奇数:" << ODDNUMBER << "\n";
cout << "The sum of the given even and odd numbers is: " << ADD << "\n";
cout << "给定偶数和奇数的和是:" << ADD << "\n";
return 0;
return 0;
}
46. Explain a copy constructor with the help of an example.
通过一个例子解释复制构造函数。
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b991d0 | 官方: 否 | 付费: 否
答案:
A copy constructor is a member function that uses another object of the same class to initialize an object. Our copy constructor can be defined by us. If no copy constructor is defined, the default copy constructor is used.
复制构造函数是一个成员函数,它使用同一类的另一个对象来初始化一个对象。我们的复制构造函数可以由我们定义。如果没有定义复制构造函数,则使用默认的复制构造函数。
// Including all the header files
// 包含所有头文件
include<bits/stdc++.h>
// class showing the usage of a copy constructor
// 展示复制构造函数用法的类
class Fun{
class Fun{
long long a,b;
long long a,b;
Fun(long long _a, long long _b){
Fun(long long _a, long long _b){
this -> a = _a;
this -> a = _a;
this -> b = _b;
this -> b = _b;
}
};
// Main function of the C++ program
// C++ 程序的主函数
int main(){
int main(){
Fun obj1(5LL,7LL);
Fun obj1(5LL,7LL);
Fun obj2 = obj1;//In this line, the copy constructor will be called
Fun obj2 = obj1;//在这行中,复制构造函数将被调用
return 0;
return 0;
}
The above-mentioned code snippet shows how the copy constructor is used to define the object "obj2" using the already existing object "obj1".
上述代码片段展示了如何使用拷贝构造函数,通过已存在的对象“obj1”来定义对象“obj2”。
47. What are your thoughts on Structured Programming?
你对结构化编程有何看法?
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b991d3 | 官方: 否 | 付费: 否
答案:
Structured Programming is a programming paradigm in which the control flow is completely structured. A structure is a block that has a set of rules and has a defined control flow, such as (if/then/else), (while and for), block structures, and subroutines. Nearly all programming paradigms, including the Object-Oriented Programming model, require structured programming.
结构化编程是一种编程范式,其中控制流是完全结构化的。结构是一个具有一组规则和已定义控制流的块,例如(if/then/else)、(while和for)、块结构和子程序。几乎所有编程范式,包括面向对象编程模型,都需要结构化编程。
48. Define Storage Classes in C. State the various storage classes which are present in C.
定义C语言中的存储类。说明C语言中存在的各种存储类。
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b991d6 | 官方: 否 | 付费: 否
答案:
Storage Classes are used to define the properties of a variable or function. Scope, visibility, and longevity are all qualities that allow us to track the presence of a variable during the execution of a programme. There are four storage classes in the C programming language: - Auto: This is the default storage class for all variables specified inside a function or a block. Auto variables can only be utilized within the block/function in which they were defined; they can't be used outside (which defines their scope). They can, however, be accessed outside of their scope by using pointers, which point to the memory address where the variables are kept. They are given a garbage value by default whenever they are declared.
存储类用于定义变量或函数的属性。作用域、可见性和生命周期都是使我们能够在程序执行期间跟踪变量存在的特性。C编程语言中有四种存储类:- Auto:这是在函数或块内定义的所有变量的默认存储类。自动变量只能在其被定义的块/函数内使用;它们不能在该范围之外使用(这定义了它们的作用域)。然而,可以通过指向变量存储内存地址的指针在作用域之外访问它们。它们在被声明时默认获得垃圾值。
- Static: Static variables are often used in C language programs, and this storage type is used to declare them. Even after they have been removed from their scope, static variables can keep their value! As a result, we may assert that they are only initialized once and live only till the programme terminates. No fresh memory is allocated because they are not declared again. They have a limited scope that is restricted to the role they have been allocated. Global static variables in the programme can be accessed from anywhere in the code. By default, the compiler assigns a value of 0 to these.
- Register: This storage class declares register variables, which are functionally comparable to auto variables. The only difference is that if there is a free registration available, the compiler will attempt to store these variables in the CPU's register. If no free registers are available, the data is kept in memory alone. The register keyword is used to create a few variables that will be accessed frequently in a programme, hence speeding up its execution. A register variable's address cannot be accessed via pointers, which is an important fact to note.
- Extern: The storage class extern merely means that the variable is defined outside of the block in which it is referenced. In essence, the value is assigned to it in another block, which can then be overwritten/changed in another block. Any function or block can make a regular global variable extern by using the 'extern' keyword before its declaration or definition. This indicates that instead of establishing a new variable, we're simply accessing and using the global variable. The extern keyword can be used to extend the visibility of variables and functions. Because functions are visible throughout the programme by default, the use of extern in function declarations or definitions is unnecessary. Its use is self-evident. When you use extern to declare a variable, you are not actually defining it.
49. What are structs in C programming? Write down their syntax and an example of the same.
C编程中的结构体是什么?写出它们的语法和一个示例。
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b991d9 | 官方: 否 | 付费: 否
答案:
A structure or struct in C programming is a user-defined data type that lets us mix data items of a lot of types. A structure is basically used to represent a record.
C编程中的结构或struct是一种用户定义的数据类型,允许我们混合多种类型的数据项。结构体基本上用于表示一条记录。
The syntax of structs in C programming is given below:
C编程中结构体的语法如下:
struct nameOfStruct
struct 结构体名称
{
data member definition;
数据成员定义;
data member definition;
数据成员定义;
...
data member definition;
数据成员定义;
};
An example of structs in C programming is given below:
C编程中结构体的示例如下:
struct Node{
struct Node{
int val;
int val;
Node *next;
Node *next;
};
50. What are unions in C programming? Write down their syntax and an example of the same.
C 语言中的联合体(union)是什么?写出它们的语法及一个示例。
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b991dc | 官方: 否 | 付费: 否
答案:
A union is a special data type in C that lets you store many data types in the same memory space. Although a union can have many members, only one of them has worth at any given time. Unions are a good way to reuse the same memory space for several tasks.
联合体是 C 语言中的一种特殊数据类型,它允许你在同一内存空间中存储多种数据类型。尽管联合体可以有多个成员,但在任何给定时间,只有其中一个成员具有有效值。联合体是复用同一内存空间以用于多种用途的好方法。
The syntax of unions in C programming is given below:
C 语言中联合体的语法如下所示:
union nameOfUnion
union 联合体名称
{
data member definition;
数据成员定义;
data member definition;
数据成员定义;
...
data member definition;
数据成员定义;
};
An example of unions in C programming is given below:
C 语言中联合体的一个示例如下所示:
union book
union book
{
char nameOfBook[15];
char nameOfBook[15];
char nameOfBookAuthor[15];
char nameOfBookAuthor[15];
int priceOfBook;
int priceOfBook;
};
51. Define slice splicing in the field of software testing? State the types of slice splicing?
定义软件测试领域中的切片拼接(slice splicing)?指出切片拼接的类型?
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b991df | 官方: 否 | 付费: 否
答案:
A program slice is a collection of statements from a program. If we wanted to build software in terms of compatible slices, we could code a slice and test it right away. We can then code and test more slices before putting them together into usable software. This procedure is known as slice splicing.
程序切片是程序中的一组语句集合。如果我们希望基于兼容的切片来构建软件,可以先编写一个切片并立即进行测试,然后编写并测试更多切片,最后将它们组合成可用的软件。这个过程被称为切片拼接。
Static and dynamic slicing are the two types of slicing: - Slicing in a static state: A static slice of a program is made up of all statements that have the potential to modify the value of a variable at any time during the program's execution. Static slices are, on average, bigger. It takes into account every possible programme execution scenario.
静态切片和动态切片是切片的两种类型:- 静态状态下的切片:程序的静态切片由所有可能在程序执行期间的任何时刻修改变量值的语句组成。静态切片平均而言更大。它考虑了所有可能的程序执行场景。
Dynamic Slicing: A dynamic slice of a program is made up of all the statements that affect the value of a variable at any given time throughout the program's execution. Dynamic slices are, on average, smaller. It only takes into consideration the execution of a single program.
Apisero Interview Preparation
52. Interview preparation.
面试准备。
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b991e2 | 官方: 否 | 付费: 否
答案:
The following strategies for preparing for an Apisero interview are strongly advised for readers of this article:
以下为准备Apisero面试的策略,强烈建议本文读者采纳:
- To see how quickly you can solve a set of coding tasks, put yourself to the test. This will aid in the development of your problem-solving abilities as well as your logic frameworks.
- Share your experiences and be prepared to demonstrate leadership, teamwork, professional and academic success, communication skills, and the ability to overcome hurdles.
- Recognize your strengths and shortcomings, as well as the experiences and skills that qualify you for the position. Consider coming up with a unique example to help you stand out from the crowd. The interviewer wants to discover what drives you, why you are interested in the organization, and how your previous experience prepares you for the role.
- It is always beneficial to maintain a positive and welcoming attitude. Begin the conversation on a positive note by confidently introducing yourself.
- The more prepared you are for an interview, the better your chances of landing a job. Learn everything there is to know about interviews, including the stages, rounds, and questions. Answers to frequently requested questions should be prepared ahead of time for human resource development (HRD) and management interviews. You can also learn about firm performance, organizational structure, vision, and work-life balance, among other things.
- Examine the organization's interview experience articles. This will give you a decent idea of how the actual interview will go and what to expect.
- Consider doing a practice interview. This will give you a sense of how the interview will be conducted. You can use the InterviewBit platform to create mock interviews. You will be paired with your peers, and both of you will be allowed to interview, which will be beneficial to you.
53. What is the average Apisero salary for freshers?
Apisero对应届生的平均薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b991e5 | 官方: 否 | 付费: 否
答案:
In India, a Fresher Software Development Engineer at Apisero can expect to earn roughly three lakhs and eighty thousand rupees per year (3,80,000 per year).
在印度,Apisero的应届软件开发工程师预计年收入约为三十八万卢比(每年380,000卢比)。
54. How many rounds of interviews are there in Apisero?
Apisero的面试有几轮?
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b991e8 | 官方: 否 | 付费: 否
答案:
There are usually four rounds of interviews at Apisero, out of which the first three are for checking the technical knowledge of the candidate, while the last one is an HR round which checks whether or not the candidate is a cultural fit for the company. Learn More .
Apisero通常有四轮面试,其中前三轮用于考察候选人的技术知识,而最后一轮是人力资源轮,旨在判断候选人是否符合公司文化契合度。了解更多。
55. What type of company is Apisero?
Apisero是什么类型的公司?
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b991eb | 官方: 否 | 付费: 否
答案:
Apisero is a MuleSoft Strategic and Salesforce Ridge Partner, headed by a creative team with over twenty-five years of integration experience. It specialises in using the MuleSoft software platform to provide a comprehensive range of integration services. As a global leader in consulting, technology services, and digital transformation, Apisero combines years of deep technical experience with cutting edge technologies to allow businesses to innovate and go digital faster.
Apisero是MuleSoft战略伙伴和Salesforce Ridge合作伙伴,由一支拥有超过二十五年集成经验的创意团队领导。它专注于使用MuleSoft软件平台提供全面的集成服务。作为咨询、技术服务和数字化转型领域的全球领导者,Apisero将多年的深厚技术经验与尖端技术相结合,帮助企业更快地创新和实现数字化。
56. Why do you want to join Apisero?
你为什么想加入Apisero?
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b991ee | 官方: 否 | 付费: 否
答案:
Apisero recruits and develops top talent by offering comprehensive and fast-paced growth opportunities based on a digital learning environment that is accessible at any time, from any location, and on any device. Apisero is an excellent place to begin your career as a new employee. It provides an excellent working environment as well as a friendly setting with a good aura that is conducive to personal and corporate growth. As a result, Apisero's employees are sufficiently motivated to work there.
Apisero通过提供全面且快节奏的成长机会来招聘和培养顶尖人才,这些机会基于一个随时随地、任何设备均可访问的数字学习环境。Apisero是新员工开启职业生涯的绝佳起点。它提供优越的工作环境以及友好的氛围,具有良好的气场,有利于个人和公司成长。因此,Apisero的员工有足够的动力在那里工作。
57. What is the C4E interview in Apisero?
Apisero中的C4E面试是什么?
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b991f1 | 官方: 否 | 付费: 否
答案:
The C4E interview in Apisero aims at checking the technical knowledge of the candidate applying at Apisero. Basic questions on sorting, searching, trees, stacks, queues are asked. Interviewers can also ask the candidates to write SQL queries and basic computational questions and some scenario-based questions can also be expected. Major topics of subjects like computer networks, cloud computing, machine learning, data structures and algorithms and Database Management Systems should be known to the candidate to ace this interview.
Apisero的C4E面试旨在考察申请者的技术知识。会提出关于排序、搜索、树、栈、队列的基础问题。面试官也可能要求候选人编写SQL查询和基本的计算问题,还可能涉及一些基于场景的问题。候选人应熟悉计算机网络、云计算、机器学习、数据结构和算法以及数据库管理系统等主要科目,才能在这轮面试中表现出色。
58. How should you respond to the following question: Why are you suitable for this job position?
你应如何回答以下问题:你为什么适合这个职位?
- 知识点: 其他/未分类 (标签: interviewbit, apisero, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Apisero
- id: 69b3793b58d557c902b991f4 | 官方: 否 | 付费: 否
答案:
When asked questions like these, you should emphasise your qualities and talents that are relevant to the job. The following is an example of a typical response to this question:
当遇到此类问题时,你应该强调与工作相关的个人品质和才能。以下是该问题的典型回答示例:
"I am certain that I am qualified for this position for a multitude of reasons, but most importantly because of my determination to succeed. I possess all of the talents necessary to thrive in this position. I am always in the attempt of educating myself in the latest technologies. My qualifications and talents perfectly match the needs of this job position. Above all, I am a strong candidate for that post because of my communication and leadership abilities."
“我确信自己因多重原因胜任该职位,但最重要的是因为我追求成功的决心。我具备在该职位中茁壮成长所需的所有才能。我总是努力自学最新技术。我的资质和才能完全匹配该职位的要求。最重要的是,由于我的沟通和领导能力,我是该职位的强力候选人。”
59. Highlight some of the drawbacks of inheritance.
突出强调继承的一些缺点。
- 知识点: 其他/未分类 (标签: interviewbit, arcesium, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Arcesium
- id: 69b3793d58d557c902b993b4 | 官方: 否 | 付费: 否
答案:
The following are some of the drawbacks of inheritance: - Looking at different classes for different purposes frequently increases the amount of time and effort required to complete a program.
以下是继承的一些缺点:- 为不同目的查看不同的类经常会增加完成程序所需的时间和精力。
- The classes of parent and kid become closely intertwined.
- Any program adjustments would entail revisions in both parent and child classes.
- It demands meticulous implementation; else, incorrect outcomes will happen.
60. Give the definition of abstract classes. Can we make objects or instances of these classes?
给出抽象类的定义。我们能创建这些类的对象或实例吗?
- 知识点: 其他/未分类 (标签: interviewbit, arcesium, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Arcesium
- id: 69b3793d58d557c902b993c4 | 官方: 否 | 付费: 否
答案:
An abstract class is a type of class that has abstract methods. The abstract classes do not define these methods, despite the fact that they are declared. These methods must be provided in a subclass only if they are to be used in that subclass.
抽象类是一种具有抽象方法的类。尽管抽象类声明了这些方法,但并未定义它们。这些方法只有在子类中使用时,才必须在子类中提供。
No, we can't make abstract classes into objects or instances. There can be no instances of an abstract class since it lacks a complete implementation. Subclasses that inherit the abstract class can be used to create instances.
不,我们不能将抽象类创建为对象或实例。由于抽象类缺乏完整的实现,因此不能有其实例。继承抽象类的子类可用于创建实例。
61. What do you know about a VPN (Virtual Private Network)? What are the many types of virtual private networks (VPNs)?
你对VPN(虚拟专用网络)了解多少?虚拟专用网络(VPN)有哪几种类型?
- 知识点: 其他/未分类 (标签: interviewbit, arcesium, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Arcesium
- id: 69b3793d58d557c902b993c7 | 官方: 否 | 付费: 否
答案:
A virtual private network (VPN) connects users' computers to a private network across a public network, allowing them to send and receive data as if they were physically connected to the private network. Using a VPN gives you more capability, security, and control over your private network. Telecommuting professionals typically use it to acquire access to resources that aren't available on the public network. Although encryption is common, a VPN connection does not require it. A VPN is created by creating a virtual point to point connection over existing networks utilising dedicated circuits or tunnelling technology. Some of the advantages of a wide area network can be acquired by connecting to a VPN over the public Internet (WAN). From the user's perspective, the resources supplied within the private network can be accessed remotely.
虚拟专用网络(VPN)通过公共网络将用户的计算机连接到专用网络,允许用户像物理连接到专用网络一样发送和接收数据。使用VPN可以为您提供更大的能力、安全性和对专用网络的控制。远程办公的专业人员通常使用它来获取公共网络上不可用的资源。虽然加密很常见,但VPN连接并不要求必须加密。VPN是通过利用专用电路或隧道技术在现有网络上创建虚拟点对点连接而创建的。通过公共互联网连接到VPN,可以获得广域网(WAN)的一些优势。从用户的角度来看,可以远程访问专用网络内提供的资源。
The following are the various types of VPNs: - Site to Site VPN: A Site to Site VPN, also known as a Router to Router VPN, joins the networks of two offices in different locations. There are two subcategories, as indicated below:
以下是VPN的各种类型:- 站点到站点VPN:站点到站点VPN,也称为路由器到路由器VPN,连接两个不同位置办公室的网络。它有两个子类别,如下所示:
Intranet VPN: Intranet VPNs are used for connecting remote offices in various locations utilising one single infrastructure, that is, the servers, internet connectivity, etc., as a private WAN and the same accessibility policies (wide area network).
内联网VPN:内联网VPN用于利用单一基础设施连接不同位置的远程办公室,即将服务器、互联网连接等作为私有广域网(WAN)以及相同的访问策略。
Extranet VPN: Extranet VPN uses common infrastructure to connect intranet users, suppliers, consumers, partners, and other entities via dedicated connections. - Access VPN: An access VPN is a sort of virtual private network that allows mobile users and telecommuters to connect to the internet from a remote location. Dial-up or ISDN (Integrated Services Digital Network) connections can be replaced with it. It's a budget-friendly alternative with a variety of connectivity possibilities.
外联网VPN:外联网VPN使用公共基础设施,通过专用连接连接内联网用户、供应商、消费者、合作伙伴和其他实体。- 访问VPN:访问VPN是一种虚拟专用网络,允许移动用户和远程办公人员从远程位置连接到互联网。它可以替代拨号或ISDN(综合业务数字网络)连接。这是一个预算友好的替代方案,具有多种连接可能性。
Useful Interview Resources - Free Mock Coding Interview
有用的面试资源 - 免费模拟编码面试
- Coding Interview Questions for Practice
- Technical Interview Questions for Practice
- Interview Preparation
62. What do you understand about Unary Operations in Relational Algebra with respect to SQL.
关于SQL中的关系代数,你对一元运算有何理解?
- 知识点: 其他/未分类 (标签: interviewbit, arcesium, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Arcesium
- id: 69b3793d58d557c902b993ca | 官方: 否 | 付费: 否
答案:
In Relational Algebra, one operand operations are known as unary operations. The procedures PROJECTION, SELECTION, and RENAME are unary operations in relational algebra: - SELECT: The SELECT operation selects a subset of tuples from a relation that fulfils a set of criteria. The SELECT operation is a filter that keeps only those tuples that fulfil a set of criteria. Alternatively, you may use the SELECT method to limit the tuples to those that fulfil the criteria. The SELECT operation can be thought of as dividing the relation horizontally into two groups of tuples: those that meet the criteria and are selected, and those that do not and are rejected.
在关系代数中,只有一个操作数的操作称为一元运算。投影(PROJECTION)、选择(SELECTION)和重命名(RENAME)是关系代数中的一元运算:- 选择:选择操作从关系中选取满足一组条件的元组子集。选择操作是一个过滤器,只保留满足一组条件的元组。或者,您可以使用选择方法将元组限制为满足条件的那些。选择操作可以被认为是在水平方向上把关系分成两组元组:满足条件并被选中的,以及不满足条件并被拒绝的。
RENAME: It is occasionally simple and suitable to break a complicated chain of operations and rename it as a relation with new names. Renaming a relationship can be done for a variety of reasons, including
We might want to save the result of a relational algebra expression as a relation so that we can use it later. It's possible that we'll want to join in relation to itself. - PROJECT: If a relation is viewed as a table, the SELECT operation selects certain rows while discarding others. In contrast, the PROJECT operation selects a subset of the table's columns while rejecting the remainder. We can use the PROJECT operation to project a relation over just a few of its attributes if we're just interested in a few of them. As a result, the result of the PROJECT operation can be viewed as a vertical partition of the relation into two relations: one with the needed columns (attributes) and the operation's result, and the other with the rejected columns.我们可能希望将关系代数表达式的结果保存为一个关系,以便以后使用。我们可能希望自己与自身连接。- 投影:如果关系被视为一张表,选择操作选取某些行而丢弃其他行。相比之下,投影操作选取表列的子集而拒绝其余列。如果我们只对关系的少数属性感兴趣,可以通过投影操作仅在这些属性上投影关系。因此,投影操作的结果可以被视为关系垂直分成两个关系:一个包含所需的列(属性)以及操作结果,另一个包含被拒绝的列。
63. Make a distinction between the following: #include and #include "file"?
区分以下两者:#include和 #include "file"?
- 知识点: 其他/未分类 (标签: interviewbit, arcesium, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Arcesium
- id: 69b3793d58d557c902b993cd | 官方: 否 | 付费: 否
答案:
The key distinction between the two is the preprocessor's search location for the included file. The preprocessor looks in the same directory as the directive's file for #include "file" This method is typically used to include programmatically generated header files. The preprocessor, on the other hand, looks for #include in pre-designated search directories by the compiler or the IDE (Integrated Development Environment), which are not always in the same directory as the directive's file. This method is typically used to include standard library header files.
两者之间的关键区别在于预处理器对包含文件的搜索位置。对于#include "file",预处理器查找指令所在文件的同一目录。这种方法通常用于包含程序生成的头文件。相比之下,预处理器在编译器或IDE(集成开发环境)预先指定的搜索目录中查找#include,这些目录不一定与指令所在文件的目录相同。这种方法通常用于包含标准库头文件。
64. Differentiate between Call by Value and Call by Reference.
区分按值调用和按引用调用。
- 知识点: 其他/未分类 (标签: interviewbit, arcesium, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Arcesium
- id: 69b3793d58d557c902b993d0 | 官方: 否 | 付费: 否
答案:
Before we look at the key differences between the two, let us take a look at the definitions of Call by Value and Call by Reference: - Call by Reference: In Call by Reference, both the actual and formal parameters refer to the same location, and any changes made within the function are reflected in the caller's actual parameters as a result.
在我们查看两者之间的主要区别之前,先来看看按值调用和按引用调用的定义:- 按引用调用:在按引用调用中,实际参数和形式参数都指向相同的位置,函数内所做的任何更改都会反映在调用者的实际参数中。
Call by Values: The values of actual parameters are copied to the formal parameters of the function in this method of parameter passing, and the two types of parameters are stored in distinct memory areas. As a result, any changes made inside functions are not reflected in the actual arguments passed to the caller.
Now, let us take a closer look at the distinctions between Call by Value and Call by Reference:现在,让我们更仔细地看看按值调用和按引用调用之间的区别:
| CALL BY VALUE 按值调用 | CALL BY REFERENCE 按引用调用 |
|---|---|
| The value of each variable in the calling code is transferred into the corresponding parameter variables in the called function in Call by Value. 在按值调用中,调用代码中每个变量的值被传递到被调用函数中对应的参数变量中。 | The addresses of the calling function's actual variables are copied into the called function's dummy variables in Call by Reference. 在按引用调用中,调用函数实际变量的地址被复制到被调用函数的虚拟变量中。 |
| Changes to the parameter variables of the called function will have zero impact on the values of the variables of the calling function when using Call by Value. 使用按值调用时,对被调用函数的参数变量所做的更改对调用函数的变量值没有任何影响。 | Because the called function receives the addresses of the calling function's actual variables, any changes made to the called function's variables are reflected in the calling function's variables as well. 因为被调用函数接收到调用函数实际变量的地址,所以对被调用函数变量所做的任何更改也会反映在调用函数的变量中。 |
| In call-by-values, we can't change the values of actual variables using function calls. 在按值调用中,我们无法通过函数调用更改实际变量的值。 | Through function calls, we can change the real values of variables in the call by reference. 通过函数调用,我们可以在按引用调用中更改变量的真实值。 |
The following is an example of each to demonstrate the difference between Call by Value and Call by Reference in C:
下面是每个调用的示例,以演示C语言中按值调用和按引用调用之间的区别:
Coding Example of Call By Value:
按值调用的编码示例:
// Illustration of Calling via Value using C program
// 使用C程序通过值调用的图示
include <stdio.h>
// Prototype of the function "subtract"
// 函数“subtract”的原型
void subtract(float c, float d);
void subtract(float c, float d);
// The main function of the C code
// C代码的主函数
int32_t main()
int32_t main()
{
float a = 71.0, b = 21.0;
float a = 71.0, b = 21.0;
// Passing a and b and calling the subtract function by Value
// 传递a和b并通过值调用subtract函数
subtract(a, b);
subtract(a, b);
printf("a = %f b = %f\n", a, b);
printf("a = %f b = %f\n", a, b);
return 0;
return 0;
}
// Method definition to subtract two Numbers and store the answer in the first number passed
// 方法定义:减去两个数字,并将答案存储在传入的第一个数字中
void subtract(float c, float d)
void subtract(float c, float d)
{
c = c - d;
c = c - d;
printf("c = %f d = %f\n", c, d);
printf("c = %f d = %f\n", c, d);
}
Output:
输出:
a = 50.0 b = 21.0 // Printed value in the subtract function
a = 50.0 b = 21.0 // 在subtract函数中打印的值
a = 71.0 b = 21.0 // Printed value in the main function
a = 71.0 b = 21.0 // 在 main 函数中打印的值
NOTE: The values of the parameters passed did not change in Call By Value, that is, a remained as 71 and b remained as 21.
注意:在按值调用中,传入参数的值没有改变,也就是说,a 保持为 71,b 保持为 21。
Coding Example of Call By Reference:
按引用调用的编码示例:
// Illustration of Calling via Reference using C program
// 使用 C 程序说明通过引用调用
include <stdio.h>
// Prototype of the function "subtract"
// 函数“subtract”的原型
void subtract(float c, float d);
void subtract(float c, float d);
// The main function of the C code
// C代码的主函数
int32_t main()
int32_t main()
{
float a = 71.0, b = 21.0;
float a = 71.0, b = 21.0;
// Passing a and b and calling the subtract function by Reference
// 传递 a 和 b,并通过引用调用 subtract 函数
subtract(&a, &b);
subtract(&a, &b);
printf("a = %f b = %f\n", a, b);
printf("a = %f b = %f\n", a, b);
return 0;
return 0;
}
// Method definition to subtract two Numbers and store the answer in the first number passed
// 方法定义:减去两个数字,并将答案存储在传入的第一个数字中
void subtract(float c, float d)
void subtract(float c, float d)
{
c = c - *d;
c = c - *d;
printf("c = %f d = %f\n", c, d);
printf("c = %f d = %f\n", c, d);
}
Output:
输出:
a = 50.0 b = 21.0 // Printed value in the subtract function
a = 50.0 b = 21.0 // 在subtract函数中打印的值
a = 50.0 b = 21.0 //. Printed value in the main function
a = 50.0 b = 21.0 //. 在main函数中打印的值
NOTE: The values of the parameters passed changed in Call By Reference, that is, a became 50 and b became 21.
注意:在按引用调用中,传入参数的值发生了改变,即a变为50,b变为21。
65. Explain the concept of Function Overloading with a C ++ code example.
用C++代码示例解释函数重载的概念。
- 知识点: 其他/未分类 (标签: interviewbit, arcesium, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Arcesium
- id: 69b3793d58d557c902b993d6 | 官方: 否 | 付费: 否
答案:
Function overloading is a feature of Object-Oriented programming that allows two or more functions to have the same name but different parameters. When a function name is overloaded with many duties, this is known as function overloading. In Function Overloading, the Function name should be the same, but the arguments should be different. Polymorphism is a feature of C++ that allows functions to be overloaded. The following is an example of function overloading in C++:
函数重载是面向对象编程的一个特性,允许两个或更多函数具有相同的名称但不同的参数。当一个函数名被重载以执行多种任务时,这被称为函数重载。在函数重载中,函数名应相同,但参数应不同。多态性是C++的一个特性,允许函数被重载。以下是C++中函数重载的一个示例:
// including the header files
// 包含头文件
include <bits/stdc++.h>
using namespace std;
using namespace std;
void printValue(int a) {
void printValue(int a) {
cout << " Integral Value: " << a << endl;
cout << " 整数值: " << a << endl;
}
void printValue(char a) {
void printValue(char a) {
cout << " Character Value" << a << endl;
cout << " 字符值" << a << endl;
}
void printValue(double a) {
void printValue(double a) {
cout << " Decimal Value " << a << endl;
cout << " 小数值 " << a << endl;
}
// Main function of the C++ code
// C++ 代码的主函数
int main() {
int main() {
// Calls the integral overloaded function
// 调用整型重载函数
printValue(22);
printValue(22);
// Calls the character overloaded function
// 调用字符重载函数
printValue("C");
printValue("C");
// Calls the decimal overloaded function
// 调用小数重载函数
printValue(231.2322);
printValue(231.2322);
return 0;
return 0;
}
66. Define destructors in C++. Give the syntax for Destructors in C++.
在 C++ 中定义析构函数。给出 C++ 中析构函数的语法。
- 知识点: 其他/未分类 (标签: interviewbit, arcesium, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Arcesium
- id: 69b3793d58d557c902b993d9 | 官方: 否 | 付费: 否
答案:
In C++, destructors are instance member functions that are called automatically when an object is destroyed. A destructor, in other terms, is the final function called before an object is destroyed. It's worth noting that if an object was created with the "new" keyword, or if the constructor used the "new" keyword to allocate memory from the heap memory or the free store, the memory should be freed with the "delete" keyword in the destructor. Destructors are called for a class object when it goes out of scope or is expressly removed, and they are used to deallocate memory and do the additional cleanup for the object and its members when the object is destroyed.
在 C++ 中,析构函数是实例成员函数,当对象被销毁时自动调用。换句话说,析构函数是对象被销毁前调用的最后一个函数。值得注意的是,如果对象是使用 "new" 关键字创建的,或者构造函数使用了 "new" 关键字从堆内存或自由存储区分配内存,那么应该在析构函数中使用 "delete" 关键字释放该内存。当类对象超出作用域或被明确删除时,析构函数会被调用,用于释放内存,并在对象被销毁时对对象及其成员执行额外的清理操作。
In C++, a destructor has the following syntax: ~constructorName();
在 C++ 中,析构函数的语法如下:~构造函数名();
Hence, for instance, if the name of the class is "Complex", the destructor of the class would be as follows (the name of the constructor would be "Complex"):
因此,例如,如果类名是“Complex”,则该类的析构函数将如下所示(构造函数名称将是“Complex”):
~Complex();
~Complex();
67. Explain the different types of classloaders in Java.
解释Java中不同类型的类加载器。
- 知识点: 其他/未分类 (标签: interviewbit, arcesium, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Arcesium
- id: 69b3793d58d557c902b993e4 | 官方: 否 | 付费: 否
答案:
Java Virtual Machine or JVM's Classloader subsystem has the responsibility of loading class files. On the execution of a Java application, the classloader is loaded firstly. The following are Java's three built-in classloaders: - Extension ClassLoader: This is the parent of System ClassLoader and the child of Bootstrap ClassLoader. The $JAVA_HOME/jre/lib/ext directory's jar files are loaded by it.
Java虚拟机或JVM的类加载器子系统负责加载类文件。在执行Java应用程序时,首先加载类加载器。以下是Java的三个内置类加载器:- 扩展类加载器:这是系统类加载器的父类,引导类加载器的子类。它加载$JAVA_HOME/jre/lib/ext目录中的jar文件。
- ClassLoader in Bootstrap: ClassLoader is the superclass of Extension classloader, which is the default classloader in Bootstrap. It loads the rt.jar file, which contains all Java Standard Edition class files, including java.lang, java.net, java.util, java.io, and java.sql package classes and many more.
- System or Application ClassLoader: System/Application ClassLoader is an extension classloader's child classloader. The classpath is used to load the class files. By default, the classpath is set to the current directory. To change the classpath, use the "-cp" or "-classpath" switches. Another name for it is application classloader.
68. What do you understand about SMID?
你对SMID有什么理解?
- 知识点: 其他/未分类 (标签: interviewbit, arcesium, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Arcesium
- id: 69b3793e58d557c902b993f3 | 官方: 否 | 付费: 否
答案:
SMID stands for single instruction multiple data and is a class in Flynn's taxonomy of parallel architectures. Different processing elements in this architecture all execute the same instruction in the same clock cycle, with the respective data (e.g., in registers) being independent of one another.
SMID代表单指令多数据,是弗林并行架构分类中的一类。此架构中的不同处理元素在同一时钟周期内执行相同的指令,各自的数据(例如,在寄存器中)相互独立。
69. How does OpenMP make it possible to program in shared memory?
OpenMP如何实现在共享内存中编程?
- 知识点: 其他/未分类 (标签: interviewbit, arcesium, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Arcesium
- id: 69b3793e58d557c902b993f9 | 官方: 否 | 付费: 否
答案:
To control the automatic creation of threads in OpenMP, pragmas are used. The threads share memory because they share the address space. They do, however, have access to a local view of the shared variables via "private" variables. Each thread gets its own variablecopy, which the compiler can optionally initialise with the original variable. The references to private variables are statically updated to the new variables within the thread.
为了控制OpenMP中线程的自动创建,使用了pragma指令。线程共享内存,因为它们共享地址空间。然而,它们通过“私有”变量可以访问共享变量的局部视图。每个线程获得自己的变量副本,编译器可以选择性地用原始变量初始化该副本。对私有变量的引用会在线程内静态更新为新变量。
70. Why do you want to join Arcesium?
你为什么想加入Arcesium?
- 知识点: 其他/未分类 (标签: interviewbit, arcesium, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Arcesium
- id: 69b3793e58d557c902b99408 | 官方: 否 | 付费: 否
答案:
Arcesium works on cutting edge technologies to provide cloud-based solutions to its clients. Therefore, the exposure given to an Arcesium software engineer is really good and there are a plethora of opportunities for one to explore and learn new skills. The work culture at Arcesium is very good and it provides its employees with a lot of benefits for health and insurance, vacations, etc. Also, the compensation offered to an Arcesium software engineer is pretty good, much more than the industry standards, and therefore, any Software Engineer should look forward to joining Arcesium as their place of employment.
Arcesium致力于尖端技术,为其客户提供基于云的解决方案。因此,Arcesium软件工程师获得的接触机会非常好,有大量机会去探索和学习新技能。Arcesium的工作文化非常好,为员工提供许多健康和保险、假期等福利。此外,Arcesium软件工程师的薪酬相当不错,远高于行业标准,因此,任何软件工程师都应该期待加入Arcesium作为他们的工作场所。
71. Is Arcesium a product based company?
Arcesium是一家产品型公司吗?
- 知识点: 其他/未分类 (标签: interviewbit, arcesium, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Arcesium
- id: 69b3793e58d557c902b9940c | 官方: 否 | 付费: 否
答案:
No, Arcesium is not really a product based company. It is a post-trade technology and professional services firm.
不,Arcesium并不是一家真正的产品型公司。它是一家交易后技术及专业服务公司。
72. Is Arcesium the same as the Hedge fund D.E. Shaw?
Arcesium和对冲基金D.E. Shaw是同一家公司吗?
- 知识点: 其他/未分类 (标签: interviewbit, arcesium, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Arcesium
- id: 69b3793e58d557c902b9940f | 官方: 否 | 付费: 否
答案:
No, Arcesium and D.E. Shaw are not the same company. Arcesium was founded as a joint venture with Blackstone Alternative Asset Management, based on a platform built and tested by the D. E. Shaw group, an investment and technology development organisation. Another significant client, J.P. Morgan, later joined as their third partner and Arcesium became independent from D.E. Shaw in 2015.
不,Arcesium和D.E. Shaw不是同一家公司。Arcesium是作为与贝莱德另类资产管理公司的合资企业创立的,基于D. E. Shaw集团(一家投资和技术开发组织)构建和测试的平台。另一个重要客户摩根大通后来加入成为他们的第三个合作伙伴,Arcesium于2015年从D.E. Shaw独立出来。
73. Does Arcesium pay well?
Arcesium的薪酬好吗?
- 知识点: 其他/未分类 (标签: interviewbit, arcesium, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Arcesium
- id: 69b3793e58d557c902b99412 | 官方: 否 | 付费: 否
答案:
Yes, Arcesium pays its Software Developers well. The annual compensation for an Arcesium Software Engineer is about sixteen and a half lakh rupees. The salary for a Software Engineer at Arcesium might range from around one lakh sixty thousand rupees to about sixty-one lakh rupees per year.
是的,Arcesium为其软件开发人员支付高薪。Arcesium软件工程师的年薪约为165万卢比。Arcesium软件工程师的薪资范围大约在每年16万卢比到610万卢比之间。
74. How do I get an Arcesium internship?
我如何获得Arcesium的实习机会?
- 知识点: 其他/未分类 (标签: interviewbit, arcesium, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Arcesium
- id: 69b3793e58d557c902b99415 | 官方: 否 | 付费: 否
答案:
To apply for an internship in software development at Arcesium, visit their careers portal as soon as you find an opening. Reaching out to recruiters via social media networks such as Linkedin could also be an option for obtaining an internship at Arcesium. If an Arcesium recruiter likes a candidate's resume, he or she may be invited to go through the Arcesium Recruitment process, as described in the preceding article, and may be offered an internship. It should be noted that the number of interview rounds may be reduced compared to those for ordinary employment if the recruiter deems it necessary.
要申请Arcesium的软件开发实习,一旦发现有职位空缺,请尽快访问他们的职业门户网站。通过LinkedIn等社交媒体网络联系招聘人员也可能是获得Arcesium实习的一种方式。如果Arcesium的招聘人员看中某位候选人的简历,该候选人可能会被邀请参加前述文章中描述的Arcesium招聘流程,并可能获得实习机会。需要注意的是,如果招聘人员认为有必要,面试轮次可能会比普通招聘时有所减少。
75. When should manual testing be preferred over automated testing?
什么时候应该优先选择手动测试而不是自动化测试?
- 知识点: 其他/未分类 (标签: interviewbit, avasoft, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: AVASOFT
- id: 69b3795958d557c902b9a97b | 官方: 否 | 付费: 否
答案:
The following are some situations in which manual testing is advisable over automation testing: - Short-time projects: While automated tests are intended to save time and resources, they require planning and maintenance. When developing a small promotional website, for example, it can be more cost-effective to rely on manual testing.
以下是一些建议使用手动测试而非自动化测试的情况:- 短期项目:虽然自动化测试旨在节省时间和资源,但它们需要规划和维护。例如,在开发一个小型促销网站时,依靠手动测试可能更具成本效益。
- Usability Testing: A usability test measures how easy, convenient, or efficient the software or product is to use for the end-user. Given the importance of human observation, manual testing may be more appropriate.
- Ad-hoc Testing: There is no specific method for ad-hoc testing. The key thing to remember is that ad-hoc testing is completely unplanned, and the only key factor for success is the tester's understanding and insight. You can do this manually.
- Exploratory Testing: This type of testing calls for the tester's analytical skills, logical reasoning, intuition, and creativity. Human involvement is therefore essential for these types of tests.
76. State difference between Smoke and Sanity Testing.
说明冒烟测试和健全性测试之间的区别。
- 知识点: 其他/未分类 (标签: interviewbit, avasoft, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: AVASOFT
- id: 69b3795958d557c902b9a97e | 官方: 否 | 付费: 否
答案:
The difference between Smoke testing and Sanity testing are as follows:
冒烟测试和健全性测试的区别如下:
| Smoke Testing 冒烟测试 | Sanity Testing 健全性测试 |
|---|---|
| Smoke tests are performed on software builds in order to identify whether a deployed build is stable. 冒烟测试在软件构建上执行,以识别部署的构建是否稳定。 | A software build that has passed smoke testing, but has minor changes in code or functionality, is subjected to sanity testing to ensure that the changes are working as expected. 一个已通过冒烟测试但在代码或功能上有微小更改的软件构建,会进行健全性测试,以确保更改按预期工作。 |
| The newly constructed build is tested to measure its stability in a more rigorous testing environment. 对新构建的构建进行测试,以在更严格的测试环境中衡量其稳定性。 | The purpose of this test is to assess the rationality and originality of software builds. 此测试的目的是评估软件构建的合理性和原创性。 |
| This type of testing falls under acceptance testing. 这种测试属于验收测试。 | It falls under regression testing. 它属于回归测试。 |
| Tests require documentation and scripting. 测试需要文档和脚本编写。 | There is no emphasis on documentation. 不强调文档。 |
| Make sure to test major features and functions in a shallow and wide manner without delving too deeply. 确保以浅显而广泛的方式测试主要特性和功能,而不过于深入。 | Focus on testing functionalities and features in a narrow & deep manner. 专注于以狭窄而深入的方式测试功能和特性。 |
| Tests are carried out by developers or testers 测试由开发人员或测试人员执行。 | Tests are carried out by testers. 测试由测试人员执行。 |
Useful Resources
有用资源
- Java Interview Questions
- SQL Interview Questions
- Data Engineer Interview Questions
- Software Engineering Interview Questions
- Software Testing Interview Questions
- Technical Interview Questions
- Coding Interview Questions
- Interview Resources
77. How is regression testing performed?
回归测试是如何执行的?
- 知识点: 其他/未分类 (标签: interviewbit, avasoft, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: AVASOFT
- id: 69b3795958d557c902b9a981 | 官方: 否 | 付费: 否
答案:
To begin the Regression Testing procedure, we must first debug the code to find any flaws. Following the detection of flaws and the necessary modifications, regression testing is performed by selecting appropriate test cases from the test suite that cover both modified and affected code portions. The following strategies can be used for regression testing: - Retest All: It is an approach that involves re-running all of the tests present in an existing test suite or bucket.
要开始回归测试流程,我们首先必须调试代码以发现任何缺陷。在检测到缺陷并进行必要的修改后,通过从测试套件中选择覆盖修改和受影响代码部分的适当测试用例来执行回归测试。以下策略可用于回归测试:- 全部重测:这是一种涉及重新运行现有测试套件或测试桶中所有测试的方法。
- Regression Test Selection: It is an approach that involves re-running only selected test cases from a test suite to see if the modified code has an impact on the software application.
- Prioritization of Test Cases: It is a technique that involves re-running test cases that have been prioritized. Test cases can be prioritized based on business impact, criticality & frequently used functionalities.
- Data Science
- All Events
- My Events
78. What is regression testing?
什么是回归测试?
- 知识点: 其他/未分类 (标签: interviewbit, avasoft, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: AVASOFT
- id: 69b3795958d557c902b9a984 | 官方: 否 | 付费: 否
答案:
Regression testing is a type of software testing that entails running functional and non-functional test cases to confirm that previously produced and tested software continues to function after a recent code modification. If not, this is referred to as regression. Simply said, a full or partial re-execution of previously executed test cases to ensure that existing functionality is performing effectively following code modifications.
回归测试是一种软件测试类型,它涉及运行功能性和非功能性测试用例,以确认先前生成并测试过的软件在最近代码修改后仍然继续正常工作。如果不是这样,这被称为回归。简单来说,就是完全或部分重新执行先前执行的测试用例,以确保现有功能在代码修改后仍能有效运行。
79. Write a program to determine whether or not a given number is an Armstrong number?
编写一个程序来确定给定数字是否为阿姆斯特朗数?
- 知识点: 其他/未分类 (标签: interviewbit, avasoft, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: AVASOFT
- id: 69b3795958d557c902b9a987 | 官方: 否 | 付费: 否
答案:
Given a number x, determine whether the given number is Armstrong number or not. Let x be a positive number with n digits. The number is considered to be an Armstrong number if the sum of each digit raised to the power n equals the number x itself.
给定一个数字 x,确定给定数字是否为阿姆斯特朗数。设 x 为具有 n 位数字的正数。如果每个数字的 n 次幂之和等于数字 x 本身,则该数字被认为是阿姆斯特朗数。
kcl… = pow(k, n) + pow(c, n) + pow(l, n) + …
kcl… = pow(k, n) + pow(c, n) + pow(l, n) + …
Example: Assume that number x=1634. The total number of digits in this case is 4.
示例:假设数字 x=1634。在这种情况下,总位数为 4。
1^4 + 6^4 + 3^4 + 4^4
=1 + 1296 + 81 + 256
=1634.
As we can see, the sum of each digit i.e., 1, 6, 3, and 4 raised to power 4 is equal to the number 1634. As a result, the number 1634 is an Armstrong number.
正如我们所看到的,每个数字(即 1、6、3 和 4)的 4 次幂之和等于数字 1634。因此,数字 1634 是一个阿姆斯特朗数。
Code:
代码:
import java.util.*;
import java.util.*;
class Main
class Main
{
boolean checkArmstrong(int y)
boolean checkArmstrong(int y)
{
int l = 0, n = y;
int l = 0, n = y;
while(n!=0)
while(n!=0)
{
l++;
l++;
n = n/10;
n = n/10;
}
int sum=0;
int sum=0;
int num = y;
int num = y;
while(num!=0)
while(num!=0)
{
int digit = num%10;
int digit = num%10;
sum += Math.pow(digit, l);
sum += Math.pow(digit, l);
num = num/10;
num = num/10;
}
return(sum == y);
return(sum == y);
}
public static void main(String[] args)
public static void main(String[] args)
{
Main x = new Main();
Main x = new Main();
Scanner sc=new Scanner(System.in);
Scanner sc=new Scanner(System.in);
System.out.println("Enter a number: ");
System.out.println("输入一个数字: ");
int n = sc.nextInt();
int n = sc.nextInt();
if(x.checkArmstrong(n))
if(x.checkArmstrong(n))
System.out.println("Yes, " + n + " is an Armstrong number.");
System.out.println("是, " + n + " 是一个阿姆斯特朗数。");
else
else
System.out.println("No, " + n + " is not an Armstrong number.");
System.out.println("否, " + n + " 不是一个阿姆斯特朗数。");
}
}
Sample Output 1:
样本输出 1:
Enter a number:
输入一个数字:
1634
Yes, 1634 is an Armstrong number.
是,1634 是一个阿姆斯特朗数。
Sample Output 2:
样本输出 2:
Enter a number:
输入一个数字:
567
No, 567 is not an Armstrong number.
否,567 不是一个阿姆斯特朗数。
80. What are the different levels of manual testing?
手动测试有哪些不同级别?
- 知识点: 其他/未分类 (标签: interviewbit, avasoft, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: AVASOFT
- id: 69b3795958d557c902b9a98a | 官方: 否 | 付费: 否
答案:
Manual testing is the oldest method of software testing, where testers execute test cases manually, without the use of automated tools. In other words, QA testers manually test the software application. Manual testing is comprised of four levels as follows: - Unit Testing: It involves testing the smallest unit of code that can be isolated from other code within the system. It is primarily concerned with checking the functionality of standalone modules.
手动测试是最古老的软件测试方法,测试人员在没有自动化工具的情况下手动执行测试用例。换句话说,QA测试人员手动测试软件应用程序。手动测试包括以下四个级别:- 单元测试:它涉及测试系统中可以从其他代码中隔离出来的最小代码单元。它主要关注独立模块的功能检查。
- Integration Testing: This is a type of software testing in which individual units are combined and tested to determine whether they perform as intended when integrated. In this case, the focus is on testing the interface between the modules.
- System Testing: System testing involves testing all components of the software together to ensure that it conforms to the specified requirements. System testing can be classified into dozens of categories including usability testing, regression testing, and functional testing.
- User Acceptance Testing: This last step determines whether or not the software is ready for release.
81. Write a program to print all Permutations of a given string.
编写一个程序,打印给定字符串的所有排列。
- 知识点: 其他/未分类 (标签: interviewbit, avasoft, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: AVASOFT
- id: 69b3795958d557c902b9a98d | 官方: 否 | 付费: 否
答案:
Given a string s, the task is to print all the possible permutations of the given string.
给定字符串s,任务是打印该字符串所有可能的排列。
Code:
代码:
// Java program to print permutations of a String
// Java程序,用于打印字符串的排列
import java.util.*;
import java.util.*;
public class Main
public class Main
{
public static void main(String[] args)
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
Scanner sc=new Scanner(System.in);
System.out.println("Enter a string: ");
System.out.println("输入一个字符串:");
String s= sc.nextLine();
String s= sc.nextLine();
System.out.println("\nAll Permutations of the given string:");
System.out.println("\n给定字符串的所有排列:");
int n = s.length();
int n = s.length();
Main permutation = new Main();
Main permutation = new Main();
permutation.permute(s, 0, n-1);
permutation.permute(s, 0, n-1);
}
//str=starting index
//str=起始索引
//end=end index
//end=结束索引
private void permute(String s, int str, int end)
private void permute(String s, int str, int end)
{
if (str == end)
if (str == end)
System.out.println(s);
System.out.println(s);
else
else
{
for (int i = str; i <= end; i++)
for (int i = str; i <= end; i++)
{
s = swap(s,str,i);
s = swap(s,str,i);
permute(s, str+1, end);
permute(s, str+1, end);
s = swap(s,str,i);
s = swap(s,str,i);
}
}
}
public String swap(String x, int i, int j)
public String swap(String x, int i, int j)
{
char temp;
char temp;
char[] charArray = x.toCharArray();
char[] charArray = x.toCharArray();
temp = charArray[i] ;
temp = charArray[i] ;
charArray[i] = charArray[j];
charArray[i] = charArray[j];
charArray[j] = temp;
charArray[j] = temp;
return String.valueOf(charArray);
return String.valueOf(charArray);
}
}
Output:
输出:
Enter a string:
输入一个字符串:
XYZ
XYZ
All Permutations of the given string:
给定字符串的所有排列:
XYZ
XYZ
XZY
XZY
YXZ
YXZ
YZX
YZX
ZYX
ZYX
ZXY
ZXY
82. What is the eligibility criteria at Avasoft
Avasoft 的资格标准是什么
- 知识点: 其他/未分类 (标签: interviewbit, avasoft, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: AVASOFT
- id: 69b3795958d557c902b9a9a2 | 官方: 否 | 付费: 否
答案:
Avasoft Eligibility Criteria for Software Engineers
Avasoft 软件工程师的资格标准
| Eligibility Criteria 资格标准 | Details 详情 |
|---|---|
| Graduation 毕业要求 | Eligible: BE/B.Tech/ME/MTech 合格:BE/B.Tech/ME/MTech |
| Streams 专业 | Eligible: CSE/IT/ECE 合格:CSE/IT/ECE |
| Academic and Graduation Criteria 学业和毕业标准 | 60% or 6.5 CGPA throughout 10th, 12th, and UG/PG 10年级、12年级和本科/研究生阶段成绩均为60%或CGPA 6.5 |
| Backlogs 挂科情况 | No active Backlogs 无未清除的挂科记录 |
83. How long is the Interview Process at Avasoft?
Avasoft的面试流程有多长?
- 知识点: 其他/未分类 (标签: interviewbit, avasoft, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: AVASOFT
- id: 69b3795958d557c902b9a9a5 | 官方: 否 | 付费: 否
答案:
Avasoft's interview process is fairly straightforward, with four rounds in general. Avasoft may take up to four weeks to complete a job interview, depending on its complexity. Application processes for Java Developer jobs were among the quickest (on average 7 days), while the slowest hiring process was obtained for Software Developer roles (on average 50 days).
Avasoft的面试流程相对直接,通常有四轮。根据复杂程度,Avasoft完成一次求职面试可能需要最多四周时间。Java开发职位的申请流程最快(平均7天),而软件开发职位的招聘流程最慢(平均50天)。
84. What is the salary for freshers in Avasoft?
Avasoft给新人的薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, avasoft, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: AVASOFT
- id: 69b3795958d557c902b9a9a8 | 官方: 否 | 付费: 否
答案:
Software QA Engineers at AVASOFT earn an average salary of about Rs 3.9 lakhs per year for employees with less than 1 year of experience to 3 years, while Senior Software Engineers are paid approximately Rs 8.4 lakhs per year. The overall salary and benefits package at AVASOFT is rated 4.1/5 by employees. The salary estimates were calculated based on 28 salary submissions from AVASOFT employees.
AVASOFT的软件QA工程师,具有不到1年至3年经验的员工,平均年薪约为39万卢比,而高级软件工程师的年薪约为84万卢比。员工对AVASOFT的整体薪资和福利包评分为4.1/5。薪资估算基于AVASOFT员工的28份薪资提交计算得出。
85. Why do you want to work at Avasoft?
为什么你想在Avasoft工作?
- 知识点: 其他/未分类 (标签: interviewbit, avasoft, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: AVASOFT
- id: 69b3795958d557c902b9a9ab | 官方: 否 | 付费: 否
答案:
Your response to this question demonstrates your commitment to that specific employer and will provide insight into whether you have researched the company beforehand. Don't miss the opportunity to demonstrate your genuine passion for the organization. - Demonstrate to the recruiter that you understand the company's mission and vision and desire to contribute to its success.
你对这个问题的回答展示了你对特定雇主的承诺,并将让人了解到你是否事先研究过该公司。不要错过展示你对组织真诚热情的机会。- 向招聘人员展示你理解公司的使命和愿景,并渴望为其成功做出贡献。
- You might mention how you like the company culture or employee development programs.
- Perhaps you could also mention whether the organization has a public service or environmental initiative that resonates with you.
86. How to introduce yourself in the interview?
如何在面试中介绍自己?
- 知识点: 其他/未分类 (标签: interviewbit, avasoft, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: AVASOFT
- id: 69b3795958d557c902b9a9b1 | 官方: 否 | 付费: 否
答案:
Whether it's in a job interview or a presentation, any industry or profession provides an opportunity for you to tell a bit about yourself. Among the most frequently asked questions by hiring managers, this one is designed to help them gain an understanding of you and give you the opportunity to emphasize your skills and qualifications for the position.
无论是在求职面试还是演示中,任何行业或职业都为你提供了讲述自己一些情况的机会。这是招聘经理最常问的问题之一,旨在帮助他们了解你,并给你机会强调你对该职位的技能和资质。
Do’s - Pay attention to what the hiring manager is hoping for in a candidate.
该做的 - 注意招聘经理对候选人的期望。
- Give an overview of your current roles and key traits which make you a good candidate. For freshers, it would be useful to discuss your vision and the projects you've worked on so far.
- You should describe how your skills enabled you to resolve a real-life issue.
- Mention qualities and soft skills that set you apart from the others.
Describe your profession-specific goals at the end of your self-introduction.
Don’ts - Don't mention your former employer negatively.不该做的 - 不要负面提及你的前雇主。
- Avoid getting too personal or bringing up sensitive topics such as political or religious beliefs in your response.
87. How is an abstract class different from an interface?
抽象类与接口有何不同?
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9ac48 | 官方: 否 | 付费: 否
答案:
The interface and abstract classes are both special types of classes that contain only the declarations of methods rather than their implementations. Both serve to achieve abstraction by declaring abstract methods. Interfaces, however, are entirely different from abstract classes.
接口和抽象类都是特殊的类类型,它们仅包含方法的声明而非实现。两者都通过声明抽象方法来实现抽象化。然而,接口与抽象类完全不同。
| Interface Class 接口类 | Abstract Class 抽象类 |
|---|---|
| Whenever an interface class is implemented, its subclass must define all of its abstract methods and provide their implementation. 每当实现接口类时,其子类必须定义其所有抽象方法并提供实现。 | Whenever an abstract class is inherited, its subclass isn't obligatory to define its abstract methods until the subclass uses the abstract methods. 每当继承抽象类时,除非子类使用抽象方法,否则子类不必定义其抽象方法。 |
| Interfaces can only have abstract methods. As of Java 8, they can also have static and default methods. 接口只能有抽象方法。自Java 8起,它们也可以有静态和默认方法。 | An abstract class may contain both abstract methods and non-abstract methods. 抽象类可能包含抽象方法和非抽象方法。 |
| Multiple inheritances is supported by the interface. 接口支持多继承。 | Multiple inheritances is not supported by abstract classes. 抽象类不支持多继承。 |
| Interfaces can extend other Java interfaces only. 接口只能扩展其他Java接口。 | Abstract classes extend other Java classes and implement multiple Java interfaces. 抽象类扩展其他Java类并实现多个Java接口。 |
| Java interfaces have public members by default. Java接口默认具有公共成员。 | There can be different types of class members available in Java abstract classes, such as private and protected. Java抽象类中可以有不同的类成员类型,如私有的和受保护的。 |
| It is not possible to declare constructors or destructors in an interface. 不可能在接口中声明构造函数或析构函数。 | Constructors and destructors can be declared in an abstract class. 在抽象类中可以声明构造函数和析构函数。 |
| When declaring a method as abstract in an interface, the keyword "abstract" is optional. 在接口中将方法声明为抽象时,关键字“abstract”是可选的。 | To declare a method abstract in abstract classes, the keyword "abstract" is required. 在抽象类中将方法声明为抽象时,关键字“abstract”是必需的。 |
| Variables must only be final and static. 变量必须是final和static的。 | Static, non-static, and final, non-final variables can all be present in an abstract class. 静态、非静态、final和非final变量都可以出现在抽象类中。 |
88. What are the most common clauses in SELECT statements?
SELECT语句中最常见的子句有哪些?
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9ac4e | 官方: 否 | 付费: 否
答案:
SQL SELECT statements retrieve data from the database according to specified conditions, if any. SELECT statement may include the following clauses: - WHERE: Used to filter out records, i.e., it fetches and returns only relevant data from a table that meets certain criteria.
SQL SELECT语句根据指定条件(如果有)从数据库中检索数据。SELECT语句可能包含以下子句:- WHERE:用于过滤记录,即从表中获取并返回符合特定条件的仅相关数据。
- ORDER BY: Sort records in ascending order or descending order in SQL.
- GROUP BY: Groups rows that have the same values in a result set.
- FROM: Specifies the name of the table from which data is to be retrieved.
- LIMIT: Sets the number of rows to return.
- TOP: Specifies how many rows of tables should be shown in the result.
- Data Science
- All Events
- My Events
89. Is it always necessary to create objects of a class?
是否总是需要创建类的对象?
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9ac51 | 官方: 否 | 付费: 否
答案:
No, it is not always necessary to create instances (objects) of a particular class. It is necessary to create an object if a class contains non-static methods, but if the class contains static methods, objects do not have to be created. A static method can be invoked/called directly using the class name, which means you don't need to create a new object of the class. A non-static method can only be called on an object, which means you must create a new instance (object) of the class.
不,并不总是需要创建特定类的实例(对象)。如果类包含非静态方法,则需要创建对象,但如果类包含静态方法,则不必创建对象。静态方法可以直接使用类名调用/调用,这意味着你不需要创建类的新对象。非静态方法只能在对象上调用,这意味着你必须创建类的新实例(对象)。
90. Is class and structure the same? If not, what are the differences between a class and a structure?
类和结构体是一样的吗?如果不是,类和结构体之间有什么区别?
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9ac5d | 官方: 否 | 付费: 否
答案:
In C++, a structure behaves similarly to a class, with a few small exceptions/differences. The most significant exception relates to the hiding of implementation details. By default, structures do not hide their implementation details from users, while classes hide all implementation details by default and thus do not allow programmers to access them.
在C++中,结构体的行为类似于类,只有一些小的例外/差异。最显著的例外与实现细节的隐藏有关。默认情况下,结构体不会向用户隐藏其实现细节,而类默认隐藏所有实现细节,因此不允许程序员访问它们。
| Class 类 | Structure 结构体 |
|---|---|
| A class is a user-defined data structure or type in C++ that is declared by using the keyword class. In essence, a class is a collection of methods and fields. 类是在C++中使用关键字class声明的用户定义数据结构或类型。本质上,类是方法和字段的集合。 | A structure is a set of variables of different data types (such as strings, integers, bools, etc.) grouped together under a single name. A variable within the structure is known as a data member. 结构体是不同类型变量(如字符串、整数、布尔值等)的集合,在单个名称下分组。结构体中的变量称为数据成员。 |
| A class provides support for inheritance. Usually, a class can create a subclass that inherits the methods and properties of its parent class. 类提供对继承的支持。通常,类可以创建子类,继承其父类的方法和属性。 | Inheritance is not supported in structure. 结构体不支持继承。 |
| A class is essentially a reference type and its objects are created in heap memory. 类本质上是引用类型,其对象在堆内存中创建。 | A structure is essentially a value type and its objects are created in stack memory. 结构体本质上是值类型,其对象在栈内存中创建。 |
| All members of the class are automatically set to be private if none of the access specifiers are provided. 如果未提供任何访问说明符,类的所有成员自动设置为私有。 | All members of the structure are automatically set to be public if none of the access specifiers are provided. 如果未提供任何访问说明符,结构体的所有成员自动设置为公有。 |
| By default, the base classes and structures of a class are private. 默认情况下,类的基类和结构体是私有的。 | Base classes/structures of a structure are public by default. 结构体的基类/结构体默认是公有的。 |
| Data abstraction and inheritance are implemented using it. 使用它来实现数据抽象和继承。 | It is used for the grouping of data. 它用于数据的分组。 |
| Any type of constructor and destructor could be present in it. 其中可以存在任何类型的构造函数和析构函数。 | It may have only a parameterized constructor. 它只能有参数化构造函数。 |
| Null values may be assigned to class variables. 可以为类变量分配空值。 | Structure members, however, cannot have null values. 然而,结构体成员不能具有空值。 |
| Syntax: class class-name { // data // functions }; 语法:class class-name { // data // functions }; | Syntax: struct structure_name { // member declarations. } 语法:struct structure_name { // member declarations. } |
91. What will be the output of the following code?
以下代码的输出将是什么?
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9ac60 | 官方: 否 | 付费: 否
答案:
Code:
代码:
import java.util.*;
import java.util.*;
public class Main{
public class Main{
public static void main(String[] arr)
public static void main(String[] arr)
{
System.out.println("ScalerEdge");
System.out.println("ScalerEdge");
}
public static void main(String arr)
public static void main(String arr)
{
System.out.println("ScalerVerse");
System.out.println("ScalerVerse");
}
}
Output:
输出:
ScalerEdge
ScalerEdge
Reason:
原因:
In this case, the main() method is overloaded. The JVM (Java Virtual Machine), however, only understands methods that have a String[] argument in their definition. ScalerEdge, as a result, is printed in the output and the overloaded main method is ignored.
在这种情况下,main() 方法被重载了。然而,JVM(Java虚拟机)只理解定义中包含 String[] 参数的方法。因此,输出中打印了 ScalerEdge,而重载的 main 方法被忽略了。
92. What are different types of data dictionaries?
数据字典有哪些不同类型?
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9ac71 | 官方: 否 | 付费: 否
答案:
Data dictionaries typically fall into two categories: active and passive dictionaries. Both differ in the level of automatic synchronization they provide. - Active Data dictionary: The database management system is responsible for ensuring that any changes to the database structure reflect immediately in the data dictionary. This method of immediate update is followed by Active Data Dictionary, as it is self-updating. By doing so, there will be no discrepancies between the data dictionary and its corresponding database structure.
数据字典通常分为两类:主动字典和被动字典。两者在提供的自动同步级别上有所不同。- 主动数据字典:数据库管理系统负责确保数据库结构中的任何更改都立即反映在数据字典中。主动数据字典采用这种即时更新方法,因为它是自动更新的。通过这样做,数据字典与其对应的数据库结构之间不会存在差异。
- Passive Data dictionary: Passive dictionaries are not as useful or as easy to use as active dictionaries. Each time a database is modified, the data dictionary must be updated manually to align with the database. The dictionary is maintained independently from the database.
93. Explain data dictionaries and their components.
解释数据字典及其组成部分。
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9ac74 | 官方: 否 | 付费: 否
答案:
Similar to any other subject dictionary, a Data Dictionary contains a collection of data objects and related items contained within a database for the convenience of programmers and others who may need to reference the data. In software technology terminology, these objects are called "Metadata". Data dictionaries are often used as centralized metadata repositories. In most cases, these objects concern data ownership, relationships among data objects, and other aspects of data structure. These dictionaries present a useful guide for understanding and evaluating data. - If your data is stored and managed in a relational database, your software can generate a data dictionary for you.
与任何其他主题字典类似,数据字典包含数据库中数据和相关项的集合,以方便程序员和其他可能需要引用数据的人员使用。在软件技术术语中,这些对象被称为“元数据”。数据字典通常用作集中式元数据存储库。在大多数情况下,这些对象关注数据所有权、数据对象之间的关系以及数据结构的其他方面。这些字典为理解和评估数据提供了有用的指南。- 如果您的数据存储在关系数据库中并加以管理,您的软件可以为您生成一个数据字典。
In case your data is stored and managed in spreadsheets, comma-separated values, or text files, you will have to manually create a data dictionary.
Data Dictionary components数据字典组件
Data dictionaries can contain a variety of contents. All of these components provide information about data and are generally classified as metadata. - Object names, aliases, and definitions
数据字典可以包含各种内容。所有这些组件都提供有关数据的信息,通常被归类为元数据。- 对象名称、别名和定义
- Properties of data elements (e.g., unique identifiers, size, indexes, data types, nullability, and optionality)
- Business rules (such as those relating to data quality and schema objects)
- System-level diagrams
- ERD (Entity-relationship diagrams)
- Reference data
- Quality-indicator codes, etc.
94. Write a program to return the length of the longest consecutive subsequence.
编写一个程序,返回最长连续子序列的长度。
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9ac7e | 官方: 否 | 付费: 否
答案:
Given an array scaler[] of n integers, determine the length of the longest consecutive subsequence. There is no particular order to the consecutive numbers.
给定一个包含 n 个整数的数组 scaler[],确定最长连续子序列的长度。连续数字没有特定的顺序。
Code:
代码:
import java.io.*;
import java.io.*;
import java.util.*;
import java.util.*;
class Main
class Main
{
static int LongConsSubseq(int scaler[], int n)
static int LongConsSubseq(int scaler[], int n)
{
Arrays.sort(scaler);
Arrays.sort(scaler);
int res = 0, count = 0;
int res = 0, count = 0;
ArrLista = new ArrList ();
ArrLista = new ArrList ();
a.add(10);
a.add(10);
for (int i = 1; i < n; i++)
for (int i = 1; i < n; i++)
{
if (scaler[i] != scaler[i - 1])
if (scaler[i] != scaler[i - 1])
a.add(scaler[i]);
a.add(scaler[i]);
}
// Traverse the array to find the maximum length
// 遍历数组以找到最大长度
for (int i = 0; i < a.size(); i++)
for (int i = 0; i < a.size(); i++)
{
if (i > 0 &&a.get(i) == a.get(i - 1) + 1)
if (i > 0 && a.get(i) == a.get(i - 1) + 1)
count++;
count++;
else
else
count = 1;
count = 1;
res = Math.max(res, count);
res = Math.max(res, count);
}
return res;
返回 res;
}
// Driver code
// 驱动代码
public static void main(String[] args)
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
Scanner sc=new Scanner(System.in);
System.out.println("Enter total number of elements: ");
System.out.println("输入元素总数:");
int n = sc.nextInt();
int n = sc.nextInt();
System.out.println("\nEnter elements of the array: ");
System.out.println("\n输入数组的元素: ");
int[] scaler = new int[10];
int[] scaler = new int[10];
for (int i = 0 ; i < n; i++ )
for (int i = 0 ; i < n; i++ )
{
scaler[i]= sc.nextInt();
scaler[i]= sc.nextInt();
}
System.out.println("\nLength of the longest contiguous subsequence is: " + LongConsSubseq(scaler, n));
System.out.println("\n最长连续子序列的长度是:" + LongConsSubseq(scaler, n));
}
}
Output:
输出:
Enter total number of elements:
输入元素总数:
8
Enter elements of the array:
输入数组的元素:
4
6
5
7
2
9
8
1
Length of the longest contiguous subsequence is: 4
最长连续子序列的长度是:4
95. Write a program to find the minimum number of operations to make all elements of the array equal.
编写一个程序,找出使数组所有元素相等所需的最少操作次数。
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9ac82 | 官方: 否 | 付费: 否
答案:
Given an array 'scaler[]' of 'n' positive integers, you must determine the minimum number of operations necessary to make all elements of the array equal. Array elements can be added to, multiplied by, subtracted from, or divided by. Any operation on an element of the array will be considered a single operation.
给定一个包含'n'个正整数的数组'scaler[]',你必须确定使数组所有元素相等所需的最少操作次数。数组元素可以进行加法、乘法、减法或除法运算。对数组中任意一个元素进行的任何操作都将被视为一次操作。
Code:
代码:
import java.util.*;
import java.util.*;
class Main
class Main
{
//Function to return minimum operations needed to equalize array elements
//函数:返回使数组元素相等所需的最小操作次数
static int minOpera(int scaler[], int n)
static int minOpera(int scaler[], int n)
{
HashMap p = new HashMap();
HashMap p = new HashMap();
for (int i = 0; i < n; i++)
for (int i = 0; i < n; i++)
{
if (p.containsKey(scaler[i]))
if (p.containsKey(scaler[i]))
{
mp.put(scaler[i], mp.get(scaler[i]) + 1);
mp.put(scaler[i], mp.get(scaler[i]) + 1);
}
else
else
{
mp.put(scaler[i], 1);
mp.put(scaler[i], 1);
}
}
int maxFreq = Integer.MIN_VALUE;
int maxFreq = Integer.MIN_VALUE;
maxFreq = Collections.max(mp.entrySet(),
maxFreq = Collections.max(mp.entrySet(),
Comparator.comparingInt(Map.Entry::getKey)).getValue();
Comparator.comparingInt(Map.Entry::getKey)).getValue();
// Return the minimum operations required
// 返回所需的最小操作次数
return (n - maxFreq);
return (n - maxFreq);
}
// Driver code
// 驱动代码
public static void main(String[] args)
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
Scanner sc=new Scanner(System.in);
System.out.println("Enter total number of elements: ");
System.out.println("输入元素总数:");
int n = sc.nextInt();
int n = sc.nextInt();
System.out.println("\nEnter elements of the array: ");
System.out.println("\n输入数组的元素: ");
int[] scaler = new int[10];
int[] scaler = new int[10];
for (int i = 0 ; i < n; i++ )
for (int i = 0 ; i < n; i++ )
{
scaler[i]= sc.nextInt();
scaler[i]= sc.nextInt();
}
System.out.println("\nMinimum required operations = " + minOpera(scaler, n));
System.out.println("\n所需的最小操作次数 = " + minOpera(scaler, n));
}
}
Output:
输出:
Enter total number of elements:
输入元素总数:
4
Enter elements of the array:
输入数组的元素:
3
5
9
6
Minimum required operations = 3
所需的最小操作次数 = 3
96. What data type would you use if you wanted it to be immutable?
如果你希望数据不可变,你会使用什么数据类型?
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9ac85 | 官方: 否 | 付费: 否
答案:
Unlike mutable data types, immutable data types cannot be altered following their creation. Mutable data types can be changed after they have been created, but immutable data types cannot. A few examples of immutable data types include bytes, numeric data types, strings, frozen sets, and tuples.
与可变数据类型不同,不可变数据类型在创建后不能被修改。可变数据类型在创建后可以被更改,但不可变数据类型则不能。不可变数据类型的一些例子包括字节、数值数据类型、字符串、冻结集合和元组。
97. What do you mean by lambda functions and how to use them?
你所说的lambda函数是什么意思,以及如何使用它们?
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9ac89 | 官方: 否 | 付费: 否
答案:
As a programming technique, lambda functions are small anonymous functions that are often used when a function needs to be executed for a very short period of time. An anonymous function is a function without a name and it is declared using the lambda keyword in Python. In many cases, this can be used whenever you want to pass a function as an argument to a higher-order function, i.e., to a function that accepts other functions as arguments.
作为一种编程技术,lambda函数是小型匿名函数,通常用于需要在极短时间内执行函数的情况。匿名函数是没有名称的函数,在Python中使用lambda关键字进行声明。在许多情况下,当你希望将函数作为参数传递给高阶函数(即接受其他函数作为参数的函数)时,都可以使用它。
Syntax:
语法:
lambda arguments : expression
lambda 参数 : 表达式
Even when there is no return statement, the function simply returns the expression result. The lambda function can accept several arguments but is restricted to only one expression. - Example1:
即使没有return语句,函数也会直接返回表达式的结果。lambda函数可以接受多个参数,但仅限于一个表达式。- 示例1:
Perform addition using lambda
add = lambda x: x+10
add = lambda x: x+10
print(add(2))
print(add(2))
Here, lambda x: x+10' is the lambda function. ‘x’ is the argument x + 10 is evaluated and the result of the expression is returned.
这里,lambda x: x+10是lambda函数。x是参数,计算x + 10并返回表达式的结果。
Output:
输出:
12
- Example2: This example illustrates how anonymous functions can be used within another function.
def addfunc(num):
def addfunc(num):
return lambda x : x + num
return lambda x : x + num
result = addfunc(10)
result = addfunc(10)
print(result(2))
print(result(2))
Here, we have a function 'addfunc' that takes one argument 'num', where the argument is to be multiplied by a number 'x' that is unknown.
这里,我们有一个函数addfunc,它接受一个参数num,其中该参数要与未知的数字x相乘。
Output:
输出:
12
98. Explain list comprehension.
解释列表推导式。
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9ac92 | 官方: 否 | 付费: 否
答案:
One of the few programming languages that are easy to read is Python, which can be used to create code that is easy to write, elegant, and appears to be written in plain English. List comprehension is a compelling feature of this programming language that allows the creation of powerful functionality within a single line of code. It is an easy and compact way to create a new list from a string or another list. In this way, we can create a new list very quickly by operating on each element of the existing list. List comprehension is considerably more efficient than using a for loop to process a list.
Python是为数不多的易于阅读的编程语言之一,它可以用来创建易于编写、优雅且看起来像用普通英语编写的代码。列表推导式是该编程语言的一个强大特性,允许在单行代码内创建强大的功能。它是一种从字符串或另一个列表创建新列表的简单而紧凑的方法。通过这种方式,我们可以通过对现有列表的每个元素进行操作来快速创建新列表。列表推导式比使用for循环处理列表要高效得多。
Syntax:
语法:
newList = [ expression(element) for element in oldList if condition ]
newList = [ expression(element) for element in oldList if condition ]
print(newList)
print(newList)
OR
或者
newList = []
newList = []
for item in 'oldList':
for item in 'oldList':
newList.append(character)
newList.append(character)
print(newList)
print(newList)
Example1:
示例1:
newList = []
newList = []
for character in 'Scaler':
for character in 'Scaler':
newList.append(character)
newList.append(character)
print(newList)
print(newList)
Output:
输出:
['S', 'c', 'a', 'l', 'e', 'r']
['S', 'c', 'a', 'l', 'e', 'r']
Example2:
示例2:
newList = [character for character in 'Scaler']
newList = [character for character in 'Scaler']
print(newList)
print(newList)
Output:
输出:
['S', 'c', 'a', 'l', 'e', 'r']
['S', 'c', 'a', 'l', 'e', 'r']
99. State difference between Function overloading and Function overriding.
说明函数重载和函数重写之间的区别。
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9ac9a | 官方: 否 | 付费: 否
答案:
Polymorphism in Java is achieved by overriding and overloading.
Java中的多态是通过重写和重载实现的。
| Overloading 重载 | Overriding 重写 |
|---|---|
| A method overloading is a situation where a class contains more than one method named the same, but with different parameters. 方法重载是指一个类中包含多个同名但参数不同的方法的情况。 | A method override occurs when the superclass and the child class have the same names and arguments/parameters. 方法重写发生在父类和子类具有相同的方法名和参数时。 |
| Different parameters are required for overloading. 重载需要不同的参数。 | Overriding requires the same parameters 重写需要相同的参数。 |
| Overloading takes place within a class. 重载发生在类内部。 | A class can override another when the two classes share an IS-A (inheritance) relationship. To override, both the base class and its child class must exist. 当两个类之间存在IS-A(继承)关系时,一个类可以重写另一个类。要进行重写,基类和子类都必须存在。 |
| Static binding is used for method overloading. 方法重载使用静态绑定。 | Dynamic binding is used for method overriding. 方法重写使用动态绑定。 |
| Compile-time polymorphism is demonstrated here. 这里展示的是编译时多态。 | Run-time polymorphism is demonstrated here. 这里展示的是运行时多态。 |
| If overloading breaks, a compiler error will appear, which can easily be fixed. 如果重载出错,会出现编译器错误,方便修复。 | Overriding breaks can create serious problems since the effects can be seen at runtime. 重写出错可能造成严重问题,因为其影响在运行时才能看到。 |
Overloading Example:
重载示例:
class Main
class Main
{
static int min(int x, int y)
static int min(int x, int y)
{
return x - y;
return x - y;
}
static int min(int x, int y, int z)
static int min(int x, int y, int z)
{
return x - y - z;
return x - y - z;
}
public static void main(String args[])
public static void main(String args[])
{
System.out.println("x - y = " + min(10, 5));
System.out.println("x - y = " + min(10, 5));
System.out.println("x - y - z = " + min(10, 5, 1));
System.out.println("x - y - z = " + min(10, 5, 1));
}
}
Output:
输出:
x - y = 5
x - y = 5
x - y - z = 4
x - y - z = 4
Overriding Example:
覆盖示例:
class Scaler
class Scaler
{
void show()
void show()
{ System.out.println("Scaler");
{ System.out.println("Scaler");
}
}
class ScalerVerse extends Scaler
class ScalerVerse extends Scaler
{
void show()
void show()
{
super.show();
super.show();
System.out.println("ScalerVerse by Scaler");
System.out.println("ScalerVerse by Scaler");
}
}
class Main
class Main
{
public static void main(String args[])
public static void main(String args[])
{
Scaler ob = new ScalerVerse();
Scaler ob = new ScalerVerse();
ob.show();
ob.show();
}
}
Output:
输出:
Scaler
Scaler
ScalerVerse by Scaler
Scaler 旗下的 ScalerVerse
100. Write a program that removes consecutive duplicate characters from a string.
编写一个程序,从字符串中移除连续重复的字符。
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9ac9f | 官方: 否 | 付费: 否
答案:
Given string str, remove all the consecutive duplicates from a string.
给定字符串 str,移除字符串中所有连续的重复字符。
For e.g:
例如:
String: 'Scaaaleer Famiillyyyy'.
字符串:'Scaaaleer Famiillyyyy'。
Output: Scaler Family
输出:Scaler Family
Code:
代码:
import java.util.*;
import java.util.*;
import java.io.*;
import java.io.*;
class Main
class Main
{
// Function to remove adjacent duplicates characters from a string
// 函数:从字符串中移除相邻重复的字符
public static String removeConsecutiveDuplicates(String str)
public static String removeConsecutiveDuplicates(String str)
{
// base case
// 基本情况
if (str == null)
if (str == null)
{
return null;
返回 null;
}
char[] chars = str.toCharArray();
char[] chars = str.toCharArray();
char prev = 0;
char prev = 0;
int k = 0;
int k = 0;
for (char c: chars)
for (char c: chars)
{
if (prev != c)
if (prev != c)
{
chars[k++] = c;
chars[k++] = c;
prev = c;
prev = c;
}
}
return new String(chars).substring(0, k);
return new String(chars).substring(0, k);
}
public static void main(String[] args)
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
Scanner sc=new Scanner(System.in);
System.out.println("Enter a string: ");
System.out.println("输入一个字符串:");
String str= sc.nextLine();
String str= sc.nextLine();
var answer = removeConsecutiveDuplicates(str);
var answer = removeConsecutiveDuplicates(str);
System.out.println("\nString after removing consecutive duplicate characters: " + answer );
System.out.println("\n去除连续重复字符后的字符串:" + answer );
}
}
Output:
输出:
Enter a string:
输入一个字符串:
Scaaaleer Famiillyyyy
Scaaaleer Famiillyyyy
String after removing consecutive duplicate characters: Scaler Family
移除连续重复字符后的字符串:Scaler Family
Axis Bank Interview Preparation
101. What is the Eligibility Criteria at Axis Bank?
Axis Bank的资格标准是什么?
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9acb7 | 官方: 否 | 付费: 否
答案:
Axis Bank Eligibility Criteria for Software Engineers:
Axis Bank软件工程师的资格标准:
| Eligibility Criteria 资格标准 | Details 详情 |
|---|---|
| Graduation 学历 | Eligible: BE/B.Tech, ME/M.Tech, MCA, BCA, M.Com, B.Com, B.Sc, M.Sc 合格:BE/B.Tech、ME/M.Tech、MCA、BCA、M.Com、B.Com、B.Sc、M.Sc |
| Academic and Graduation Criteria 学业和毕业标准 | 50% throughout 10th, 12th, and UG/PG 10年级、12年级和本科/研究生阶段成绩均需达到50% |
| Backlogs 未完成课程 | No active Backlogs 无未完成课程 |
102. How long is the Axis Bank Interview Process?
Axis Bank的面试流程需要多长时间?
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9acba | 官方: 否 | 付费: 否
答案:
Axis Bank's hiring process is dynamic and fast-paced, usually consisting of two interview rounds that include a variety of questions. Axis Bank interviews may take between three and four weeks to complete, depending on the job's difficulty.
Axis Bank的招聘流程充满活力且节奏快,通常包括两轮面试,涵盖各种问题。根据职位的难度,Axis Bank的面试可能需要三到四周才能完成。
103. Why do you want to join Axis?
你为什么想加入Axis?
- 知识点: 其他/未分类 (标签: interviewbit, axis-bank, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Axis Bank
- id: 69b3795c58d557c902b9acbd | 官方: 否 | 付费: 否
答案:
Irrespective of your background, whether you are an engineer or a graduate of commerce, you can mention that you are passionate about finance and especially banking. Answering this question illustrates your commitment to that particular employer and will indicate whether you researched the company before applying. Use this opportunity to demonstrate your genuine interest in the organization. Mention the following points, if applicable: - If you are good with numbers and have interpersonal skills, you can say that these skills, which you have acquired over time, will enable you to make better decisions as a banker.
无论你的背景如何,无论你是工程师还是商科毕业生,你都可以提到你对金融尤其是银行业充满热情。回答这个问题能展示你对特定雇主的承诺,并表明你在申请前是否对公司做过研究。利用这个机会来展现你对组织的真诚兴趣。如果适用,可以提到以下几点:- 如果你擅长数字且具备人际交往能力,你可以说这些你随时间积累的技能将使你作为银行家做出更好的决策。
- Additionally, you can state that your graduation helped you develop leadership skills that may prove to be of greater value in a banking environment.
- It might be useful to cite something from your past experience, such as your time as a student secretary or a social club president, or what you have done to figure out a solution to a problem with limited information.
- Moreover, you can mention that banks follow a structured approach to promotions and as such, there is a clear progression in your career besides having a stable job.
- As a banker, you are likely to feel that this position offers incredible opportunities and challenges, and this incites you to work harder and contribute more. Also, you will have exposure to a variety of disciplines including finance, accounting, audit, and legal.
104. Distinguish between UNION and UNION ALL.
区分 UNION 和 UNION ALL。
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba16c4 | 官方: 否 | 付费: 否
答案:
To aggregate the results of two or more SQL SELECT queries, we use the SQL UNION method. In the union operation, the number of data types and columns in both tables on which the UNION action is performed must be the same. Duplicate rows are removed from the result set by the UNION operation. Union ALL operation is the same as a Union operation. It returns the set without sorting the data or deleting duplicates.
要聚合两个或多个 SQL SELECT 查询的结果,我们使用 SQL UNION 方法。在联合操作中,执行 UNION 操作的两个表中的数据类型和列数必须相同。UNION 操作会从结果集中删除重复行。UNION ALL 操作与 UNION 操作相同,但它返回集合时不进行排序或删除重复项。
105. What is the difference between Dataset.clone() and Dataset.copy()?
Dataset.clone() 和 Dataset.copy() 之间有什么区别?
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba16c8 | 官方: 否 | 付费: 否
答案:
DataSet. Clone() copies only the DataSet object's schema and returns a DataSet object with the same structure as the existing dataset object, including all the relations, constraints, and schemas. The data from the old one will not be copied to the new one.
DataSet.Clone() 只复制 DataSet 对象的架构,并返回一个与现有数据集对象结构相同(包括所有关系、约束和架构)的 DataSet 对象。旧对象中的数据不会复制到新对象中。
DataSet.Copy() copies the entire code and structure of an existing DataSet object.
DataSet.Copy() 复制现有 DataSet 对象的整个代码和结构。
106. What is the difference between getch() and getche()?
getch() 和 getche() 之间有什么区别?
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba16cb | 官方: 否 | 付费: 否
答案:
Both these C functions read characters from the keyboard, the only difference being: - getch() is a function that reads characters from the keyboard without using any buffers. As a result, no data is presented on the screen.
这两个 C 函数都从键盘读取字符,唯一区别在于:getch() 是一个不使用任何缓冲区从键盘读取字符的函数,因此屏幕上不会显示任何数据。
getche() uses a buffer to read characters from the keyboard. As a result, information is displayed on the screen.
Here is an example to demonstrate the difference between the two functions:以下是一个示例,演示这两个函数之间的区别:
include<stdio.h>
include<conio.h>
int main()
int main()
{
char c;
char c;
printf("Enter a character here: ");
printf("Enter a character here: ");
c = getch();
c = getch();
printf("nYou entered the character: %c",c);
printf("nYou entered the character: %c",c);
printf("nEnter another character: ");
printf("nEnter another character: ");
c = getche();
c = getche();
printf("nYour new entered character is: %c",c);
printf("nYour new entered character is: %c",c);
return 0;
return 0;
}
Output:
输出:
Enter a character here:
在此处输入一个字符:
You entered the character: c
你输入的字符是:c
Enter another character: b
输入另一个字符:b
Your new entered character is: b
你新输入的字符是:b
getch() immediately returns the character without waiting for the enter key to be pressed and the character is not displayed on the screen. getche() displays the character on the screen without waiting for the enter key to be pressed.
getch() 立即返回字符,无需等待回车键被按下,且字符不会显示在屏幕上。getche() 会在屏幕上显示字符,无需等待回车键被按下。
107. What do you know about #pragma directive?
你对 #pragma 指令了解多少?
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba16ce | 官方: 否 | 付费: 否
答案:
pragma is a preprocessor directive for turning on or off specific functionalities. #pragma startup, #pragma exit, and #pragma warn are its three types. - We can use #pragma startup to provide functions that are called when the script starts working.
pragma exit allows us to specify functions that are executed when the code terminates.
pragma warn tells the computer whether or not to suppress any warnings.
108. What is the drawback of scanf() and how can it be avoided (if any)?
scanf() 的缺点是什么?如何避免(如果有的话)?
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba16d4 | 官方: 否 | 付费: 否
答案:
With a string of characters, scanf() will fail. A multi-word string cannot be entered into a single variable using scanf(). The gets( ) function is used to avoid this. When the enter key is pushed, it gets a string from the keyboard and ends it. As part of the input string, spaces and tabs are permitted.
对于字符串,scanf() 会失败。多词字符串不能使用 scanf() 输入到单个变量中。使用 gets() 函数可以避免这种情况。当按下回车键时,它会从键盘获取一个字符串并结束它。作为输入字符串的一部分,允许使用空格和制表符。
109. Illustrate public static void main(String args[]) in Java.
在 Java 中说明 public static void main(String args[]) 的作用。
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba16d7 | 官方: 否 | 付费: 否
答案:
The entry point for any Java code is called main() and is always written as a public static void main (String[] args). - public: The term "public" refers to an access modifier. It's used to specify who has access to use this method. This method is public, which implies that it can be accessed by any class.
任何 Java 代码的入口点称为 main(),并且始终写为 public static void main (String[] args)。 - public:术语“public”指的是访问修饰符。它用于指定谁有权访问此方法。此方法是公共的,这意味着它可以被任何类访问。
- static: This is a keyword that indicates that it is a class-based system. In Java, main() is made static so that it can be accessed without having to create a class instance; however if main is not made static, the compiler will throw an error because main() is called by the JVM before any objects are created, and only static methods can be directly invoked via the class.
- void: The return type of a method is void, and it defines a method that does not return any value.
- main: It's the name of the method that JVM looks for when it's searching for a starting point for an application with a specific signature, and it's the method where the main execution happens.
- String args[]: The parameter passed to the main method is String args[]. args[] is an array of arguments with each element as a string.
110. Explain shallow copy vs deep copy in the context of Java.
在 Java 上下文中解释浅拷贝与深拷贝。
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba16e0 | 官方: 否 | 付费: 否
答案:
The method of copying an object that is used by default in cloning is a shallow copy . The fields of an old object X are copied to a new object Y in this procedure. The reference is duplicated to Y while copying the object type field, i.e. object Y will point to the same location as X. If the field value is a primitive type, the primitive type's value is copied. As a result, any changes made in object X or Y's linked objects will be reflected in other objects.
在克隆中默认使用的复制对象的方法是浅拷贝。在此过程中,旧对象 X 的字段被复制到新对象 Y。复制对象类型字段时,引用被复制到 Y,即对象 Y 将指向与 X 相同的位置。如果字段值是基本类型,则复制基本类型的值。因此,在对象 X 或 Y 的关联对象中进行的任何更改都将反映在其他对象中。
// Java
// Java
// An object reference of this class is
// 此类的一个对象引用由
// contained by IBS
// IBS 包含
class IB {
class IB {
int a, b;
int a, b;
}
// Contains a reference of IB and
// 包含 IB 的引用,并
// implements clone with shallow copy.
// 使用浅拷贝实现克隆。
class IBS implements Cloneable {
class IBS implements Cloneable {
int x;
int x;
int y;
int y;
IB z = new IB();
IB z = new IB();
public Object clone() throws CloneNotSupportedException
public Object clone() throws CloneNotSupportedException
{
return super.clone();
return super.clone();
}
}
// Driver class
// 驱动类
public class Main {
public class Main {
public static void main(String args[])
public static void main(String args[])
throws CloneNotSupportedException
抛出 CloneNotSupportedException 异常
{
IBS t1 = new IBS();
IBS t1 = new IBS();
t1.x = 1;
t1.x = 1;
t1.y = 2;
t1.y = 2;
t1.z.a = 3;
t1.z.a = 3;
t1.z.b = 4;
t1.z.b = 4;
IBS t2 = (IBS)t1.clone();
IBS t2 = (IBS)t1.clone();
// a copy of object t1 is created
// 创建了对象t1的一个副本
// and is passed to t2
// 并传递给t2
t2.x = 10;
t2.x = 10;
// any modification in the primitive type of t2
// 对 t2 的原始类型所做的任何修改
// does not get reflected in the t1 field
// 都不会反映到 t1 的字段中
t2.z.a = 30;
t2.z.a = 30;
// any modification in object type field
// 对象类型字段的任何修改
// gets reflected in both t2 and t1(shallow copy)
// 都会反映在 t2 和 t1 中(浅拷贝)
System.out.println(t1.x + " " + t1.y + " " + t1.z.a
System.out.println(t1.x + " " + t1.y + " " + t1.z.a
" " + t1.z.b);
- " " + t1.z.b);
System.out.println(t2.x + " " + t2.y + " " + t2.z.a
System.out.println(t2.x + " " + t2.y + " " + t2.z.a
- " " + t1.z.b);
" " + t2.z.b);
- " " + t2.z.b);
}
}
Output:
输出:
- " " + t2.z.b);
1 2 30 4
10 2 30 4
In the above program, t1.clone returns a shallow copy of the object t1. After receiving the copy, specific modifications to the clone technique must be applied in order to acquire a deep copy of the object.
在上述程序中,t1.clone 返回对象 t1 的浅拷贝。收到拷贝后,必须应用特定的克隆技术修改,才能获得对象的深拷贝。
A deep copy duplicates all fields as well as the dynamically allocated memory that the fields point to. When an item is copied together with the objects to which it refers, it is called a deep copy.
深拷贝会复制所有字段以及字段指向的动态分配内存。当一个对象连同其引用的对象一起被复制时,这称为深拷贝。
// Java
// Java
// An object reference of this
// 此类的对象引用
// class is contained by IBS
// 由 IBS 包含
class IB {
class IB {
int a, b;
int a, b;
}
// Contains a reference of IB and
// 包含 IB 的引用,并
// implements clone with deep copy.
// 实现带有深拷贝的 clone。
class IBS implements Cloneable {
class IBS implements Cloneable {
int x, y;
int x, y;
IB z = new IB();
IB z = new IB();
public Object clone() throws CloneNotSupportedException
public Object clone() throws CloneNotSupportedException
{
// Assigning the shallow copy to
// 将浅拷贝赋值给
// the new reference variable t
// 新的引用变量 t
IBS t = (IBS)super.clone();
IBS t = (IBS)super.clone();
// Creating a deep copy for c
// 为 c 创建深拷贝
t.z = new IB();
t.z = new IB();
t.z.a = z.a;
t.z.a = z.a;
t.z.b = z.b;
t.z.b = z.b;
// Creating a new object for the field c
// 为字段 c 创建一个新对象
// and assigning it to the obtained shallow copy
// 并将其赋值给获得的浅拷贝
// in order to make it a deep copy
// 以便使其成为深拷贝
return t;
return t;
}
}
public class Main {
public class Main {
public static void main(String args[])
public static void main(String args[])
throws CloneNotSupportedException
抛出 CloneNotSupportedException 异常
{
IBS t1 = new IBS();
IBS t1 = new IBS();
t1.x = 1;
t1.x = 1;
t1.y = 2;
t1.y = 2;
t1.z.a = 3;
t1.z.a = 3;
t1.z.b = 4;
t1.z.b = 4;
IBS t3 = (IBS)t1.clone();
IBS t3 = (IBS)t1.clone();
t3.x = 10;
t3.x = 10;
// any modification in the primitive type of t2
// 对 t2 的原始类型所做的任何修改
// does not get reflected in the t1 field
// 都不会反映到 t1 的字段中
t3.z.a = 30;
t3.z.a = 30;
// any modification in object type field of t2
// 对 t2 的对象类型字段所做的任何修改
// does not get reflected in t1(deep copy)
// 都不会反映到 t1 中(深拷贝)
System.out.println(t1.x + " " + t1.y + " " + t1.z.a
System.out.println(t1.x + " " + t1.y + " " + t1.z.a
" " + t1.z.b);
- " " + t1.z.b);
System.out.println(t3.x + " " + t3.y + " " + t3.z.a
System.out.println(t3.x + " " + t3.y + " " + t3.z.a
- " " + t1.z.b);
" " + t3.z.b);
- " " + t3.z.b);
}
}
Output:
输出:
- " " + t3.z.b);
1 2 3 4
10 2 30 4
We can see how a new object for the IB class has been designated to replicate an object that will be delivered to the clone method in the preceding example. As a result, t3 will acquire a deep copy of t1's object. As a result, any changes made by t3 to the ‘z' object properties will not be reflected in t1.
可以看到,在前面的例子中,为了复制一个将被传递给克隆方法的对象,已经指定了一个新的IB类对象。因此,t3将获得t1对象的深拷贝。结果,t3对‘z’对象属性所做的任何更改都不会反映在t1中。
111. Distinguish between range and xrange in Python.
区分Python中的range和xrange。
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba16e6 | 官方: 否 | 付费: 否
答案:
xrange and range are nearly identical in terms of functionality. They both allow you to generate a list of integers that you may use whatever you want. The only difference between range and xrange is that xrange produces an xrange object while range provides a Python list object.
xrange和range在功能上几乎相同。它们都允许你生成一个整数列表,你可以随意使用。range和xrange之间唯一的区别是,xrange生成一个xrange对象,而range提供的是Python列表对象。
This implies that, unlike range, xrange does not create a static list during execution. It generates the values as needed using a technique known as yielding. Generators, which are a type of object, are employed with this technique. That is, if you have a large range and want to construct a list for a billion people, you should use xrange.
这意味着,与range不同,xrange在执行过程中不会创建静态列表。它使用一种称为“产出”的技术按需生成值。生成器,作为一种对象类型,与此技术一起使用。也就是说,如果你有一个很大的范围,并且想为十亿人构建一个列表,你应该使用xrange。
This is particularly the case if you're working with a system that demands a lot of memory, such as a cell phone, because range will utilise as much RAM as it can to build your array of numbers, causing a memory problem and crashing your app.
特别是在处理需要大量内存的系统时(例如手机),这一点尤为重要,因为range会尽可能多地占用RAM来构建你的数字数组,导致内存问题并使应用崩溃。
112. Is there a good reason to choose BSTs over AVLs in the first place?
首先,有什么充分理由选择BST而不是AVL?
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba16ef | 官方: 否 | 付费: 否
答案:
If you wish to compare the two: an AVL tree to a simple binary search tree (BST) without balancing it, then AVL: - will require additional memory (each node must keep track of its balance factor) and
如果你想比较两者:AVL树与不带平衡的简单二叉搜索树(BST)相比,AVL:- 将需要额外的内存(每个节点必须跟踪其平衡因子)并且
Each operation has the potential to be slower (because you need to maintain the balance factor and sometimes perform rotations).
The worst-case for BST without balancing is quite terrible (linear). However, if you are confident that this worst-case scenario will not occur, or if you don't mind if the process is slow in rare circumstances, BST without balancing may be preferable to AVL.不带平衡的BST的最坏情况非常糟糕(线性)。但是,如果你确信这种最坏情况不会发生,或者你不介意在罕见情况下进程缓慢,那么不带平衡的BST可能比AVL更可取。
113. What is the difference between new() and malloc()?
new()和malloc()有什么区别?
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba16f8 | 官方: 否 | 付费: 否
答案:
In C++, both malloc() and new are used for memory allocation at runtime. The differences are listed below: - Malloc() is a function, whereas new() is a pre-processor.
在C++中,malloc()和new都用于运行时内存分配。区别如下:- Malloc()是一个函数,而new()是一个预处理器。
- When using new(), there is no requirement to allocate memory; nevertheless, when using malloc(), you must use sizeof ().
- new() sets the new memory to 0 and malloc() assigns a random value to the newly allocated memory.
- The new() operator allocates memory and invokes the constructor for object initialization, whereas the malloc() function allocates memory but does not invoke the constructor.
- Because the operator is faster than the function, the new() operator is faster than the malloc() function.
114. What are virtual functions and pure virtual functions?
什么是虚函数和纯虚函数?
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba16fb | 官方: 否 | 付费: 否
答案:
A virtual function is a member function that is declared in a base class and overridden by a derived class. When we are using a pointer or a reference to the base class to refer to a derived class object, we can invoke a virtual function for that object and have it run the derived class's version of the function. - Regardless of the type of reference (or pointer) used for a function call, virtual functions make sure the right function is called for an object.
虚函数是在基类中声明并由派生类覆盖的成员函数。当我们使用指向基类的指针或引用来引用派生类对象时,我们可以为该对象调用虚函数,并让其运行派生类的函数版本。- 无论函数调用使用的引用(或指针)类型如何,虚函数都确保为对象调用正确的函数。
- They're mostly implemented to accomplish polymorphism at runtime.
- The virtual keyword is used to declare functions in base classes.
Run-time resolution of function calls is performed.
Functions that are only declared in the base class are known as pure virtual functions or abstract functions. This indicates that they have no definition in the base class and must be redefined in the subclass.仅在基类中声明的函数被称为纯虚函数或抽象函数。这表明它们在基类中没有定义,必须在子类中重新定义。
115. How does the dynamic host configuration protocol help with network management?
动态主机配置协议如何帮助进行网络管理?
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba1701 | 官方: 否 | 付费: 否
答案:
The network administrator uses the dynamic host configuration protocol to create a pool of IP addresses instead of going to each client computer to configure a static IP address. This group is known as an area that can be dynamically assigned to clients.
网络管理员使用动态主机配置协议来创建IP地址池,而不是去每台客户端计算机配置静态IP地址。这个组被称为一个可以动态分配给客户端的区域。
116. What do you know about anonymous FTP (File Transfer Protocol)?
你对匿名FTP(文件传输协议)了解多少?
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba1704 | 官方: 否 | 付费: 否
答案:
Users can access public data through anonymous FTP. The server does not need the user to identify himself, and the login is anonymous. As a result, while utilizing anonymous FTP, you must substitute 'anonymous' for the user id. Anonymous FTPs allow you to send large files to a large number of individuals without having to give out a large number of password and username combinations.
用户可以通过匿名FTP访问公共数据。服务器不需要用户表明身份,登录是匿名的。因此,在使用匿名FTP时,你必须用“anonymous”代替用户ID。匿名FTP允许你将大文件发送给大量人员,而无需分发大量的密码和用户名组合。
117. What is the Golden Ratio?
什么是黄金比例?
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba1707 | 官方: 否 | 付费: 否
答案:
Any two consecutive (one after the other) Fibonacci Numbers have a ratio that is very close to the Golden Ratio, which is equal to 1.618034.... (approx). In fact, the larger the pair of Fibonacci Numbers, the closer the approximation. Let's have a look at a few:
任意两个连续的(一个接一个的)斐波那契数列数字之间的比值都非常接近黄金比例,该比例等于1.618034...(约等于)。事实上,斐波那契数列数字对越大,近似值越精确。让我们看几个例子:
3/2 = 1.5
5/3 = 1.666666666...
...
233/377 = 1.618055556...
This also works when we start the sequence with two random whole numbers.
当我们用两个随机的整数开始这个序列时,这个方法也适用。
Useful Preparation Resources:
有用的备考资源:
Java
Java
Automation Testing
自动化测试
API Testing
API测试
SQL
SQL
Capgemini Interview Preparation
118. What is the salary for freshers in Capgemini?
凯捷咨询公司新员工的薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba1715 | 官方: 否 | 付费: 否
答案:
For employees with less than one year of experience to two years of experience, the average Capgemini Fresher salary in India is 3.4 lakhs per year.
对于经验不足一年到两年经验的员工,凯捷咨询在印度的平均新员工薪资是每年34万卢比。
119. Why Capgemini?
为什么选择凯捷?
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba1718 | 官方: 否 | 付费: 否
答案:
Capgemini is a great place to work. Your abilities will be valued here. The organization's policies and opportunities are excellent, and it works in a variety of domains and nations. Once you're in, you'll have a plethora of options dependent on your abilities. Without a doubt, Capgemini's infrastructure and team management are top-notch.
凯捷是一个很棒的工作场所。你的能力会在这里得到重视。该组织的政策和机会非常出色,并且它在多个领域和国家开展业务。一旦你入职,你将拥有大量取决于你能力的选项。毫无疑问,凯捷的基础设施和团队管理是一流的。
120. Is there any bond in Capgemini?
凯捷有服务期协议(bond)吗?
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba171b | 官方: 否 | 付费: 否
答案:
Generally, there is a 2 years service bond for freshers in Capgemini.
一般来说,凯捷对应届生有为期2年的服务期协议。
121. How do I join Capgemini?
我该如何加入凯捷?
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba171e | 官方: 否 | 付费: 否
答案:
Capgemini visits numerous college campuses in their final placements, conducts walk-ins, and mega placement drives for fresher hiring. You can also apply to Capgemini in a variety of ways, including through employment sites, registering on the company’s website( www.capgemini.com ), attending recruiting drives, using the employee referral system, or consulting with placement experts.
凯捷在最终校招时会访问众多大学校园,并举办开放招聘和大型招聘活动以招聘应届生。你也可以通过多种方式申请凯捷,包括通过求职网站、在公司官网(www.capgemini.com)注册、参加招聘活动、利用员工推荐系统或咨询招聘专家等。
122. Is the Capgemini interview tough?
凯捷的面试难吗?
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba1721 | 官方: 否 | 付费: 否
答案:
It doesn't matter whether the Capgemini interview is challenging or easy. The truth is that the more you prepare for the interview, the easier it will be to pass. Acquire sufficient understanding of, among other things, interview stages, rounds, and questions. Programming languages, logical thinking, and products/software/projects on which the candidate has recently or previously worked are among the topics covered.
凯捷的面试是难还是容易并不重要。事实是,你为面试准备得越充分,通过就越容易。你需要充分了解面试阶段、轮次和问题等方面的内容。涵盖的主题包括编程语言、逻辑思维以及候选人最近或以前参与过的产品/软件/项目等。
123. Is Capgemini good for freshers?
凯捷对应届生好吗?
- 知识点: 其他/未分类 (标签: interviewbit, capgemini, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Capgemini
- id: 69b379f058d557c902ba1724 | 官方: 否 | 付费: 否
答案:
Capgemini gives you the opportunity to reach your full potential at every level of your career. Capgemini's work culture is generally positive. Job security is excellent too. You can take advantage of a flexible working environment that allows you to precisely blend your professional and personal lives.
凯捷让你在职业生涯的每个阶段都有机会发挥全部潜力。凯捷的工作文化总体上是积极的,工作稳定性也很好。你可以享受灵活的工作环境,这能让你精确地平衡职业和个人生活。
124. What is a void pointer in C? Can a void pointer be dereferenced without being aware of its type?
在C语言中,什么是空指针?空指针能在不知道其类型的情况下被解引用吗?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2c7d | 官方: 否 | 付费: 否
答案:
A void pointer is a pointer that is useful in pointing to the memory location having an undefined data type at the time of defining a variable, which means it can be any data of any arbitrary type. You can dereference a void pointer only after explicit casting. For example:
空指针是一种指针,在定义变量时,它对于指向具有未定义数据类型的内存位置很有用,这意味着它可以指向任何任意类型的数据。只有在显式类型转换之后,你才能解引用空指针。例如:
int x = 10;
int x = 10;
void *y = &x;
void *y = &x;
printf(“%d\n”, ((int)y));
printf(“%d\n”, ((int)y));
In the above-given code, we have declared a normal variable x with the integer data type, and assigned reference of x into a void pointer y. Using printf(), we are displaying the value of y by dereferencing it.
在上述代码中,我们声明了一个整数数据类型的普通变量x,并将x的引用赋给了空指针y。使用printf(),我们通过解引用y来显示其值。
125. What is an auto keyword in C?
在C语言中,什么是auto关键字?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2c83 | 官方: 否 | 付费: 否
答案:
- The auto keyword is used for declaring a variable that has a complicated type. For example, an auto keyword can be used for variable declaration where the initialization expression consists of templates, pointers to members, or pointers to functions.
- It can also be used for declaring and initializing a variable to a lambda expression. You cannot declare the variable type on your own because the type of lambda expression will be only known to the compiler.
- Auto variables can be accessed only within the block or function in which they have been declared and cannot be accessed outside of them. By default, they are assigned with garbage value whenever they are declared without assigning any value.
Syntax: auto ;
语法:auto ;
Example:
示例:
auto int x = 1;
auto int x = 1;
Here, x is a variable of storage class “auto” and with data type int.
这里,x是一个存储类别为“auto”且数据类型为int的变量。
- Data Science
- All Events
- My Events
126. Write a program for printing all permutations of a given string.
编写一个程序,打印给定字符串的所有排列。
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2c89 | 官方: 否 | 付费: 否
答案:
A permutation means re-arranging the ordered list(L) elements into a correspondence of one-to-one with the L itself. It is also known as an “order” or “arrangement number”. There will be n! permutation for a string with length n.
排列意味着将有序列表(L)的元素重新排列成与L本身的一一对应关系。它也被称为“顺序”或“排列数”。对于长度为n的字符串,将有n!种排列。
For finding all permutations of a given string, the recursive algorithm will make use of backtracking which finds the permutation of numbers by swapping a single element per iteration.
为了找出给定字符串的所有排列,递归算法将利用回溯法,通过每次迭代交换一个元素来找出数字的排列。
We are providing the “XYZ” string as an input in the below given example. It will produce 6 permutations for a given string. The permutation for a string “XYZ” are “XYZ”, “YXZ”, “ZYX”, “XZY”, “YZX”, “ZXY”.
在下面给出的示例中,我们以“XYZ”字符串作为输入。它将为一个给定字符串生成6种排列。字符串“XYZ”的排列有“XYZ”、“YXZ”、“ZYX”、“XZY”、“YZX”和“ZXY”。
Program:
程序:
// C Program to print all permutations of a given string including duplicates
// C语言程序,用于打印给定字符串的所有排列(包括重复项)
include <stdio.h>
include <string.h>
// Function for swapping values at two pointers
// 用于交换两个指针所指向值的函数
void swap(char a, char b)
void swap(char a, char b)
{
char temp;
char temp;
temp = *a;
temp = *a;
a = b;
a = b;
*b = temp;
*b = temp;
}
/* Function for printing permutations of a string. This function takes
/* 用于打印字符串排列的函数。此函数接受
three parameters: String, Starting index of the string, last index of
三个参数:字符串、字符串的起始索引、字符串的最后一个索引
the string. */
的字符串。 */
void permute(char *a, int beg, int end)
void permute(char *a, int beg, int end)
{
int i;
int i;
if (beg == end)
if (beg == end)
printf("%s\n", a);
printf("%s\n", a);
else
else
{
for (i = beg; i <= end; i++)
for (i = beg; i <= end; i++)
{
swap((a+beg), (a+i));
swap((a+beg), (a+i));
permute(a, beg+1, end);
permute(a, beg+1, end);
//backtracking method
//回溯法
swap((a+beg), (a+i));
swap((a+beg), (a+i));
}
}
}
// Driver program for testing above defined functions
// 用于测试上述定义函数的驱动程序
int main()
int main()
{
char string[] = "XYZ";
char string[] = "XYZ";
int n = strlen(string);
int n = strlen(string);
permute(string, 0, n-1);
permute(string, 0, n-1);
return 0;
return 0;
}
Output:
输出:
XYZ
XYZ
XZY
XZY
YXZ
YXZ
YZX
YZX
ZYX
ZYX
ZXY
ZXY
127. Write a program for finding the greatest difference between two elements of an array that is in increasing order of elements.
编写一个程序,找出数组中两个元素之间的最大差异,且该数组元素按递增顺序排列。
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2c8c | 官方: 否 | 付费: 否
答案:
A solution for this problem can be achieved with the usage of two loops. Initially, we consider the maximum difference value as the difference between the first two array elements. Later, the elements will be picked one by one in the outer loop and the difference between the picked element and every other array element will be calculated in the inner loop, then that difference will be compared with the maximum difference calculated so far.
解决此问题的一种方案是使用两个循环。最初,我们将最大差异值视为前两个数组元素之间的差异。随后,在外层循环中逐个选取元素,并在内层循环中计算所选元素与数组中其他每个元素之间的差异,然后将该差异与目前计算出的最大差异进行比较。
Program:
程序:
// Java program
// Java 程序
class MaxDiffrence
class MaxDiffrence
{
/* The function will assume that there will be at least two elements
/* 该函数将假设数组中至少有两个元素
in an array. The function will return a negative value if the array
如果数组按降序排序,该函数将返回负值
is in decreasing order of sorting. This function will return 0
如果元素相等,该函数将返回0。 */
if elements are equal. */
如果元素相等。 */
int maximumDiff(int x[], int size)
int maximumDiff(int x[], int size)
{
int res = x[1] - x[0];
int res = x[1] - x[0];
int i, j;
int i, j;
for (i = 0; i < size; i++)
for (i = 0; i < size; i++)
{
for (j = i + 1; j < size; j++)
for (j = i + 1; j < size; j++)
{
if (x[j] - x[i] > res)
if (x[j] - x[i] > res)
res = x[j] - x[i];
res = x[j] - x[i];
}
}
return res;
返回 res;
}
// Driver program for testing above function
// 用于测试上述函数的驱动程序
public static void main(String[] args)
public static void main(String[] args)
{
MaxDifference md = new MaxDifference();
MaxDifference md = new MaxDifference();
int array[] = {2, 3, 90, 10, 120};
int array[] = {2, 3, 90, 10, 120};
System.out.println("Maximum difference between two elements of an array is " + md.maximumDiff(array, 5));
System.out.println("数组中两个元素之间的最大差值是 " + md.maximumDiff(array, 5));
}
}
Output:
输出:
Maximum difference between two elements of an array is 118
数组中两个元素之间的最大差值是 118
128. Write a program for finding the first and last occurrences (or positions) of a number in an array of a sorted manner.
编写一个程序,用于在一个已排序的数组中找到某个数字的第一次和最后一次出现(或位置)。
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2c8f | 官方: 否 | 付费: 否
答案:
Assign firstPos and lastPos values as -1 in the beginning, as we need to find them yet. Within for loop, you need to compare a given element with each element of an array. When an element is found for the first time, we will update the firstPos value with i. After that, whenever we find an element, we will update the lastPos value with i. Then firstpos and lastPos value will be printed.
在开始时将firstPos和lastPos的值赋为-1,因为我们还需要找到它们。在for循环中,你需要将给定元素与数组中的每个元素进行比较。当第一次找到某个元素时,我们会用i更新firstPos的值。之后,每当我们找到该元素时,我们会用i更新lastPos的值。然后会打印firstPos和lastPos的值。
// C++ program
// C++程序
include <bits/stdc++.h>
using namespace std;
using namespace std;
void findFirstAndLastFunc(int a[], int n, int x)
void findFirstAndLastFunc(int a[], int n, int x)
{
int firstPos = -1, lastPos = -1;
int firstPos = -1, lastPos = -1;
for (int i = 0; i < n; i++)
for (int i = 0; i < n; i++)
{
if (x != a[i])
if (x != a[i])
continue;
continue;
if (firstPos == -1)
if (firstPos == -1)
firstPos = i;
firstPos = i;
lastPos = i;
lastPos = i;
}
if (firstPos != -1)
if (firstPos != -1)
cout << "First Occurrence = " << firstPos<< "\n Last Occurrence = " << lastPos;
cout << "首次出现位置 = " << firstPos<< "\n 最后一次出现位置 = " << lastPos;
else
else
cout << "Element not Found";
cout << "未找到元素";
}
int main()
int main()
{
int a[] = { 1, 2, 2, 2, 3, 3, 4, 5, 7, 7};
int a[] = { 1, 2, 2, 2, 3, 3, 4, 5, 7, 7};
int n = sizeof(a) / sizeof(int);
int n = sizeof(a) / sizeof(int);
int x = 7;
int x = 7;
findFirstAndLastFunc(a, n, x);
findFirstAndLastFunc(a, n, x);
return 0;
return 0;
}
Output:
输出:
First Occurrence = 8
首次出现位置 = 8
Last Occurrence = 9
最后一次出现位置 = 9
129. Write a program for reversing each word in a string.
编写一个程序,用于反转字符串中的每个单词。
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2c92 | 官方: 否 | 付费: 否
答案:
We will make use of a stack for pushing all letters until a space is found in a given string. When space is encountered, we will empty the stack and the reversed word will be printed with a space at the end. This process will be continued until the end of the string has been reached.
我们将使用栈将给定字符串中的所有字母压入,直到遇到空格。当遇到空格时,我们将清空栈,并在末尾打印反转后的单词和一个空格。此过程将持续进行,直到到达字符串末尾。
// C++ program
// C++程序
include <bits/stdc++.h>
using namespace std;
using namespace std;
// Reverses each word of a string
// 反转字符串中的每个单词
void reverseEachWords(string s)
void reverseEachWords(string s)
{
stackstk;
stackstk;
/ Traverses the given string and all the characters will be pushed to stack until a space is found. /
/ 遍历给定字符串,所有字符将被推入栈中,直到遇到空格。 /
for (int i = 0; i < s.length(); ++i) {
for (int i = 0; i < s.length(); ++i) {
if (s[i] != ' ')
if (s[i] != ' ')
stk.push(s[i]);
stk.push(s[i]);
else
else
{
// Contents of the stack will be printed when a space is found.
// 当遇到空格时,将打印栈的内容。
while (stk.empty() == false)
while (stk.empty() == false)
{
cout << stk.top();
cout << stk.top();
stk.pop();
stk.pop();
}
cout << " ";
cout << " ";
}
}
// As there may not be space after last word.
// 因为最后一个单词后面可能没有空格。
while (stk.empty() == false)
while (stk.empty() == false)
{
cout << stk.top();
cout << stk.top();
stk.pop();
stk.pop();
}
}
int main()
int main()
{
string s = "Welcome To InterviewBit";
string s = "Welcome To InterviewBit";
reverseWords(s);
reverseWords(s);
return 0;
return 0;
}
Output:
输出:
emocleW oT tiBweivretnI
emocleW oT tiBweivretnI
Conclusion:
结论:
The Cisco interview questions and answers provided here will guide you to prepare for your upcoming interview and face the questions confidently. In order to add more weightage to your resume, you can take up a Cisco certification or course.
本文提供的思科面试问题和答案将指导您为即将到来的面试做好准备,并自信地面对这些问题。为了给您的简历增加更多分量,您可以参加思科认证或课程。
Alternatively, you may go through resources on various other Networking and Hardware concepts to grow your knowledge. Preparing for the Cisco interview questions and answers in this article will definitely help you stand out as a strong potential candidate for the job.
或者,您也可以浏览其他各种网络和硬件概念的资源来增长知识。准备本文中的思科面试问题和答案,必将帮助您在求职中脱颖而出,成为强有力的候选人。
Useful Resources: - Networking Interview
有用资源:- 网络面试
- Operating System Interview
- Data Structure Interview
- Algorithm Interview
130. Differentiate between C and C++.
区分C和C++。
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2c95 | 官方: 否 | 付费: 否
答案:
| C | C++ |
|---|---|
| It is procedural programming in which code will be in the form of a set of procedures for developing the applications. 它是过程式编程,代码以一组过程的形式来开发应用程序。 | It is a hybrid programming language as it supports both procedural and object-oriented programming concepts. 它是一种混合编程语言,因为它同时支持过程式和面向对象的编程概念。 |
| It does not support oops features like encapsulation, polymorphism, and inheritance. 它不支持封装、多态和继承等面向对象特性。 | It supports oops features like encapsulation, polymorphism, and inheritance. 它支持封装、多态和继承等面向对象特性。 |
| It does not support data hiding. 它不支持数据隐藏。 | It supports data hiding through encapsulation. 它通过封装支持数据隐藏。 |
| Operator and function overloading is not supported. 不支持运算符和函数重载。 | Operator and function overloading is supported. 支持运算符和函数重载。 |
| Don’t have access specifiers. 没有访问说明符。 | Does have access specifiers. 有访问说明符。 |
| Data and functions will be kept separated and will not be encapsulated together. 数据和函数将被分开保存,不会封装在一起。 | Data and functions will be encapsulated together as an object. 数据和函数将作为对象封装在一起。 |
| It focuses on method or process, instead of focusing on data. 它侧重于方法或过程,而不是数据。 | It focuses on data, instead of focusing on method or procedure. 它侧重于数据,而不是方法或过程。 |
| Virtual and friend functions are not supported 不支持虚函数和友元函数。 | Virtual and friend functions are supported. 支持虚函数和友元函数。 |
| It does not support exception handling. 它不支持异常处理。 | It supports exception handling. 它支持异常处理。 |
| Namespace feature is not provided. 不提供命名空间功能。 | Namespace feature is allowed to avoid name collisions. 允许使用命名空间功能以避免名称冲突。 |
131. What is a diskless workstation?
什么是无盘工作站?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2c9b | 官方: 否 | 付费: 否
答案:
Diskless workstations refer to the client computers that are in connection with a networked server. These computers will need only a minimum amount of hardware for interacting with the system by the user. They do not have a hard disk. Data and programs will be retrieved from the network. The server will do all the “hard work”, including data storage, booting, and performing calculations.
无盘工作站是指与网络服务器相连的客户端计算机。这些计算机只需最少量的硬件供用户与系统交互。它们没有硬盘。数据和程序将从网络中获取。服务器将完成所有“繁重的工作”,包括数据存储、启动和执行计算。
Diskless workstations are helpful in reducing the overall LAN cost as a single disk drive with large-capacity will be less expensive than multiple low-capacity drives. Along with this, it also simplifies the security and backups because all files are in a single place, i.e., on the file server. Also, data access from a larger remote file server is usually faster than data access from a smaller local storage device. The major disadvantage of these diskless workstations is that they become useless on network failure.
无盘工作站有助于降低整体局域网成本,因为单个大容量磁盘驱动器比多个低容量驱动器更便宜。此外,它还简化了安全性和备份,因为所有文件都位于单一位置,即文件服务器上。而且,从更大的远程文件服务器访问数据通常比从较小的本地存储设备访问数据更快。这些无盘工作站的主要缺点是,在网络故障时会变得无法使用。
132. Which protocol will be used for booting diskless workstations?
哪种协议将用于无盘工作站启动?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2c9e | 官方: 否 | 付费: 否
答案:
BootP or Bootstrap Protocol will be used for booting the diskless workstations across the Internet by themselves. Similar to DHCP (Dynamic Host Configuration Protocol), BootP will allow a computer to obtain the server’s IP address as well as their own IP address.
BootP或引导协议(Bootstrap Protocol)将用于让无盘工作站自行通过互联网启动。类似于DHCP(动态主机配置协议),BootP允许计算机获取服务器IP地址以及自身的IP地址。
133. What is an IP access list?
什么是IP访问列表?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2ca4 | 官方: 否 | 付费: 否
答案:
An IP access list is a rule set for traffic control in the network and for reducing the possibilities of network attacks. This list will be useful in filtering the traffic based on rules that are defined for incoming as well as outgoing networks. The standard IP access list features are: - Provide bandwidth control: IP Access lists on a slower link are helpful in preventing excess traffic on a network.
IP访问列表是网络中用于流量控制和减少网络攻击可能性的规则集。该列表根据为入站和出站网络定义的规则,有助于过滤流量。标准IP访问列表的功能包括:- 提供带宽控制:较慢链路上的IP访问列表有助于防止网络上的过量流量。
- Trigger dial-on-demand: Access lists do have the right to enforce the criteria for dial and disconnect.
- Provide NAT control: Access lists are helpful in controlling which addresses are translated by NAT (Network Address Translation).
- Control access to Virtual teletype (vty): Access lists on an inbound vty are capable of controlling which person can access the lines to a device. Access lists on an outbound vty are capable of controlling the destinations to which can be reached by the lines from a device.
- Authenticate remote shell (rsh) and Rate Control Protocol (RCP): Using access lists, it is possible to simplify the remote hosts, remote users, and local users identification in an authentication database that is configured for controlling the device access. For receiving incoming rsh as well as rcp protocol requests, the authentication database will enable the Cisco software.
- Block unwanted traffic: These access lists are capable of filtering incoming/outgoing packets on an interface, thus helpful in controlling the network access depending on the source address, destination address, or user authentication. It is also useful in determining the traffic type that is forwarded or blocked at the device interface.
- Limit debug command output: We can limit the debug output using access lists, depending on an IP address or a protocol.
134. What are the Benefits of Subnetting?
子网划分有哪些好处?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2cad | 官方: 否 | 付费: 否
答案:
Subnetting refers to the process of dividing a larger network into smaller networks. In the below-given image, the network has been divided into two broadcast networks, which will reduce the network load and will provide greater network security to the users.
子网划分是指将较大网络划分为较小网络的过程。在下图中,网络已被划分为两个广播网络,这将减少网络负载并为用户提供更高的网络安全性。
The benefits of subnetting are: - Improvement in network performance and speed: Subnetting will enable you to make sure about information remains in the broadcast domain or subnetted network, which permits other subnets for maximizing their speed and effectiveness. Also, subnetting will divide broadcast domains of your network which enables you to control the traffic flow in a better way, thus increasing network performance.
子网划分的好处包括:- 提高网络性能和速度:子网划分确保信息保持在广播域或子网内,从而允许其他子网最大化其速度和效率。此外,子网划分将分割网络的广播域,使您能够更好地控制流量,从而提高网络性能。
- Reduction in network congestion: Using a router for moving the traffic between subnets will lead to no broadcast traffic and any information that does not require to be routed will be moved to other subnets. As the traffic within each subnet has been reduced, there is an increase in the speed of each subnet, which in turn will ease the network congestion.
- Boosting network security: You will be able to control the flow of traffic with the help of ACLs (Access Control Lists), QoS (Quality of Service), or route maps, enabling you for identifying threats, close entry points, and target your responses more easily.
- Ease administration: Using subnetting, you will be able to create networks that have more logical host limits, as opposed to the IP addressing class limitations: 8 bits (Class A), 16 bits (Class B), and 24 bits (Class C). Subnetting will enable you for selecting the number of bits in your subnetwork, thus creating more realistic host limits. Subnetting will be an effective approach for keeping eyes on the systems of your network, which will help you for determining which system needs attention when problems arise. So we can say that subnetted networks are easier to manage and troubleshoot.
135. What is a transparent firewall?
什么是透明防火墙?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2cb3 | 官方: 否 | 付费: 否
答案:
A transparent firewall or bridge firewall will behave like a line of the layer among 2 devices and can be easily installed into an existing network without any modification into the Internet Protocol (IP) address. The transparent firewall will allow for entering into the traffic of layer 3 from the level of higher security to lower security levels without the help of access lists. It will act similar to a bridge as it inspects and moves network frames between interfaces.
透明防火墙或桥接防火墙会像两台设备之间的层线一样工作,可以轻松安装到现有网络中,无需修改互联网协议(IP)地址。透明防火墙允许流量从高安全级别进入低安全级别,而无需借助访问列表。它类似于桥接器,因为它检查并在接口之间移动网络帧。
A transparent firewall is considered a “stealth firewall” that supports outside as well as inside interfaces. Using this, security equipment can be connected with the same network on external and internal ports, with a separate VLAN(Virtual Local Area Network) for each interface.
透明防火墙被认为是支持外部和内部接口的“隐形防火墙”。使用它,安全设备可以通过外部和内部端口连接到同一网络,每个接口使用独立的VLAN(虚拟局域网)。
136. What are the different types of memories used in the CISCO router?
CISCO路由器中使用了哪些不同类型的内存?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2cb9 | 官方: 否 | 付费: 否
答案:
Different types of memories are being used in a CISCO router. They are: - Random Access Memory (RAM): RAM used in a router is the same as the RAM that is installed in our Mobile Phones, Laptops, and PCs. The RAM will be divided into two areas:
CISCO路由器中使用了不同类型的内存。它们是:- 随机存取存储器(RAM):路由器中使用的RAM与手机、笔记本电脑和PC中安装的RAM相同。RAM分为两个区域:
Main Processor Memory: It stores the information that belongs to the routing table, running router configuration, and ARP (Address Resolution Protocol) cache. Shared I/ry: It is a temporary storage memory where the queued data packets will be stored.When the router gets restarted or rebooted, all the information stored within the RAM will be deleted(that is why it is considered as Volatile memory). We can store the data permanently using NVRAM. - Non-Volatile Random Access Memory (NVRAM): NVRAM is useful in storing the start-up configuration file which are copies of the CISCO Router Configuration file and will be retained even after rebooting or restarting of router occurs. In this, the data will not be lost and can be easily recovered by rebooting or switching off the router. If you want to permanently save the running configuration files, these files should be moved from RAM to NVRAM.
主处理器内存:它存储属于路由表、运行中的路由器配置和ARP(地址解析协议)缓存的信息。共享I/O内存:它是临时存储内存,用于存储排队的数据包。当路由器重启或重新启动时,RAM中存储的所有信息将被删除(这就是为什么它被视为易失性内存)。我们可以使用NVRAM永久存储数据。- 非易失性随机存取存储器(NVRAM):NVRAM用于存储启动配置文件,这些文件是CISCO路由器配置文件的副本,即使在路由器重启或重新启动后也会保留。在这种内存中,数据不会丢失,并且可以通过重启或关闭路由器轻松恢复。如果您想永久保存运行配置文件,应将它们从RAM移动到NVRAM。
- Read-Only Memory (ROM): The boot procedure of a CISCO router will begin from the ROM memory section. ROM will have programming instructions such as Bootstrap program and POST (Power-On-Self-Test). POST test is useful in verifying whether hardware components like RAM, CPU, and interfaces are properly working or not. If they are not functioning properly, an error message will be sent by POST. After this, for setting up the CPU and boot functions of the router, the bootstrap application is used. The bootstrap program will be in charge of finding and loading the operating system (IOS) of the router. All this information will be saved or stored inside the ROM and the data will be retained even after switching off or rebooting the router.
- Flash Memory: It is an EPROM (Erasable Programmable Read-only Memory) chip that is more cost-effective for enterprise environments. The router operating system i.e., IOS (Internetwork Operating System) will be available in flash memory. It can be easily upgradable and does not need any hardware changes. Also, the content in flash memory will be retained when the router is switched off or rebooted.
137. What is Recovery testing?
什么是恢复测试?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2ccc | 官方: 否 | 付费: 否
答案:
Recovery testing is a technique used in software testing, which verifies the ability of software to recover from hardware/software failures, crashes, network failures, etc. The recovery testing purpose will be determining whether the software operations can continue even after the integrity loss or disaster. It includes returning the software to the point where integrity was known and doing transaction reprocessing to the point of failure.
恢复测试是软件测试中使用的一种技术,用于验证软件从硬件/软件故障、崩溃、网络故障等中恢复的能力。恢复测试的目的是确定即使完整性损失或灾难发生后,软件操作是否仍能继续。它包括将软件恢复到已知完整性点,并执行事务重新处理到故障点。
Cisco Interview Preparation
138. Why do u want to join Cisco?
你为什么想加入思科?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2cdb | 官方: 否 | 付费: 否
答案:
You can answer the above question in the following way: “I want to join Cisco for three reasons. Firstly, I believe working at Cisco adds to a natural progression in my career development. Secondly, I want to work at Cisco because this is a company that is constantly innovating and changing to make sure it meets the needs of its customers and service users. Finally, I want to join Cisco because I’m interested in working alongside passionate people who are eager to drive forward the organisation that they are working for. We spend a lot of our valuable time at work, and I want that time to be put to best use.”
你可以通过以下方式回答上述问题:“我想加入思科有三个原因。首先,我相信在思科工作是我职业发展中的自然进展。其次,我想在思科工作,因为这是一家不断创新和变革的公司,以确保满足客户和服务用户的需求。最后,我想加入思科,因为我热衷于与那些渴望推动所在组织前进的热情人士共事。我们在工作上花费了大量宝贵时间,我希望这段时间能得到最好的利用。”
139. How do you get selected in Cisco?
你是如何被思科选中的?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2cde | 官方: 否 | 付费: 否
答案:
To get selected by Cisco, you should be following the below procedures – - Fill out the application issued by Cisco on its official website or apply directly through a recruiter/referral link.
要获得思科的选拔录用,你应该遵循以下流程——在思科官网上填写申请,或直接通过招聘人员/推荐链接申请。
- Build a resume that highlights your skills for a specific position that you are applying for.
- Have extensive background research on Cisco, understand its day-to-day operations, and its achievements.
- Prepare for the Cisco job interview and give your best during the interview to get selected.
140. What is the average salary of a Cisco employee in India?
思科在印度员工的平均工资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2ce1 | 官方: 否 | 付费: 否
答案:
According to payscale.com , Cisco Systems pays an average salary of ₹15,40,418 per year to its employees. The salaries at Cisco can typically range from an average of ₹6,51,805 to ₹29,81,928 per year. Cisco Systems employees with the job title of Software Engineering Manager paid most with an average annual salary of ₹28,78,888, while the employees with the title Network Engineer paid the least with an average annual salary of ₹757,539.
根据payscale.com的数据,思科系统支付给员工的平均年薪为₹15,40,418。思科的薪资通常在平均每年₹6,51,805到₹29,81,928之间。拥有软件工程经理职位的思科系统员工平均年薪最高,为₹28,78,888,而拥有网络工程师职位的员工平均年薪最低,为₹757,539。
141. How long is the Cisco interview process?
思科面试过程需要多长时间?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2ce4 | 官方: 否 | 付费: 否
答案:
The interview process at Cisco usually takes around two to four weeks . But, the time and process may vary depending on the type of application and the position applied for.
思科的面试过程通常需要大约两到四周。但时间和过程可能会根据申请类型和所申请的职位而有所不同。
142. Do Cisco interns get paid?
思科实习生有薪酬吗?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2ce7 | 官方: 否 | 付费: 否
答案:
Yes, the interns get paid during their internships at Cisco. You can assume that Cisco does not look at an intern’s salary as a cost to the company but instead, it will be treated as an investment for the company’s future. The main aim of its internship programs is to attract many new talents to the company.
是的,实习生在思科实习期间会获得报酬。你可以认为思科并不将实习生的薪资视为公司的成本,而是将其视为对公司未来的投资。其实习项目的主要目标是吸引众多新人才加入公司。
143. Is Cisco interview hard?
思科面试难吗?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2cea | 官方: 否 | 付费: 否
答案:
The Interview process in Cisco could be a little challenging as it has numerous highly competitive applications from various candidates. Cisco is a popular employee-friendly place to work and it often attracts a lot of job applications. If you prepare well in advance for the interview, then the chances of you being get selected are relatively high.
思科的面试过程可能有点挑战性,因为它有来自不同候选人的大量高竞争性申请。思科是一个受欢迎的、对员工友好的工作场所,经常吸引大量求职申请。如果你提前做好面试准备,那么被选中的机会相对较高。
144. What are the prerequisites for an entry-level job at Cisco?
思科入门级职位的先决条件是什么?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2ced | 官方: 否 | 付费: 否
答案:
The candidates who are applying for an entry-level job at Cisco should possess a Bachelor’s degree with 60% throughout in 10th, 12th & Graduation degree. Moreover, while appearing for the hiring process at Cisco, the candidates should not have any pending backlogs. Apart from the specific technical knowledge, you will also be required to possess some soft skills, including good communication & reasoning skills.
申请思科入门级职位的候选人应拥有学士学位,且10年级、12年级和本科学位的成绩均为60%以上。此外,在参加思科的招聘流程时,候选人不应有任何未解决的补考。除了特定的技术知识外,你还需要具备一些软技能,包括良好的沟通和推理能力。
145. What can you expect during the Cisco interview process?
在思科面试过程中你能期待什么?
- 知识点: 其他/未分类 (标签: interviewbit, cisco, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cisco
- id: 69b37a1258d557c902ba2cf3 | 官方: 否 | 付费: 否
答案:
During the prescribed interview process at Cisco, the interviewer will evaluate your skills or experience in line with the company’s business requirements. The recruiter will ask you questions about your academic and previous work experience. In addition, there will also be technical rounds to test your knowledge and understanding of the role applied. You would get an opportunity to learn about the company’s culture & business. Refer to the above section for more details.
在思科规定的面试过程中,面试官将根据公司的业务需求评估你的技能或经验。招聘人员会询问你关于学术和以往工作经验的问题。此外,还会有技术轮次来测试你对所申请职位的知识和理解。你将有机会了解公司的文化和业务。更多详细信息请参考上述部分。
Coding Problems
0/1
Easy Problems
简单问题
Strings
字符串
Reverse the String
反转字符串
Very Easy
非常简单
36.31 Mins
36.31分钟
Solve
解答
146. Write the code to add two numbers without using arithmetic operators.
编写代码,在不使用算术运算符的情况下将两个数相加。
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Cognizant
- id: 69b37a3058d557c902ba3fc6 | 官方: 否 | 付费: 否
答案:
The sum of two bits can be found by executing an XOR (^) operation on the two bits. A carry bit can be obtained by performing AND (&) on the two bits.
两个位的和可以通过对这两个位执行异或(^)操作得到。进位位可以通过对这两个位执行与(&)操作来获得。
The logic shown below is a simple Half Adder that may be used to add two single bits. This logic can be extended to integers. If there are no set bits at the same position(s) in a and b, bitwise XOR (^) of a and b yields the sum of a and b. Bitwise AND (&) is used to include common set bits as well. All carry bits are obtained by bitwise AND of a and b. To acquire the needed result, we compute (a & b) // C Program for adding two numbers
下面展示的逻辑是一个简单的半加器,可用于将两个单个位相加。此逻辑可扩展到整数。如果在a和b中没有相同位置的置位位,则a和b的按位异或(^)产生a和b的和。按位与(&)也用于包含公共置位位。所有进位位通过a和b的按位与获得。为了得到所需结果,我们计算(a & b)// 用于相加两个数字的C程序
// without the use of arithmetic operators
// 无需使用算术运算符
include<stdio.h>
int Addition(int a, int b)
int Addition(int a, int b)
{
// Iterate until no carry
// 迭代直到没有进位
while (b != 0)
while (b != 0)
{
// carry now stores common
// 进位现在存储a和b的公共
//set bits of a and b
//置位位
unsigned carry = a & b;
unsigned carry = a & b;
a = a ^ b;
a = a ^ b;
// Carry to be shifted by one so that on adding
// 进位需要左移一位,以便在将其加到a时
// it to a, we get the required sum
// 获得所需的和
b = carry << 1;
b = carry << 1;
}
return a;
返回 a;
}
147. What is a bridge router (als known as brouter) ?
什么是桥接路由器(也称为brouter)?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3058d557c902ba3fc9 | 官方: 否 | 付费: 否
答案:
A bridge router, sometimes known as a brouter, is a network device that can function as both a bridge and a router. The brouter forwards all other packets like a bridge and only routes packets for known protocols.
桥接路由器,有时称为brouter,是一种既可作为桥接器又可作为路由器的网络设备。brouter像桥接器一样转发所有其他数据包,并且仅路由已知协议的数据包。
For routable protocols, brouters function at the network layer, while for non-routable protocols, they operate at the data link layer. Brouters operate as routers for routable protocols and bridges for non-routable protocols, handling both routable and non-routable characteristics. Brouters are connecting devices in networking systems that serve as both a network bridge and a router in the internetwork.
对于可路由协议,brouter在网络层工作,而对于不可路由协议,它们在数据链路层工作。Brouter对于可路由协议充当路由器,对于不可路由协议充当桥接器,处理可路由和不可路由的特性。Brouter是网络系统中的连接设备,在互联网络中同时充当网络桥接器和路由器。
148. What is Exterior Gateway Protocol (EGP)?
什么是外部网关协议(EGP)?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3058d557c902ba3fcc | 官方: 否 | 付费: 否
答案:
The Exterior Gateway Protocol (EGP) is a protocol that allows Internet gateways from the same or separate autonomous systems to share network reach-ability information.
外部网关协议(EGP)是一种允许来自相同或不同自治系统的互联网网关共享网络可达性信息的协议。
EGP serves three primary purposes: - Create a set of neighbors.
EGP有三个主要目的:- 建立一组邻居。
- Keep a check on the neighbors (to see if they are still alive and reachable).
- Notify the neighbors about the networks that are accessible from their autonomous systems.
149. What do you know about Network Virtual Terminal (NVT)?
关于网络虚拟终端(NVT),你了解多少?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3058d557c902ba3fcf | 官方: 否 | 付费: 否
答案:
Rather than communicating in native "languages", all Telnet clients and servers agree to deliver data and commands that conform to a fictional "virtual" terminal type known as the Network Virtual Terminal (NVT). The NVT specifies a set of standards for formatting and sending data, including character set, line termination, and how information about the Telnet session is provided.
为避免使用本机“语言”通信,所有Telnet客户端和服务器都同意发送符合虚构“虚拟”终端类型(称为网络虚拟终端NVT)的数据和命令。NVT规定了数据格式化和发送的一组标准,包括字符集、行终止以及如何提供关于Telnet会话的信息。
Every Telnet client on a terminal can communicate in both its native language and NVT. When a user enters information on his or her local terminal, it is translated to NVT and sent over the network in that format. When the Telnet server receives this information, it converts it from NVT to the format required by the remote host. In reverse, the same procedure is followed for transmissions from the server to the client.
终端上的每个Telnet客户端都能以其本机语言和NVT进行通信。当用户在其本地终端上输入信息时,该信息会被转换为NVT并通过网络以该格式发送。当Telnet服务器收到此信息时,会将其从NVT转换为远程主机所需的格式。反过来,从服务器到客户端的传输也遵循相同的过程。
150. What is the Hamming Code?
什么是海明码?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3058d557c902ba3fd2 | 官方: 否 | 付费: 否
答案:
The Hamming code is a set of error-correction codes that can be used to detect and fix errors that can arise when data is transferred or stored from one source to another. Redundant bits are extra binary bits that are created and added to the data transfer's information-carrying bits to ensure that no bits are lost during the data transfer. A parity bit is a bit that is appended to binary data to verify that the total number of 1s is even or odd. Error detection is done with parity bits. The Hamming Code is essentially the use of additional parity bits to allow for error detection.
海明码是一组纠错码,可用于检测和修复数据从一个源传输或存储到另一个源时可能出现的错误。冗余位是额外创建的二进制位,添加在数据传输的信息承载位之后,以确保数据传输过程中没有位丢失。奇偶校验位是附加到二进制数据上的一位,用于验证1的总数是偶数还是奇数。错误检测通过奇偶校验位完成。海明码本质上就是使用额外的奇偶校验位来实现错误检测。
151. What is the purpose of a Pseudo TTY (pseudo terminals)?
伪终端(PTY)的用途是什么?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3058d557c902ba3fd5 | 官方: 否 | 付费: 否
答案:
A bidirectional communication channel is provided by a pair of virtual character devices known as a pseudo TTY (or "PTY"). The master is at one end of the channel, while the slave is at the other. The pseudo-terminal's slave end provides an interface that is identical to that of a conventional terminal. A process that expects to be connected to a terminal can open the slave end of a pseudo-terminal, which will subsequently be controlled by a program that has opened the master end. Anything written on the master end is supplied to the slave end's process as if it were any input entered on a terminal. Anything written to the slave end of the pseudo-terminal, on the other hand, can be read by the process linked to the master end. Network login services, terminal emulators, and other such applications employ pseudo-terminals.
双向通信通道由一对虚拟字符设备提供,称为伪TTY(或“PTY”)。主端位于通道的一端,而从端位于另一端。伪终端的从端提供了一个与传统终端完全相同的接口。期望连接到终端的进程可以打开伪终端的从端,随后将由已打开主端的程序控制。写入主端的任何内容都会提供给从端的进程,就像终端上输入的任何输入一样。另一方面,写入伪终端从端的任何内容都可以由与主端连接的进程读取。网络登录服务、终端模拟器和其他此类应用使用伪终端。
152. What is BufferedWriter? What are flush() and close() used for?
什么是BufferedWriter?flush()和close()有什么用途?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3058d557c902ba3fd8 | 官方: 否 | 付费: 否
答案:
BufferedWriter is a temporary data storage source. It's used to make a buffered character output stream with the default output buffer size.
BufferedWriter是一个临时数据存储源。它用于创建具有默认输出缓冲区大小的缓冲字符输出流。
To flush characters from the buffered writer stream to a file, the flush() function of the BufferedWriter class in Java is employed. It ensures that all data items, including the last character, are written to the file.
为了将缓冲写入器流中的字符刷新到文件,使用了 Java 中 BufferedWriter 类的 flush() 函数。它确保所有数据项,包括最后一个字符,都被写入文件中。
The close() function of the Java BufferedWriter class flushes the characters from the buffer stream and then closes it. Calling methods like write() and append() after the stream has been closed will generate an error.
Java BufferedWriter 类的 close() 函数会刷新缓冲区流中的字符,然后关闭它。在流关闭之后调用 write() 和 append() 等方法将产生错误。
153. How does Dynamic Loading help in better memory space utilization?
动态加载如何帮助更好地利用内存空间?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3058d557c902ba3fed | 官方: 否 | 付费: 否
答案:
In dynamic loading, a routine is not loaded until it is called. This strategy is very effective when dealing with vast quantities of code, such as error routines, that occur infrequently. All routines are saved in a relocatable load format on the disk. The main program is executed after it has been loaded into memory. When a routine requires to call another routine, the calling routine checks to verify if the other routine is loaded first. If this is not the case, the relocatable linking loader is used to load the requested routine into memory and update the program's address tables. The newly loaded routine is then given control. In this way, dynamic loading helps in better memory space utilization.
在动态加载中,例程只有在被调用时才会被加载。这种策略在处理大量代码(如错误例程)且这些代码很少出现时非常有效。所有例程都以可重定位的加载格式保存在磁盘上。主程序在加载到内存后被执行。当某个例程需要调用另一个例程时,调用例程会先检查该另一个例程是否已加载。如果没有,则使用可重定位的链接加载器将所需例程加载到内存中,并更新程序的地址表。随后,新加载的例程获得控制权。通过这种方式,动态加载有助于更好地利用内存空间。
154. Write the code to find the length of a string without using the string functions.
编写代码,在不使用字符串函数的情况下求字符串的长度。
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Cognizant
- id: 69b37a3058d557c902ba3ff0 | 官方: 否 | 付费: 否
答案:
include
using namespace std;
using namespace std;
int main()
int main()
{
char str[100];
char str[100];
int len = 0;
int len = 0;
cout << "Enter a string: ";
cout << "Enter a string: ";
cin >> str;
cin >> str;
while(str[len] != '\0')
while(str[len] != '\0')
{
len++;
len++;
}
cout << "Length of the given string is: " << len;
cout << "Length of the given string is: " << len;
cout << endl;
cout << endl;
return 0;
return 0;
}
155. How will you print the address of a variable without using a pointer?
如何在不使用指针的情况下打印变量的地址?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba3ff3 | 官方: 否 | 付费: 否
答案:
We may acquire the address of any variable by using the “address of operator” (&) operator, which yields the variable's address.
我们可以通过使用“取地址运算符”(&)来获取任何变量的地址,该运算符会返回变量的地址。
include <stdio.h>
int main(void)
int main(void)
{
// declaring the variables
// 声明变量
int x;
int x;
float y;
float y;
char z;
char z;
printf("Address of x: %p\n", &x);
printf("x的地址: %p\n", &x);
printf("Address of y: %p\n", &y);
printf("y的地址: %p\n", &y);
printf("Address of z: %p\n", &z);
printf("z的地址: %p\n", &z);
return 0;
return 0;
}
156. List out the differences between Generalization and Specialization in DBMS.
列出数据库管理系统中泛化和特化之间的区别。
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba3ff9 | 官方: 否 | 付费: 否
答案:
| GENERALIZATION 泛化 | SPECIALIZATION 特化 |
|---|---|
| Generalization uses a Bottom-Up approach. 泛化采用自底向上的方法。 | Specialization uses a top-down approach. 特化采用自顶向下的方法。 |
| The size of the schema gets reduced in Generalization. 在泛化中,模式的大小会减小。 | The size of the schema gets increased in Specialization. 在特化中,模式的大小会增加。 |
| Generalization is usually applied to a group of entities. 泛化通常应用于一组实体。 | Specialization can be applied to a single entity. 特化可以应用于单个实体。 |
| The practice of forming groupings from diverse entity sets is known as Generalization. 从不同的实体集形成分组的实践称为泛化。 | The process of forming subgroups inside an entity set is known as Specialization. 在实体集内形成子组的过程称为特化。 |
| In Generalization, in order to form a higher entity, the differences and similarities between lower entities are ignored and their union is considered. 在泛化中,为了形成更高级别的实体,会忽略较低级别实体之间的差异和相似性,并考虑它们的并集。 | In Specialization, lower entities are formed by splitting higher entities. 在特化中,较低级别的实体通过拆分更高级别的实体而形成。 |
| Inheritance does not exist in Generalization. 泛化中不存在继承。 | Inheritance exists in Specialization. 特化中存在继承。 |
| Example: Consider the ideas of a Student and a Patient. These two entities will have distinct properties. Student entities, for example, will have Roll No, Name, and Mob No attributes, whereas patient entities will have PId, Name, and Mob No attributes. In this case, the Name and Mob No of both the Student and the Patient can be joined as a Person to construct a higher-level entity, which is known as the Generalization Process. 示例:考虑学生和患者的概念。这两个实体将具有不同的属性。例如,学生实体将具有学号、姓名和手机号属性,而患者实体将具有患者ID、姓名和手机号属性。在这种情况下,学生和患者的姓名和手机号可以合并为一个“人”以构造更高级别的实体,这被称为泛化过程。 | Example: Consider the account of a person as an entity. This will have some properties, such as Acc No and Balance. Other properties of the account entity, such as Current Acc and Savings Acc, may exist. Now that Current Acc has Acc No, Balance, and Transactions, and Savings Acc has Acc No, Balance, and Interest Rate, we may argue that specialized entities inherit characteristics from higher-level entities. 示例:将一个人的账户视为一个实体。这将具有一些属性,如账户号和余额。账户实体可能还有其他属性,如当前账户和储蓄账户。现在,当前账户具有账户号、余额和交易记录,而储蓄账户具有账户号、余额和利率,我们可以认为特化实体继承了更高级别实体的特征。 |
157. What exactly is index hunting, and how does it aid query performance?
索引查找到底是什么,它如何帮助提升查询性能?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba3fff | 官方: 否 | 付费: 否
答案:
Index hunting is the method of boosting a collection of indexes. This is done because indexes improve query performance as well as query processing time.
索引查找是增强一组索引的方法。这样做是因为索引能提升查询性能以及查询处理时间。
It aids in query performance improvement in the following ways: - Using the query optimizer, the optimal queries are suggested.
它通过以下方式帮助提升查询性能:- 使用查询优化器,推荐最优查询。
- To check the effect, parameters such as index, query distribution, and performance are used.
- Databases are optimized into a small group of problem queries.
158. Write the steps to create, update and drop a view in SQL.
写出在SQL中创建、更新和删除视图的步骤。
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba4002 | 官方: 否 | 付费: 否
答案:
In SQL, a view is a single table that contains data from other tables. As a result, a view features rows and columns that are identical to those of a real table, as well as fields from one or more tables.
在SQL中,视图是一个包含来自其他表数据的单表。因此,视图具有与真实表相同的行和列,以及来自一个或多个表的字段。
In order to create a view:
为了创建视图:
CREATE VIEW View_Name AS
CREATE VIEW View_Name AS
SELECT Column1, Column2, Column3, ..., ColumnN
SELECT Column1, Column2, Column3, ..., ColumnN
FROM Table_Name
FROM Table_Name
WHERE Condition;
WHERE Condition;
For updating a view:
为了更新视图:
CREATE VIEW OR REPLACE View_Name AS
CREATE VIEW OR REPLACE View_Name AS
SELECT Column1, Column2, Column3, ..., ColumnN
SELECT Column1, Column2, Column3, ..., ColumnN
FROM Table_Name
FROM Table_Name
WHERE Condition;
WHERE Condition;
For dropping a view:
为了删除视图:
DROP VIEW View_Name;
DROP VIEW View_Name;
In the above queries, Column1, Column2, .. ColumnN denotes the name of the columns to be added or updated. View_Name denotes the name of the view created and Table_name denotes the name of the current table.
在上述查询中,Column1、Column2、... ColumnN表示要添加或更新的列名。View_Name表示所创建视图的名称,Table_name表示当前表的名称。
159. What is Root Partition in OS?
操作系统中的根分区是什么?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba400b | 官方: 否 | 付费: 否
答案:
The root partition is the place where the operating system kernel is located. Other potentially crucial system files that are mounted during boot time are contained in it as well.
根分区是操作系统内核所在的位置。其他在启动期间挂载的潜在关键系统文件也包含在其中。
160. What is the purpose of a Virtual File System (VFS)?
虚拟文件系统(VFS)的目的是什么?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba400e | 官方: 否 | 付费: 否
答案:
An abstract layer on top of a more concrete file system is a virtual file system (VFS) or virtual filesystem switch. - The purpose of a VFS is to make it possible for client applications to access various types of concrete file systems in a consistent manner. For example, a VFS can be used to seamlessly access local and network storage devices without the client device recognizing the difference.
在更具体的文件系统之上的抽象层是虚拟文件系统(VFS)或虚拟文件系统开关。- VFS的目的是使客户端应用程序能够以一致的方式访问各种类型的具体文件系统。例如,VFS可以用于无缝访问本地和网络存储设备,而客户端设备无需察觉差异。
- It can be used to bridge the gap between Windows, traditional Mac OS/macOS, and Unix filesystems, allowing applications to access files on those sorts of local file systems without needing to know what type of file system they're dealing with.
- A VFS defines the kernel's interface with a certain file system. As a result, adding support for new file system types to the kernel is simple.
161. What is caching? How does caching work?
什么是缓存?缓存是如何工作的?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba4011 | 官方: 否 | 付费: 否
答案:
Caching is a technique for saving numerous copies of the most frequently used data in a temporary storage area (or cache) so that they can be accessed more quickly. It keeps data in a temporary format for software applications, servers, and web browsers, so users don't have to download information every time they visit a website or use an application.
缓存是一种将最常用数据的多份副本保存在临时存储区域(或缓存)中的技术,以便更快地访问它们。它将数据以临时格式保存,供软件应用程序、服务器和网络浏览器使用,这样用户无需每次访问网站或使用应用程序时都下载信息。
Cached data works by saving data in a device's memory for later access. The data is kept in the memory of a computer, directly below the central processing unit (CPU). The primary cache level is incorporated into a device's microprocessor chip, followed by two more secondary cache levels that feed the primary level. This information is kept until the content's time to live (TTL), which specifies how long it should be cached, expires or the device's disc or hard drive cache fills up.
缓存数据的工作原理是将数据保存在设备内存中供后续访问。数据保存在计算机内存中,直接位于中央处理器(CPU)下方。一级缓存集成在设备的微处理器芯片中,随后有两个二级缓存层为一级缓存提供数据。这些信息被保留,直到内容的生存时间(TTL)到期(TTL指定了缓存应保存的时间),或者设备的磁盘或硬盘缓存填满。
Data is usually cached in one of two ways: browser or memory caching (data stored locally on the computer) or Content Delivery Networks (data stored in geographically distributed locations).
数据通常通过两种方式之一进行缓存:浏览器或内存缓存(数据本地存储在计算机上)或内容分发网络(数据存储在地理分布的多个位置)。
162. What is Preemptive Multitasking? How is it different from Cooperative Multitasking?
什么是抢占式多任务处理?它与协作式多任务处理有何不同?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba4014 | 官方: 否 | 付费: 否
答案:
Preemptive multitasking permits computer programs to share operating systems (OS) and underlying hardware resources. It distributes the overall operating and computing time amongst processes, and it uses established criteria to switch resources between processes. Time-shared multitasking is another name for preemptive multitasking.
抢占式多任务处理允许计算机程序共享操作系统(OS)和底层硬件资源。它在进程之间分配总体运行和计算时间,并使用既定标准在进程之间切换资源。时间共享多任务处理是抢占式多任务处理的另一个名称。
The operating system never initiates context switching from one process to another in cooperative multitasking. Only when the processes voluntarily cede control on a routine basis, or when they are inactive or logically blocked, does a context switch occur, allowing many applications to run at the same time. In addition, in this multitasking, all processes work together to make the scheduling strategy work.
在协作式多任务处理中,操作系统从不主动启动从一个进程到另一个进程的上下文切换。只有进程自愿定期让出控制权,或者当它们处于不活动状态或逻辑阻塞时,才会发生上下文切换,从而允许多个应用程序同时运行。此外,在这种多任务处理中,所有进程协同工作以使调度策略生效。
163. Name the typical elements of a processed image.
命名处理后图像的典型元素。
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba401a | 官方: 否 | 付费: 否
答案:
The typical elements of a processed image are: - User data: This element of user space includes program data, user stack area, and programs that can be modified.
处理后图像的典型元素包括:- 用户数据:用户空间的此元素包括程序数据、用户堆栈区域以及可修改的程序。
- User program: The set of instructions that are to be executed.
- System Stack: Each process is associated with one or more LIFO (Last In First Out) stacks. Parameters and calling addresses for procedure and system calls are stored here.
- Process control Block (PCB): Information required by the operating system to control operations.
164. What is Trapdoor in OS?
操作系统中的陷阱门是什么?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba401d | 官方: 否 | 付费: 否
答案:
A trapdoor is a software or hardware mechanism that can be used to bypass system controls. In general, it's malicious software that allows an attacker on the other side of the Internet to gain unauthorized access to a computer system or network by accepting remote commands. Trap door software monitors a specific Transmission Control Protocol (TCP) or User Datagram Protocol (UDP) port for orders.
陷阱门是一种软件或硬件机制,可用于绕过系统控制。通常,它是一种恶意软件,允许互联网另一端的攻击者通过接受远程命令来未授权访问计算机系统或网络。陷阱门软件监视特定的传输控制协议(TCP)或用户数据报协议(UDP)端口以获取命令。
165. What is the Translation Lookaside Buffer?
什么是转换后备缓冲器?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba4020 | 官方: 否 | 付费: 否
答案:
Translation TLB (Transaction Look-aside Buffer) is a particular cache that keeps track of recently used transactions. The TLB includes the most recently used page table entries. The CPU analyses the TLB when given a virtual address. The frame number is retrieved and the real address is created if a page table entry (TLB hit) is present. If a page table entry is missing from the TLB (TLB miss), the page number is used as an index while processing the page table. The TLB first checks if the page is already in main memory; if it isn't, a page fault is generated, and the TLB is then modified to incorporate the new page entry.
转换TLB(事务后备缓冲器)是一种特殊缓存,用于跟踪最近使用的事务。TLB包含最近使用的页表项。CPU在收到虚拟地址时会分析TLB。如果存在页表项(TLB命中),则检索帧号并生成真实地址。如果TLB中缺少页表项(TLB未命中),则页号在处理页表时用作索引。TLB首先检查页面是否已在主内存中;如果不在,则生成页错误,然后TLB被修改以纳入新页条目。
166. What is the resident set and working set?
常驻集和工作集是什么?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba4023 | 官方: 否 | 付费: 否
答案:
At any given time, the resident set is the part of the processed image that is actually in the real memory. It's broken down into subsets, one of which is the working set. The working set is the subset of the resident set required for execution.
在任何给定时间,常驻集是进程映像中实际位于真实内存中的部分。它被细分为若干子集,其中之一就是工作集。工作集是执行所需的常驻集子集。
Cognizant Interview Preparation
167. Is cognizant interview difficult?
Cognizant 的面试难吗?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba4035 | 官方: 否 | 付费: 否
答案:
The amount of effort you put into preparing for an interview determines how difficult it is. The more you prepare, the easier it will be to pass the interview. All you need to know is the fundamentals of new technologies, programming languages, your projects, and Cognizant. Interviewers are interested in how candidates approach problems, construct their thought process, and display personal qualities such as communication, in addition to technical knowledge (which is vital).
你为面试做准备所投入的努力决定了面试的难度。你准备得越多,通过面试就越容易。你需要知道的只是新技术、编程语言、你的项目以及 Cognizant 的基础知识。除了技术知识(这至关重要)之外,面试官还关注候选人如何解决问题、构建思维过程,以及展现沟通等个人品质。
168. What is the fresher salary in Cognizant?
Cognizant 新人的薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba4038 | 官方: 否 | 付费: 否
答案:
At Cognizant, a fresher's pay ranges from 3.3 to 4.5 lakhs.
在 Cognizant,新人的薪资范围在 33 万到 45 万卢比之间。
169. What are the questions asked in a Cognizant interview?
Cognizant 面试中会问哪些问题?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba403b | 官方: 否 | 付费: 否
答案:
Questions are asked related to a fundamental understanding of operating systems, database management systems (RDBMS, various keys), computer networks (particularly the OSI model and its seven layers of function, protocols, IP addresses, routers, and so on), and cloud computing. Your programming abilities will also be examined. Be prepared with the fundamentals of Java, HTML, C, C++ among other topics. The interviewer might ask basic questions regarding the candidate's job experience, expected salary, background, qualification during the HR Round. Learn More .
问题涉及操作系统的基础理解、数据库管理系统(关系数据库、各种键)、计算机网络(特别是 OSI 模型及其七层功能、协议、IP 地址、路由器等)以及云计算。你的编程能力也会被考察。要准备好 Java、HTML、C、C++ 等主题的基础知识。在人力资源轮次中,面试官可能会询问候选人的工作经验、预期薪资、背景和资质等基本问题。了解更多信息。
170. Is there any bond in Cognizant?
Cognizant 有违约金或服务期协议吗?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba403e | 官方: 否 | 付费: 否
答案:
There is no such thing as a Bond. In the sense that you are not required to pay any money if you desire to terminate your contract with the firm.
不存在所谓的违约金或服务期协议。也就是说,如果你想终止与公司的合同,你不需要支付任何费用。
171. Does cognizant have a dress code?
Cognizant 有着装要求吗?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba4041 | 官方: 否 | 付费: 否
答案:
The dress code is casual. Simply maintain a neat and tidy appearance.
着装要求是休闲装。只需保持整洁干净的外观即可。
172. How can I apply for Cognizant ?
我如何申请 Cognizant?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba4044 | 官方: 否 | 付费: 否
答案:
You can apply to Cognizant in a variety of ways, including through employment sites, Cognizant's career page , attending recruiting drives, using the employee referral system, or consulting with placement experts.
你可以通过多种方式申请 Cognizant,包括通过招聘网站、Cognizant 的职业页面、参加招聘活动、使用员工推荐系统,或咨询就业安置专家。
173. How many rounds are there in a Cognizant interview?
Cognizant 面试有几轮?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba4047 | 官方: 否 | 付费: 否
答案:
The Cognizant Recruitment Process consists of two steps: - Online exam
Cognizant 招聘流程包括两个步骤:- 在线考试
Interview process
Technical interview HR interview技术面试 人力资源面试
Check out the above section for the detailed interview process .
查看上述部分以了解详细的面试流程。
174. How is career growth in Cognizant?
Cognizant的职业发展如何?
- 知识点: 其他/未分类 (标签: interviewbit, cognizant, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Cognizant
- id: 69b37a3158d557c902ba404a | 官方: 否 | 付费: 否
答案:
Cognizant is proud of its workers' achievements and is committed to promoting their personal and professional development by providing: - Well defined role enhancement programs
Cognizant为员工的成就感到自豪,并致力于通过提供以下内容促进他们的个人和专业发展:- 明确的角色提升计划
- Career planning
- Opportunities to advance their careers by pursuing further education or industry credentials.
Possibilities to apply for open employment at Cognizant
Coding Problems
0/7
Easy Problems
简单问题
Math
数学
Strings
字符串
Time Complexity
时间复杂度
Arrays
数组
All Factors
所有因子
Easy
简单
35.3 Mins
35.3分钟
Solve
解答
Lowest Common Multiple (LCM)
最小公倍数 (LCM)
Very Easy
非常简单
21.28 Mins
21.28分钟
Solve
解答
Character Frequencies
字符频率
Easy
简单
20.18 Mins
20.18分钟
Solve
解答
Which Season?
哪个季节?
Very Easy
非常简单
10.46 Mins
10.46分钟
Solve
解答
Pangram Check
全字母句检查
Very Easy
非常简单
28.56 Mins
28.56分钟
Solve
解答
Diagonal Flip
对角线翻转
Very Easy
非常简单
21.15 Mins
21.15分钟
Solve
解答
Valid Password
有效密码
Very Easy
非常简单
21.45 Mins
21.45 分钟
Solve
解答
175. What is Commvault in the context of Application Software?
在应用软件背景下,什么是Commvault?
- 知识点: 其他/未分类 (标签: interviewbit, commvault, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Commvault
- id: 69b37a4d58d557c902ba50cb | 官方: 否 | 付费: 否
答案:
Commvault is a data protection solution for medium and large businesses and is in extreme demand today. To handle an application’s disaster recovery and data protection activities, it offers an exceptionally flexible web user interface. It minimises the time it takes to perform routine data recovery and protection operations by using default simplified methods and configuration parameters. We can identify the stuff we want to secure and start and control restores and backups using Commvault's command centre.
Commvault是一款面向中大型企业的数据保护解决方案,如今需求极为旺盛。为了处理应用的灾难恢复和数据保护活动,它提供了极其灵活的Web用户界面。通过使用默认的简化方法和配置参数,它减少了执行常规数据恢复和保护操作所需的时间。我们可以使用Commvault的命令中心识别要保护的内容,并启动和控制恢复及备份操作。
Leading multinational corporations such as Adobe, Apollo Tyres, Microsoft, NTT DATA, and NASA rely on Commvault to manage their rapidly changing business environments. The latest Commvault features streamline the data backup and recovery processes.
诸如Adobe、Apollo Tyres、微软、NTT DATA和NASA等领先跨国公司都依赖Commvault来管理其快速变化的业务环境。最新的Commvault功能简化了数据备份和恢复流程。
176. How are keys backed up in the event of a disaster?
在灾难事件中,密钥如何备份?
- 知识点: 其他/未分类 (标签: interviewbit, commvault, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Commvault
- id: 69b37a4d58d557c902ba50ce | 官方: 否 | 付费: 否
答案:
Disaster Recovery protection is provided through a regularly scheduled Export and Backup of the CommServe Database (DR Backup activity).
灾难恢复保护通过定期安排的 CommServe 数据库导出和备份(DR 备份活动)提供。
177. How can you know if a job has been encrypted, and if so, how?
您如何知道作业是否已加密,如果已加密,是如何知道的?
- 知识点: 其他/未分类 (标签: interviewbit, commvault, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Commvault
- id: 69b37a4d58d557c902ba50d4 | 官方: 否 | 付费: 否
答案:
For jobs that have been software or hardware encrypted, a superscript E or a HE will appear next to the job ID in the Jobs in Storage Policy report.
对于已进行软件或硬件加密的作业,作业 ID 旁边会显示上标 E 或 HE,位于存储策略中的作业报告中。
178. Explain the differences between snapshot and backup.
解释快照和备份之间的区别。
- 知识点: 其他/未分类 (标签: interviewbit, commvault, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Commvault
- id: 69b37a4d58d557c902ba50d7 | 官方: 否 | 付费: 否
答案:
- Backup: A backup is a copy of a file or other piece of data. When you start a backup, it copies your files. These duplicates are stored in a different location. Depending on the amount of data you're backing up, backups can take a long time to complete.
- Snapshot: Snapshots are a kind of "picture" of your server's file system that you can take at any time. This picture accurately depicts the server at the time it was taken. Servers can be restored using snapshots by restoring them to the state they were in when the snapshot was taken.
The following points illustrate the differences between snapshot and backup: - Backups can be kept in multiple places, on the same disk, or even on the same server. They don't necessitate both off- and on-site storage. Snapshots necessitate both on-site and off-site storage, and they must always be kept in the same locations as the original system data.
以下几点说明了快照和备份之间的区别:- 备份可以保存在多个位置,如在相同磁盘上,甚至在同一服务器上。它们不需要同时进行场外和现场存储。快照则需要现场和场外存储,并且必须始终保存在与原始系统数据相同的位置。
- Backups for SQL servers are normally done through a subscription service. The operations involved in creating snapshots are normally free and can be done at any time.
- When it comes to backups, there can be discrepancies between when they started and when they finished. Snapshots are "pictures" of your server that retain it in its current state.
- Making backups can be a time-consuming and laborious task. Snapshots are instantaneous and take a fraction of the time. Snapshots also save time when copying data.
- Only the file system is included in backup files. Different types of systems can be captured in snapshots. Files, programs, settings, and other items fall into this category.
- Backups are saved in various locations and can be readily recovered. Backups are frequently verifiable as well. Snapshots aren't the same thing as backups. They can (and should) be utilised as a part of the backup process, but they are primarily short-term solutions. When a backup is finished, snapshots are removed.
179. What do you understand by a snapshot in the context of Commvault? What are the advantages of having snapshots?
在 Commvault 的背景下,您对快照如何理解?拥有快照有哪些优势?
- 知识点: 其他/未分类 (标签: interviewbit, commvault, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Commvault
- id: 69b37a4d58d557c902ba50da | 官方: 否 | 付费: 否
答案:
A snapshot is a "picture" of your server's file system taken at a certain point in time. In the event of data loss or corruption, this picture of your file system is frequently utilised to recover complete servers. When there isn't enough space, fresh snapshots will typically overwrite existing snapshots. Snapshots can come in handy in a variety of situations.
快照是服务器文件系统在特定时间点的“图片”。在数据丢失或损坏的情况下,此文件系统图片常被用于恢复完整服务器。当空间不足时,新快照通常会覆盖现有快照。快照在多种情况下都能派上用场。
The following are the advantages of having a snapshot: - Snapshots are tiny and can be taken quickly and simply without causing too much server load.
拥有快照的优势如下:- 快照体积小,且能快速简便地创建,不会给服务器带来过多负载。
- They improve app availability, speed recovery, simplify backup administration for large data volumes, and reduce data loss risk.
- Snapshots can be scheduled and used for system backup as needed.
- They can almost completely eliminate the requirement for backup windows while also lowering the total cost of ownership.
- Snapshots can be used to recover data that has been corrupted or destroyed. (In the event of file corruption, you can also roll back to an older version of a snapshot.)
- Rather than restoring the entire system, replicated snapshot copies can be used because they are already in their natural format.
- You can immediately begin restoring a server from a snapshot.
180. For deduplicated storage policy, what is the default block size?
对于去重存储策略,默认块大小是多少?
- 知识点: 其他/未分类 (标签: interviewbit, commvault, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Commvault
- id: 69b37a4d58d557c902ba50dd | 官方: 否 | 付费: 否
答案:
For deduplicated storage policies, the default block size is 128kb.
对于去重存储策略,默认块大小为 128kb。
181. What are some of the most common/regular backup failures that one encounters?
人们常遇到的一些最常见/常规的备份失败有哪些?
- 知识点: 其他/未分类 (标签: interviewbit, commvault, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Commvault
- id: 69b37a4d58d557c902ba50e3 | 官方: 否 | 付费: 否
答案:
The following are some of the more common or more frequent backup issues: - Network communication issues.
以下是备份中一些较为常见或频繁出现的问题:- 网络通信问题。
- Destination disk library full.
- Client services might be shut down for maintenance.
- Media agent offline.
- VSS snapshot backup failure.
- Data path offline.
182. Write a list of all the tasks that a backup administrator performs on a daily basis.
列出备份管理员每天执行的所有任务。
- 知识点: 其他/未分类 (标签: interviewbit, commvault, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Commvault
- id: 69b37a4d58d557c902ba50e6 | 官方: 否 | 付费: 否
答案:
First and foremost, the backup administrator must ensure that all planned jobs are operating as expected. If they don't, they'll have to go over the work again to figure out what's wrong and how to fix it.
首先,备份管理员必须确保所有计划任务按预期运行。如果没有,他们需要重新检查工作以找出问题所在并加以修复。
They must also participate in some of the following checkups: - Check for Media agents to make sure they aren't in offline mode.
他们还必须参与以下一些检查:- 检查媒体代理,确保它们未处于离线模式。
- To monitor the free space or remaining space in the disc libraries on a frequent basis.
- Extract a failed backup report and examine it so that the rectification process can continue.
- Check the reporting tool on a frequent basis for the deployment, decommissioning, and restoration requests.
183. What are the key features of Commvault?
Commvault 的关键特性有哪些?
- 知识点: 其他/未分类 (标签: interviewbit, commvault, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Commvault
- id: 69b37a4d58d557c902ba50ef | 官方: 否 | 付费: 否
答案:
The key features of Commvault are as follows: - Provides Backup: Virtual machines, applications (including cloud), databases, endpoints, and files are all protected by backups. This has the following benefits:
Commvault 的关键特性如下:- 提供备份:虚拟机、应用程序(包括云)、数据库、终端和文件均受备份保护。这具有以下好处:
Customized schedules to satisfy any SLA with policy-driven automation, monitoring, and reporting; no tedious scripts are required. Data that has been deduplicated for faster data transmission. Auto-discovery protects newly uploaded data sets in a proactive manner. Customized retention for compliance and recovery. Encryption at rest and in transport can be configured. - Provides recovery: Recovery of virtual machines, apps (including cloud), databases, endpoints, and files is ensured. This has the following benefits:
通过策略驱动的自动化、监控和报告满足任何 SLA 的自定义计划;无需繁琐的脚本。数据经过去重以加快传输速度。自动发现可主动保护新上传的数据集。为合规和恢复提供自定义保留策略。可配置静态和传输中的加密。- 提供恢复:确保虚拟机、应用程序(包括云)、数据库、终端和文件的恢复。这具有以下好处:
Recovery of the full system, instance, or application. Granular single file recovery. In-place or out-of-place to a different location. - Enables migration: Workload migration from on-premises to cloud, or between clouds is enabled. This has the following benefits:
完整系统、实例或应用程序的恢复。粒度的单个文件恢复。就地或异地恢复到不同位置。- 支持迁移:支持从本地到云或云之间的工作负载迁移。这具有以下好处:
Minimal need for customised scripts. No downtime for production systems. Data portability between clouds. Avoids vendor lock-in. - Integration of hardware snapshots: Commvault leverages hardware snapshots for near-instant recovery of full data volumes. This has the following benefits:
对自定义脚本的需求最小。生产系统无停机。云之间的数据可移植性。避免供应商锁定。- 硬件快照集成:Commvault 利用硬件快照实现全数据卷的近乎即时恢复。这具有以下好处:
Support for all major snapshot hardware vendors. Automated snapshot backup and recovery. Customized snapshot retention. - Integration with the cloud: We can use the cloud for scalability, mobility, availability, and cost savings for production workloads. Commvault has the following benefits with regards to this:
支持所有主要快照硬件供应商。自动化的快照备份和恢复。自定义快照保留策略。- 云集成:我们可以利用云来实现生产工作负载的可扩展性、移动性、可用性和成本节约。Commvault 在这方面具有以下好处:
Support for all major cloud vendors. Backup, recovery, and migration to, in, and from the cloud on a single platform. Maintain compliance control on both on-premises and cloud data management. - Flexible storage options: We can have multiple copies of data in multiple locations. Commvault has the following benefits with regards to this:
支持所有主要云供应商。在单一平台上进行备份、恢复和迁移到云、在云内及从云迁移。在本地和云端数据管理上保持合规控制。- 灵活的存储选项:我们可以在多个位置保存数据的多个副本。Commvault 在这方面具有以下好处:
Disk library – individual hard drives or RAID array. Tape library. Cloud storage – all major suppliers supported. Network-attached storage (NAS). Deduplication for more efficient – and cost-effective – data storage.
磁盘库 – 单个硬盘驱动器或 RAID 阵列。磁带库。云存储 – 支持所有主要供应商。网络附加存储(NAS)。去重以实现更高效、更具成本效益的数据存储。
184. What are the advantages of using Commvault?
使用 Commvault 的优势有哪些?
- 知识点: 其他/未分类 (标签: interviewbit, commvault, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Commvault
- id: 69b37a4d58d557c902ba50f2 | 官方: 否 | 付费: 否
答案:
The following are the advantages of using Commvault: - Storage: Data can be securely stored on tape, disk, and database servers. We can employ data autonomous multiple copy management to meet all compliance and disaster recovery requirements.
以下是使用 Commvault 的优势:- 存储:数据可以安全地存储在磁带、磁盘和数据库服务器上。我们可以采用数据自主多副本管理,以满足所有合规和灾难恢复要求。
- Access to data and information: We can access and save emails and data files, as well as assist in retrieving and recovering them on a constant basis from mobile and online browser sites.
- Changing, analysing, and reporting: To give a full review to the CommCell, Commvault modifies the events that require attention, reports with in-depth information on the operations, and detailed data analytics.
- Data Security: All of the major applications and operating systems provide data protection methods such as archiving, replication, backup, and snapshots.
- Administration: A single administration interface is used to manage all administrative tasks. Web pages and mobile devices can be used to perform the tasks.
185. How would you differentiate between a String, StringBuffer, and a StringBuilder?
你如何区分 String、StringBuffer 和 StringBuilder?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5baa | 官方: 否 | 付费: 否
答案:
In Java, String, StringBuffer, and StringBuilder are all classes used to represent strings, but they have some key differences:
在 Java 中,String、StringBuffer 和 StringBuilder 都是用于表示字符串的类,但它们有一些关键区别:
| Feature 特性 | String | StringBuffer | StringBuilder |
|---|---|---|---|
| Immutable & Methods 不可变性与方法 | Yes. Immutable methods are provided. 是。提供不可变方法。 | No. Mutable methods are provided. 否。提供可变方法。 | No. Mutable methods are provided. 否。提供可变方法。 |
| Thread-safe 线程安全 | Yes. (Their values cannot be changed once they are created, making them inherently thread-safe.) 是。(其值一旦创建便无法更改,因此本质上具有线程安全性。) | Yes. (It provides synchronized methods to ensure that only one thread can access and modify the instance at a time. This makes it a safer choice for use in a concurrent environment.) 是。(它提供同步方法以确保同一时间只有一个线程能访问和修改实例。这使其在并发环境中是更安全的选择。) | No. (If multiple threads modify a StringBuilder object concurrently, it can result in data inconsistencies and race conditions.) 否。(如果多个线程并修改StringBuilder对象,可能导致数据不一致和竞态条件。) |
| Performance 性能 | Slow. (Strings are immutable objects. This means that whenever a modification is made to a String, a new String object is created, which can lead to memory allocation and garbage collection overheads.) 慢。(字符串是不可变对象。这意味着每次对字符串进行修改时,都会创建新的字符串对象,这可能导致内存分配和垃圾回收开销。) | Moderate. (It provides thread-safe operations through synchronized methods, which can impact performance.) 中等。(它通过同步方法提供线程安全的操作,这可能影响性能。) | Fast. (It provides a mutable sequence of characters that can be modified in place without creating new objects.) 快。(它提供了可原地修改的可变字符序列,无需创建新对象。) |
| Synchronization 同步 | Every method is synchronized. 每个方法都同步。 | Every method is synchronized. 每个方法都同步。 | None of the methods are synchronized. 所有方法均未同步。 |
| Capacity (Length of the string) 容量(字符串长度) | Capacity can't be increased. 容量无法增加。 | Capacity can be increased 容量可以增加。 | Capacity can be increased 容量可以增加。 |
| Best Use 最佳用途 | When the string is not going to change. 当字符串不会被更改时。 | When string needs to be changed and thread safety is important. 当字符串需更改且线程安全重要时。 | When string needs to be changed and thread safety is not important. 当字符串需更改且线程安全不重要时。 |
| Examples for Definition 定义示例 | String str = "Hello"; String s = new String(“Hello”); String str = "Hello";String s = new String(“Hello”); | StringBuffer sb = new StringBuffer("Hello"); | StringBuilder sb = new StringBuilder("Hello"); |
186. What do you know about the JIT Compiler?
您对JIT编译器了解多少?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5bad | 官方: 否 | 付费: 否
答案:
JIT (Just-In-Time) compiler is a feature of the Java Virtual Machine (JVM) that can improve the performance of Java applications. The JIT compiler dynamically translates the bytecode of a Java method into native machine code at runtime, rather than at compile time. This allows the JVM to take advantage of the underlying hardware and optimize the performance of the Java application.
JIT(即时)编译器是Java虚拟机(JVM)的一个特性,可以提升Java应用程序的性能。JIT编译器在运行时动态地将Java方法的字节码转换为本地机器码,而不是在编译时进行。这使JVM能够利用底层硬件并优化Java应用程序的性能。
The JIT compiler works by monitoring the execution of the Java application and identifying the frequently executed methods (also called "hot spots"). These hot spots are then compiled into native machine code, which can be executed much faster than the original bytecode. The JIT compiler can also perform various optimizations such as in-lining methods, eliminating dead code, and reordering instructions to improve performance.
JIT编译器通过监控Java应用程序的执行并识别频繁执行的方法(也称为“热点”)来工作。这些热点随后被编译为本地机器码,其执行速度远快于原始字节码。JIT编译器还可以执行各种优化,如方法内联、消除死代码和重排指令以提升性能。
The JIT compilation process occurs at runtime, so it can take advantage of dynamic information about the application and the system it is running on. This allows the JIT compiler to make more informed decisions about how to optimize the code for a particular environment, which can lead to better performance than a static compilation.
JIT编译过程发生在运行时,因此可以利用应用程序及其运行系统的动态信息。这使JIT编译器能够更好地决定如何为特定环境优化代码,从而比静态编译获得更好的性能。
JIT compilation can also help to improve the start-up time of an application because the frequently used method will be compiled and ready to be executed.
JIT编译还可以帮助改善应用程序的启动时间,因为频繁使用的方法将被编译并准备好执行。
It's worth noting that JIT compilation can also introduce some overhead and complexity, as the JIT compiler needs to monitor the execution of the application and make decisions about what to optimize. In some cases, the JIT compiler may not be able to optimize the code as much as desired, or it may introduce additional overhead. But overall, JIT compilation is an important feature of the JVM that can significantly improve the performance of Java applications.
值得注意的是,JIT编译也可能引入一些开销和复杂性,因为JIT编译器需要监控应用程序的执行并决定优化内容。在某些情况下,JIT编译器可能无法按预期优化代码,或者可能引入额外开销。但总体而言,JIT编译是JVM的一个重要特性,能显著提升Java应用程序的性能。
For Example - Consider the below code-
例如 - 考虑以下代码-
class InterviewBit {
class InterviewBit {
public static void add(int a, int b) {
public static void add(int a, int b) {
return a+b;
return a+b;
}
public static void main(String[] args) {
public static void main(String[] args) {
int res = 0;
int res = 0;
for(int i = 0; i < 100; i++) {
for(int i = 0; i < 100; i++) {
res += add(i, i*10);
res += add(i, i*10);
}
System.out.println(res);
System.out.println(res);
}
}
In the above code, we can see that the add method is executed in a loop. So JVM will understand this and frame an executable by JIT Compiler for the “add” method. And this can be used for a future call. This saves execution time.
在上面的代码中,我们可以看到 add 方法在循环中执行。因此,JVM 会理解这一点,并为 “add” 方法由 JIT 编译器生成一个可执行文件。这可以用于未来的调用,从而节省执行时间。
The below image explains the same -
下图说明了这一点 -
187. Differentiate between HashSet and TreeSet. When would you prefer TreeSet to HashSet?
区分 HashSet 和 TreeSet。你什么时候会优先选择 TreeSet 而不是 HashSet?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5bb7 | 官方: 否 | 付费: 否
答案:
In Java, HashSet and TreeSet are both classes that implement the Set interface and are used to represent a collection of unique elements, but they have some key differences:
在 Java 中,HashSet 和 TreeSet 都是实现 Set 接口的类,用于表示唯一元素的集合,但它们有一些关键区别:
| Feature 特性 | HashSet | TreeSet |
|---|---|---|
| Underlying Data Structure 底层数据结构 | HashTable. 哈希表。 | Height Balanced Tree. 高度平衡树。 |
| Ordering 排序 | Unordered. (It doesn't follow any sequence, like ascending order) 无序。(它不遵循任何顺序,如升序) | Ordered. (It follows the sequence, i.e, sorting) 有序。(它遵循顺序,即排序) |
| Time Complexity 时间复杂度 | O(1) for add, remove, and contains operations. add、remove 和 contains 操作的时间复杂度为 O(1)。 | O(log n) for add, remove, and contains operations. add、remove 和 contains 操作的时间复杂度为 O(log n)。 |
| Null elements 空元素 | Allows one null element. 允许一个空元素。 | Not allowed. 不允许。 |
| Sorted 排序性 | Not Sorted. (If we print the value, the output is not printed in sorted order) 未排序。(如果我们打印值,输出不会按排序顺序打印) | Sorted. (Inserted value follows a sorting, Natural or customized) 已排序。(插入的值遵循排序,顺序可以是自然顺序或自定义顺序) |
| Performance 性能 | Faster for most operations. (It is faster because of the Hash Function.) 大多数操作更快。(由于哈希函数,它更快。) | Slower for most operations. (It is a little bit slower because of balancing the nodes while inserting value.) 大多数操作较慢。(在插入值时,由于平衡节点,它稍微慢一些。) |
| Best use 最佳用途 | When the order of elements is not important, and faster performance is needed. 当元素顺序不重要且需要更快性能时。 | When the order of elements is important, and the elements need to be in a specific order. 当元素顺序重要且元素需要按特定顺序排列时。 |
Overall, the choice between HashSet and TreeSet depends on the specific requirements of your application. If your application needs to store a large number of unsorted elements and performance is a concern, you should use HashSet. But if your application needs a sorted set and the required specific ordering, TreeSet would be a better choice.
总的来说,在 HashSet 和 TreeSet 之间的选择取决于应用程序的具体需求。如果您的应用程序需要存储大量未排序的元素,并且性能是关注点,则应使用 HashSet。但如果您的应用程序需要排序集合,并且需要特定的顺序,则 TreeSet 将是更好的选择。
188. What are the differences between static and dynamic linking?
静态链接和动态链接有什么区别?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5bba | 官方: 否 | 付费: 否
答案:
In computer programming, the terms "static linking" and "dynamic linking" refer to the process of linking together the code of a program with the code of a library.
在计算机编程中,术语“静态链接”和“动态链接”指的是将程序代码与库代码链接在一起的过程。
| Feature 特性 | Static Linking 静态链接 | Dynamic Linking 动态链接 |
|---|---|---|
| Definition 定义 | Linking the object files of a program at compile-time. 在编译时将程序的对象文件链接在一起。 | Linking the object files of a program at run-time. 在运行时将程序的对象文件链接在一起。 |
| Execution time 执行时间 | Linking occurs at the time of compilation. 链接发生在编译时。 | Linking occurs at the time of execution. 链接发生在执行时。 |
| Size of an executable file 可执行文件的大小 | The size of the executable file is larger. (It is larger because Linking combines multiple object files into a single executable file by resolving external references, increasing the size of the final executable file.) 可执行文件的大小更大。(因为它更大,因为链接通过解析外部引用将多个对象文件组合成单个可执行文件,从而增加了最终可执行文件的大小。) | The size of the executable file is smaller. (Dynamic linking occurs at runtime by sharing common libraries among multiple executables, resulting in a smaller executable file size.) 可执行文件的大小更小。(动态链接通过在多个可执行文件之间共享公共库,在运行时进行,从而导致更小的可执行文件大小。) |
| Libraries 库 | Libraries are included in the executable file. 库包含在可执行文件中。 | Libraries are linked at runtime and are separate from the executable file. 库在运行时链接,并与可执行文件分离。 |
| Updating 更新 | Updating the libraries requires the program to be recompiled. 更新库需要重新编译程序。 | Updating the libraries does not require the program to be recompiled. 更新库不需要重新编译程序。 |
| Memory 内存 | More memory is required at runtime. 运行时需要更多内存。 | Less memory is required at runtime. 运行时需要较少内存。 |
| Portability 可移植性 | Not portable between different operating systems. Static linking binds libraries to the executable file, resulting in platform-specific dependencies that may not be compatible with different operating systems. 在不同操作系统之间不可移植。静态链接将库绑定到可执行文件,导致平台相关的依赖,可能不与不同的操作系统兼容。 | Portable between different operating systems. Dynamic linking allows multiple executables to share a common library at runtime, making it more portable between different operating systems. 在不同操作系统之间可移植。动态链接允许多个可执行文件在运行时共享一个公共库,使其在不同操作系统之间更具可移植性。 |
| Best use 最佳用途 | When the program is going to be used on a single system. 当程序将在单个系统上使用时。 | When the program needs to be portable and the libraries are updated frequently. 当程序需要可移植且库频繁更新时。 |
The choice between static and dynamic linking will depend on the specific requirements of the project and the environment in which the program will be run.
在静态链接和动态链接之间的选择将取决于项目的具体需求以及程序运行的环境。
189. What is the difference between smoke testing and ad-hoc testing?
冒烟测试和临时测试有什么区别?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5bc0 | 官方: 否 | 付费: 否
答案:
Smoke testing and ad-hoc testing are both types of testing that are used to validate the functionality and stability of a software application. However, there are some key differences between the two:
冒烟测试和临时测试都是用于验证软件应用程序的功能和稳定性的测试类型。然而,两者之间存在一些关键区别:
| Feature 特性 | Smoke Testing 冒烟测试 | Ad-hoc Testing 临时测试 |
|---|---|---|
| Definition 定义 | A minimal test to establish that the most crucial functions of the software work, but not bothering with finer details. 一个最小化测试,以确认软件最关键的功能正常,但不关注细节。 | An informal testing method used to verify the functionality of the application. 一种非正式的测试方法,用于验证应用的功能。 |
| Time 时间 | It is done at the early stages of the development process. 在开发过程的早期阶段进行。 | It can be done at any stage of the development process. 可以在开发过程的任何阶段进行。 |
| Purpose 目的 | To ensure that the basic functionality of the application is working. 确保应用的基本功能正常工作。 | To find defects that are missed during formal testing. 找出正式测试中遗漏的缺陷。 |
| Scope 范围 | Limited scope, testing only the most critical functionality. 范围有限,只测试最关键的功能。 | Wide scope, testing any functionality that is found. 范围广泛,测试任何发现的功能。 |
| Test cases 测试用例 | Pre-defined test cases. 预定义的测试用例。 | No specific test cases, the tester can use any test method. 没有特定的测试用例,测试人员可以使用任何测试方法。 |
| Planning 规划 | It is planned and executed. 有计划且执行。 | It is unplanned and executed. 无计划且执行。 |
| Resources 资源 | Fewer resources are required such as time, manpower, and equipment, compared to ad-hoc testing. 与临时测试相比,需要的资源较少,如时间、人力和设备。 | More resources are required such as time, manpower, and equipment, as it involves unplanned and unstructured testing activities that are often performed without any specific test plan or test script. 需要更多资源,如时间、人力和设备,因为它涉及无计划和无结构的测试活动,通常在没有特定测试计划或测试脚本的情况下进行。 |
| Best use 最佳用途 | When the application is at the early stages of development and the functionality is not yet well-defined. 当应用处于开发早期阶段,功能尚未明确定义时。 | When the application is at a later stage of development and the functionality is well-defined. 当应用处于开发后期阶段,功能已明确时。 |
190. What are the types of testing available?
可用的测试类型有哪些?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5bc6 | 官方: 否 | 付费: 否
答案:
Testing a web application is a multi-step process that involves several types of testing, such as functional testing, performance testing, and security testing, among others. Here are some general steps that can be used to test a web application:
测试一个Web应用是一个多步骤的过程,涉及几种类型的测试,如功能测试、性能测试和安全测试等。以下是一些可用于测试Web应用的一般步骤:
Functional testing: This type of testing is used to verify that the application functions correctly and that all its features are working as expected. Functional testing can include tasks such as testing the application's user interface, testing its data validation and error handling, and testing its integration with other systems. 2. Performance testing: This type of testing is used to measure how well the application performs under various conditions, such as different levels of load or different network conditions. Performance testing can include tasks such as load testing, stress testing, and scalability testing. 3. Security testing: This type of testing is used to assess the application's security posture and identify any vulnerabilities that could be exploited by attackers. Security testing can include tasks such as penetration testing, vulnerability scanning, and security compliance testing. 4. Usability testing: This type of testing is used to evaluate how easy the application is to use, understand, and navigate. Usability testing can include tasks such as testing the application's user interface, testing its help and documentation, and testing its accessibility. 5. Compatibility testing: This type of testing is used to evaluate how well the application works on different platforms, browsers, and devices. Compatibility testing can include tasks such as testing the application on different operating systems, testing its compatibility with different web browsers, and testing its mobile responsiveness. 6. Exploratory testing: This is an informal type of testing where the tester can freely explore the application and learn more about it while testing the application. This is useful when testing new features or new applications. 7. Acceptance testing: This is the final step of the testing process, usually done by the customer or the end-user of the application, to confirm that the application satisfies their requirement and is ready for deployment.
- 功能测试:这种类型的测试用于验证应用功能是否正确,以及所有特性是否按预期工作。功能测试可以包括测试应用的用户界面、数据验证和错误处理,以及与其他系统的集成。2. 性能测试:这种类型的测试用于衡量应用在不同条件下的性能,如不同负载水平或不同网络条件。性能测试可以包括负载测试、压力测试和可扩展性测试。3. 安全测试:这种类型的测试用于评估应用的安全状况,并识别攻击者可能利用的漏洞。安全测试可以包括渗透测试、漏洞扫描和安全合规性测试。4. 可用性测试:这种类型的测试用于评估应用的易用性、易理解性和导航的难易程度。可用性测试可以包括测试应用的用户界面、帮助和文档,以及可访问性。5. 兼容性测试:这种类型的测试用于评估应用在不同平台、浏览器和设备上的运行效果。兼容性测试可以包括测试不同操作系统上的应用、不同Web浏览器的兼容性以及移动端响应性。6. 探索性测试:这是一种非正式的测试类型,测试人员可以在测试应用的同时自由探索应用并了解更多信息。这在测试新功能或新应用时很有用。7. 验收测试:这是测试过程的最后一步,通常由客户或最终用户执行,以确认应用满足他们的需求并准备好部署。
It is important to note that the steps and test cases will vary depending on the application and its purpose. To create a comprehensive test plan it's important to understand the requirements and the expected behavior of the system, as well as the context in which the application will be used.
请注意,步骤和测试用例会根据应用及其目的而有所不同。要创建全面的测试计划,重要的是了解需求、系统的预期行为以及应用的使用环境。
191. If you have opened any broken web application, it has changed its layout. What type of testing will you perform to check this?
如果你打开了一个坏的Web应用,其布局发生了变化。你将执行哪种类型的测试来检查这个问题?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5bc9 | 官方: 否 | 付费: 否
答案:
If a web application's layout is broken, it could indicate that there is an issue with the application's code or the way it is being rendered in the browser. To test this, you would perform a type of testing called layout or visual testing.
如果Web应用的布局损坏,可能表明应用代码或其渲染方式存在问题。要测试这一点,你将执行一种称为布局测试或视觉测试的测试类型。
The layout or visual testing is used to check the visual appearance of an application, including its layout, images, and other visual elements. This type of testing is typically done by comparing the current appearance of the application with a reference, or "golden" version of the application. This comparison can be done manually or with the use of automated testing tools that can compare screenshots of the application with the reference version.
布局或视觉测试用于检查应用的视觉外观,包括布局、图像和其他视觉元素。这种类型的测试通常通过将当前应用外观与参考版本(或“黄金”版本)进行比较来完成。这种比较可以手动进行,或使用自动化测试工具,这些工具可以比较应用的截图与参考版本。
Here are the general steps for performing layout testing:
以下是执行布局测试的一般步骤:
Obtain a reference version of the application: This is a version of the application that has been verified to have the correct layout and visual appearance. 2. Take screenshots of the application under test: These screenshots can be taken manually or using automated testing tools, such as Selenium or Appium. 3. Compare the screenshots with the reference version: This can be done manually, by visually inspecting the screenshots, or by using automated comparison tools, such as visual regression testing tools. 4. Identify and report any layout issues: If there are any discrepancies between the current version of the application and the reference version, they should be identified and reported. 5. Test the application on multiple browsers and devices: It's important to test the web application on different browsers and devices to make sure the layout will look consistent in all of them, as different browsers have different ways of rendering the layout, like different CSS and JavaScript engines.
- 获取应用的参考版本:这是一个已验证具有正确布局和视觉外观的应用版本。2. 拍摄被测应用的截图:这些截图可以手动拍摄,或使用自动化测试工具,如 Selenium 或 Appium。3. 将截图与参考版本进行比较:这可以手动进行,通过目视检查截图,或使用自动化比较工具,如视觉回归测试工具。4. 识别并报告任何布局问题:如果当前版本应用与参考版本之间存在任何差异,应识别并报告。5. 在多个浏览器和设备上测试应用:在测试Web应用时,重要的是在不同浏览器和设备上测试,以确保布局在所有环境中一致,因为不同浏览器有不同渲染布局的方式,如不同的CSS和JavaScript引擎。
It's worth noting that this type of testing should be combined with other types of testing such as functional testing, to ensure that the application not only looks good but also works correctly. Additionally, this testing can be done as part of Continuous Integration (CI) to avoid regressions and to catch the issues early in the development process.
需要注意的是,这种类型的测试应与其他类型的测试(如功能测试)结合进行,以确保应用不仅外观好,而且功能正确。此外,这种测试可以作为持续集成(CI)的一部分进行,以避免回归问题并在开发过程中早期发现问题。
192. What is an abstract method?
什么是抽象方法?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5bd2 | 官方: 否 | 付费: 否
答案:
An abstract class is a class that contains one or more abstract methods and can't be instantiated. It is intended to be used as a base class, and any class derived from it must provide an implementation for the abstract methods inherited.
抽象类是一个包含一个或多个抽象方法且不能被实例化的类。它旨在用作基类,任何从它派生的类都必须为继承的抽象方法提供实现。
An interface is a class that contains only abstract methods, by convention it doesn't have any data members, and can't be instantiated.
接口是一个只包含抽象方法的类,按照惯例,它没有任何数据成员,且不能被实例化。
An abstract method is a placeholder for a method, and any class that implements the abstract class or interface must provide an implementation for the abstract method. This is useful for creating a common interface for a set of related classes.
抽象方法是方法的占位符,任何实现抽象类或接口的类都必须为抽象方法提供实现。这对于为一组相关类创建公共接口很有用。
When an object of a derived class is instantiated, the derived class's implementation of the abstract method is called, allowing for polymorphism and code reuse.
当派生类的对象被实例化时,会调用派生类对抽象方法的实现,从而实现多态性和代码重用。
In C++, an abstract method is a member function of an abstract class or an interface that has no implementation. The = 0 syntax is used to indicate that a method is abstract, as in this example:
在C++中,抽象方法是抽象类或接口中没有实现的成员函数。= 0 语法用于指示方法是抽象的,如下例所示:
class Shape {
class Shape {
public:
public:
virtual double area() = 0;
virtual double area() = 0;
virtual double perimeter() = 0;
virtual double perimeter() = 0;
};
Here, area and perimeter are abstract methods of the Shape class because they have no implementation and are marked as pure virtual functions by the = 0 syntax.
在这里,area 和 perimeter 是 Shape 类的抽象方法,因为它们没有实现,并通过 = 0 语法被标记为纯虚函数。
193. Are you familiar with ISO?
你熟悉ISO吗?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5be0 | 官方: 否 | 付费: 否
答案:
Yes, I am familiar with ISO (International Organization for Standardization). It's an international standard-setting body composed of representatives from various national standards organizations. The organization develops and publishes international standards for a wide range of products, services, and systems, including but not limited to technology and mechanical engineering, food safety, agriculture, and healthcare.
是的,我熟悉ISO(国际标准化组织)。它是一个由来自各国家标准组织的代表组成的国际标准制定机构。该组织为广泛的产品、服务及系统制定和发布国际标准,包括但不限于技术和机械工程、食品安全、农业和医疗保健。
ISO standards provide a common framework for companies and organizations worldwide to ensure that products, services, and systems are safe, reliable, and of good quality. Compliance with ISO standards can also help companies and organizations access new markets and improve their competitiveness.
ISO标准为全球公司和组织提供了一个共同框架,以确保产品、服务和系统安全、可靠且质量良好。遵守ISO标准还可以帮助公司和组织进入新市场并提高竞争力。
ISO's standards are voluntary and not legally binding, but they are widely adopted and respected around the world. Many countries have their own national standards organizations that are affiliated with ISO and that work to adopt and implement ISO standards in their own countries.
ISO的标准是自愿的,不具有法律约束力,但它们在全世界被广泛采用和尊重。许多国家都有自己的国家标准组织,这些组织隶属于ISO,并致力于在本国采纳和实施ISO标准。
194. What is troubleshooting?
什么是故障排查?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5be3 | 官方: 否 | 付费: 否
答案:
Troubleshooting is the process of identifying and resolving problems or issues with a system, device, or component. It involves a systematic approach to finding the cause of a problem and then implementing a solution to fix it. The goal of troubleshooting is to quickly and efficiently identify and correct problems to minimize downtime or disruption to normal operations.
故障排查是识别并解决系统、设备或组件问题的过程。它涉及系统地寻找问题原因,然后实施解决方案来修复问题。故障排查的目标是快速且高效地识别和纠正问题,以最小化对正常操作的停机时间或干扰。
The troubleshooting process typically involves the following steps:
故障排查过程通常包括以下步骤:
Identify the problem: The first step in troubleshooting is to identify the problem or symptom. This may involve gathering information from users, reviewing error logs, or performing diagnostic tests. 2. Gather information: After the problem has been identified, gather as much information as possible about the system, device, or component that is experiencing the problem. This may include details about the configuration, the operating environment, and any recent changes or updates that have been made. 3. Isolate the problem: Once enough information has been gathered, use that information to isolate the problem to a specific component or system. Eliminating possibilities to find the root cause. 4. Test possible solutions: With the problem isolated, test possible solutions to see which one resolves the issue. 5. Implement the solution: Once a solution has been identified and tested, implement it to resolve the problem. This may involve updating software, replacing hardware, or making configuration changes. 6. Verify and validate: After the solution has been implemented, verify that the problem has been resolved and that the system, device, or component is operating correctly. 7. Document the process and the solution: Keeping detailed documentation of the troubleshooting process can help identify patterns or common issues and prevent them in the future. It also helps other troubleshooters to understand how the problem was solved and how to prevent it.Troubleshooting can be complex and time-consuming, but by following a systematic approach, it is possible to quickly identify and resolve problems with a system, device, or component.
- 识别问题:故障排查的第一步是识别问题或症状。这可能涉及从用户处收集信息、审查错误日志或执行诊断测试。 2. 收集信息:在问题被识别后,尽可能多地收集关于遇到问题的系统、设备或组件的信息。这可能包括配置细节、操作环境以及最近所做的更改或更新。 3. 隔离问题:收集足够信息后,利用这些信息将问题隔离到特定组件或系统。排除可能性以找到根本原因。 4. 测试可能的解决方案:在问题被隔离后,测试可能的解决方案以确定哪一个能解决问题。 5. 实施方案:在识别并测试解决方案后,实施它以解决问题。这可能涉及更新软件、更换硬件或进行配置更改。 6. 验证和确认:在实施方案后,验证问题已解决,且系统、设备或组件操作正常。 7. 记录过程和解决方案:保持详细故障排查文档有助于识别模式或常见问题并防止未来发生。它还能帮助其他故障排查者理解问题是如何解决的以及如何预防。故障排查可能复杂且耗时,但通过遵循系统方法,可以快速识别和解决系统、设备或组件的问题。
195. What does the @SpringBootApplication annotation do internally?
@SpringBootApplication 注解在内部做了什么?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5be6 | 官方: 否 | 付费: 否
答案:
@SpringBootApplication is a convenient annotation provided by Spring Boot that is used to enable several features in a Spring application.
@SpringBootApplication 是Spring Boot提供的一个便捷注解,用于在Spring应用中启用多个功能。
Internally, it is a combination of three other annotations:
在内部,它是三个其他注解的组合:
@SpringBootConfiguration: This annotation is used to indicate that a class is a configuration class for a Spring Boot application. It is equivalent to the @Configuration annotation from Spring Framework. It tells the Spring framework that this class contains beans that need to be managed by the Spring container. 2. @EnableAutoConfiguration: This annotation is used to enable auto-configuration for a Spring Boot application. Auto-configuration is a feature of Spring Boot that automatically configures certain beans based on the dependencies that are present in the classpath. For example, if Spring Data JPA is on the classpath, @EnableAutoConfiguration will automatically configure a DataSource and EntityManagerFactory. 3. @ComponentScan: This annotation is used to enable component scanning in a Spring Boot application. Component scanning is a feature of Spring that automatically detects and registers beans that are annotated with @Component, @Service, @Repository, and other related annotations. It tells the Spring framework to search for other components, configurations, and services in the package, allowing it to automatically discover beans and register them.
- @SpringBootConfiguration:此注解用于指示一个类是Spring Boot应用程序的配置类。它相当于Spring框架中的@Configuration注解。它告诉Spring框架,该类包含需要由Spring容器管理的Bean。 2. @EnableAutoConfiguration:此注解用于启用Spring Boot应用程序的自动配置。自动配置是Spring Boot的一项功能,它根据类路径中存在的依赖项自动配置某些Bean。例如,如果类路径中有Spring Data JPA,@EnableAutoConfiguration将自动配置DataSource和EntityManagerFactory。 3. @ComponentScan:此注解用于在Spring Boot应用程序中启用组件扫描。组件扫描是Spring的一项功能,可自动检测并注册带有@Component、@Service、@Repository和其他相关注解的Bean。它告诉Spring框架在包中搜索其他组件、配置和服务,使其能够自动发现Bean并注册它们。
In summary, @SpringBootApplication is a convenient annotation that enables several features of Spring Boot, like auto-configuration, component scanning, and making the class a configuration class for Spring Boot as shown in the image below:
总之,@SpringBootApplication是一个便捷注解,它启用了Spring Boot的多项功能,如自动配置、组件扫描,并使该类成为Spring Boot的配置类,如下图所示:
196. What is Dependency Injection?
什么是依赖注入?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5bea | 官方: 否 | 付费: 否
答案:
Dependency injection (DI) is a design pattern and software development technique in which a component (or "client") is given its dependencies, rather than creating them itself. The goal of dependency injection is to decouple the client from the implementation of its dependencies, making the client code more flexible and easier to test, understand, and maintain.
依赖注入(DI)是一种设计模式和软件开发技术,其中组件(或“客户端”)获得其依赖项,而不是自行创建它们。依赖注入的目标是将客户端与其依赖项的实现解耦,使客户端代码更灵活,更易于测试、理解和维护。
There are several ways to perform dependency injection in Java, including: - Constructor injection: Dependencies are passed to the client as arguments to the constructor. This is considered the preferred method of performing dependency injection in Java, as it ensures that the client is in a valid state immediately after construction.
在Java中有多种执行依赖注入的方法,包括:- 构造函数注入:依赖项作为构造函数的参数传递给客户端。这被认为是Java中执行依赖注入的首选方法,因为它确保客户端在构造后立即处于有效状态。
- Setter injection: Dependencies are passed to the client through setter methods. This method can be used when the client has optional dependencies or when the client's state needs to be changed after it has been constructed.
- Interface injection: Dependencies are passed to the client through an interface. This method is less common but can be useful when the client needs to be configurable in a more general way.
Field injection: Dependencies are assigned to the client's fields directly. This is considered the least preferred method of performing dependency injection, as it can make it harder to understand and maintain the client's state.
Dependency injection frameworks such as Spring or Google Guice can be used to automate the process of injecting dependencies, which can help to make the code more maintainable, testable, and readable. They also provide a way to configure the dependencies centrally and easily.可以使用诸如Spring或Google Guice之类的依赖注入框架来自动化注入依赖项的过程,这有助于使代码更易于维护、测试和阅读。它们还提供了一种集中且轻松地配置依赖项的方式。
By using dependency injection, classes can be designed with single responsibilities, making the code more testable and maintainable, and also increasing code reusability. Dependency injection also can be used to reduce tightly coupled classes, making the
通过使用依赖注入,类可以设计为具有单一职责,使代码更易于测试和维护,并提高代码复用性。依赖注入还可用于减少紧密耦合的类,使
197. List the most commonly used instructions in Dockerfile?
列出Dockerfile中最常用的指令?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5bf0 | 官方: 否 | 付费: 否
答案:
A Dockerfile is a script that contains a set of instructions for building a Docker image. The most commonly used instructions in a Dockerfile include: - FROM: This instruction sets the base image for the image being built. It is the first instruction that must appear in a Dockerfile. For example,
Dockerfile是一个脚本,其中包含一组用于构建Docker镜像的指令。Dockerfile中最常用的指令包括:- FROM:此指令为正在构建的镜像设置基础镜像。它是Dockerfile中必须出现的第一条指令。例如,
FROM alpine
FROM alpine
Or
FROM python:3.8-alpine
FROM python:3.8-alpine
The "FROM alpine" Docker command pulls the latest version of the Alpine Linux operating system image from Docker Hub and sets it as the base image for the Dockerfile, while the "FROM python:3.8-alpine" command pulls the latest version of the Python 3.8 image based on Alpine Linux and sets it as the base image for the Dockerfile. - RUN: This instruction is used to execute commands during the build process. It creates a new layer in the image and commits the result. For example,
“FROM alpine”Docker命令从Docker Hub拉取Alpine Linux操作系统镜像的最新版本,并将其设置为Dockerfile的基础镜像,而“FROM python:3.8-alpine”命令拉取基于Alpine Linux的Python 3.8镜像的最新版本,并将其设置为Dockerfile的基础镜像。- RUN:此指令用于在构建过程中执行命令。它在镜像中创建一个新层并提交结果。例如,
RUN apk add --no-cache curl
RUN apk add --no-cache curl
This command installs the curl package in the Docker container, which allows the container to make HTTP requests to other servers or APIs. The "--no-cache" option ensures that no cache is stored in the container after the package installation, reducing the size of the container. - COPY: This instruction is used to copy files from the host system to the container's filesystem. For example,
此命令在Docker容器中安装curl包,使容器能够向其他服务器或API发出HTTP请求。“--no-cache”选项确保包安装后容器中不存储缓存,从而减小容器的大小。- COPY:此指令用于将文件从主机系统复制到容器的文件系统中。例如,
COPY ./app
COPY ./app
The command copies the "app" directory from the host machine to the Docker container, allowing the containerized application to access the application code or configuration files. - ENV: This instruction sets environment variables in the image. For example,
该命令将主机上的“app”目录复制到Docker容器中,使容器化应用程序能够访问应用程序代码或配置文件。 - ENV:该指令在映像中设置环境变量。例如,
ENV PORT 8080
ENV PORT 8080
The "ENV PORT 8080" command sets an environment variable named "PORT" with a value of 8080 in a Docker container. - EXPOSE: This instruction tells Docker which ports should be exposed by the container. For example,
“ENV PORT 8080”命令在Docker容器中设置一个名为“PORT”且值为8080的环境变量。 - EXPOSE:该指令告知Docker容器应暴露哪些端口。例如,
EXPOSE 8080
EXPOSE 8080
The "EXPOSE 8080" command exposes the container's network port 8080 to allow external access to the application running inside the container. - CMD: This instruction sets the command that will be executed when a container is run from the image. For example,
“EXPOSE 8080”命令暴露容器的网络端口8080,以允许外部访问容器内运行的应用程序。 - CMD:该指令设置从映像运行容器时将执行的命令。例如,
CMD ["python", "app.py"]
CMD ["python", "app.py"]
This command specifies the default command to be executed when a container starts running, which is to run the "app.py" script using the Python interpreter inside the container.
此命令指定容器启动运行时要执行的默认命令,即在容器内使用Python解释器运行“app.py”脚本。
ENTRYPOINT: This instruction sets the command that will be executed when a container is run from the image, but unlike CMD it can't be overridden. It is often used to set a default command and parameters for an image. 2. LABEL: This instruction allows you to add key-value pairs to an image, it can be useful for providing information about the image, the maintainer, and other useful metadata. 3. USER: This instruction sets the UID (user ID) or username that will run the container. 4. WORKDIR: This instruction sets the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD instructions that follow it in the Dockerfile. For example, WORKDIR /app. 5. ADD: This instruction allows you to add files or directories from the host machine to the container. It also supports URLs and remote file systems. 6. VOLUME: This instruction creates a mount point with the specified name and marks it as holding externally mounted volumes from the native host or other containers. For example, VOLUME /data 7. ARG: This instruction allows you to pass variables to the Dockerfile during build time. You can use ARG to define environment-specific variables, such as a version number or a file path. 8. STOP SIGNAL: This instruction allows you to configure the system call signal that will be sent to the container to exit. 9. ONBUILD: This instruction adds a trigger instruction when the image is used as the base for another build.
- ENTRYPOINT:该指令设置从映像运行容器时将执行的命令,但与CMD不同,它不能被覆盖。它通常用于为映像设置默认命令和参数。 2. LABEL:该指令允许向映像添加键值对,可用于提供有关映像、维护者以及其他有用元数据的信息。 3. USER:该指令设置运行容器的UID(用户ID)或用户名。 4. WORKDIR:该指令为Dockerfile中后续的RUN、CMD、ENTRYPOINT、COPY和ADD指令设置工作目录。例如,WORKDIR /app。 5. ADD:该指令允许将主机上的文件或目录添加到容器中。它还支持URL和远程文件系统。 6. VOLUME:该指令创建一个具有指定名称的挂载点,并将其标记为持有来自宿主机或其他容器的外部挂载卷。例如,VOLUME /data 7. ARG:该指令允许在构建期间向Dockerfile传递变量。您可以使用ARG定义特定于环境的变量,例如版本号或文件路径。 8. STOP SIGNAL:该指令允许配置要发送到容器以退出的系统调用信号。 9. ONBUILD:该指令在映像用作另一个构建的基础时添加触发指令。
Consider the below example summary for all the commands listed above:
请考虑下面针对上述所有命令的示例总结:
This Dockerfile instruction sets the base image to Alpine Linux version 3.15 for building a containerized application.
FROM alpine:3.15
FROM alpine:3.15
This line sets the environment variable "APP_HOME" to the directory "/usr/src/app".
ENV APP_HOME /usr/src/app
ENV APP_HOME /usr/src/app
This command sets the working directory for subsequent commands in a Dockerfile to $APP_HOME.
WORKDIR $APP_HOME
WORKDIR $APP_HOME
These two lines copy the "requirements.txt" file and the "app.py" file from the current directory to the specified directory, which is represented by the variable $APP_HOME.
COPY requirements.txt $APP_HOME
COPY requirements.txt $APP_HOME
COPY app.py $APP_HOME
COPY app.py $APP_HOME
This command installs Python 3 and upgrades pip, then uses pip to install the packages listed in the requirements.txt file, all while using the --no-cache option to prevent caching of the packages.
RUN apk add --no-cache python3 && \
RUN apk add --no-cache python3 && \
pip3 install --upgrade pip && \
pip3 install --upgrade pip && \
pip3 install -r requirements.txt
pip3 install -r requirements.txt
Exposing port 8080 allows network traffic to be directed to the service/application listening on that port.
EXPOSE 8080
EXPOSE 8080
Set the user
USER nobody
USER nobody
This Docker command creates a mount point for the "/data" directory inside the container.
VOLUME /data
VOLUME /data
This Docker command sets a build version for an image and adds a label with the same build version to the image.
ARG build_version=1.0
ARG build_version=1.0
LABEL build_version=$build_version
LABEL build_version=$build_version
This Docker command sets the entrypoint of the Docker container to run the Python script "app.py" when the container is started.
ENTRYPOINT ["python3", "app.py"]
ENTRYPOINT ["python3", "app.py"]
This Docker command sets the default command to run the container with the argument "--config" and the value "config.yaml".
CMD ["--config", "config.yaml"]
CMD ["--config", "config.yaml"]
The "STOPSIGNAL SIGTERM" command in Dockerfile sets the signal that will be sent to the container to stop running when Docker needs to shut it down.
STOPSIGNAL SIGTERM
STOPSIGNAL SIGTERM
This Docker command sets a trigger instruction that will copy the contents of the "$APP_HOME" directory into the image being built when another image is built from it as a base image.
ONBUILD COPY. $APP_HOME
ONBUILD COPY. $APP_HOME
This Docker command adds the file "file.tar.gz" from "https://example.com" to the "/tmp" directory inside the Docker container.
ADD https://example.com/file.tar.gz /tmp/file.tar.gz
ADD https://example.com/file.tar.gz /tmp/file.tar.gz
This Docker command sets the email address of the image maintainer to "myemail@example.com".
LABEL maintainer="myemail@example.com"
LABEL maintainer="myemail@example.com"
These are the most commonly used instructions in a Dockerfile, but the list is not exhaustive, and you can find more instructions and uses depending on your use case. Using a combination of these instructions, you can create a comprehensive Dockerfile that fully describes an image and its dependencies.
这些是Dockerfile中最常用的指令,但列表并非详尽无遗,你可以根据具体用例找到更多指令和用法。通过组合这些指令,你可以创建一份全面的Dockerfile,完整描述一个镜像及其依赖项。
198. What is a mesh? How can you analyze it?
什么是网格?如何分析它?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5bf9 | 官方: 否 | 付费: 否
答案:
A mesh is a collection of vertices, edges, and faces that define the shape of an object in 3D computer graphics. It is a fundamental concept in Computer-Aided Design (CAD), Computer-Aided Manufacturing (CAM), and computer graphics.
网格是3D计算机图形中定义物体形状的顶点、边和面的集合。它是计算机辅助设计(CAD)、计算机辅助制造(CAM)和计算机图形学中的基本概念。
A mesh is typically represented as a collection of interconnected triangles. Each vertex of the mesh is defined by a set of 3D coordinates, and each edge is defined by the two vertices that it connects. The faces of the mesh are defined by the set of edges that bound them.
网格通常表示为相互连接的三角形的集合。网格的每个顶点由一组三维坐标定义,每条边由其连接的两个顶点定义。网格的面由界定它们的边集定义。
The below image shows what are the vertices, edges, faces, polygons, and surfaces-
下图展示了顶点、边、面、多边形和曲面分别是什么-
There are different ways to analyze a mesh depending on the application or what you are trying to achieve with it. Some examples include:
根据应用场景或你希望达到的目标,有多种不同的网格分析方法。一些例子包括:
Image References: Wikipedia - Measuring the surface area and volume of the mesh.
图片来源:维基百科 - 测量网格的表面积和体积。
- Identifying and removing any non-manifold edges or faces (i.e. edges or faces that are not part of a single, closed surface).
- Identifying and removing any self-intersecting faces.
- Identifying and removing any duplicate vertices.
- Identifying and removing any "degenerate" triangles (i.e. triangles with a very small area or with three collinear vertices).
- Measuring the curvature, smoothness, and other geometrical parameters of the mesh.
- Analyzing the topology of the mesh, such as identifying the number of connected components, holes, or handles.
- Simplifying the mesh by reducing the number of vertices and faces while preserving the overall shape of the object.
Subdividing the mesh to increase the resolution or to add more details to the object.
These are just a few examples of the many ways that a mesh can be analyzed. The specific steps and techniques used will depend on the application and the goals of the analysis.这些只是网格多种分析方法中的少数几个例子。具体步骤和技术将取决于应用场景和分析目标。
199. Tell me something about Autodesk 3ds Max.
请告诉我一些关于 Autodesk 3ds Max 的信息。
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5bfc | 官方: 否 | 付费: 否
答案:
- What is Autodesk 3ds, Max?Autodesk 3ds Max is a professional 3D modeling, animation, and rendering software used in industries such as architecture, interior design, gaming, and film.
What types of files can be imported into 3ds Max?3ds Max supports a variety of file formats, including .fbx, .obj, .3ds, .dae, .dwg, and .stp.
- 哪些类型的文件可以导入到 3ds Max?3ds Max 支持多种文件格式,包括 .fbx、.obj、.3ds、.dae、.dwg 和 .stp。
What rendering options does 3ds Max offer?3ds Max offers several rendering options, including Mental Ray, Arnold, and V-Ray.
- 3ds Max 提供哪些渲染选项?3ds Max 提供多种渲染选项,包括 Mental Ray、Arnold 和 V-Ray。
200. What is Blender? What types of modeling does Blender support? Can Blender be used for game development?
什么是 Blender?Blender 支持哪些类型的建模?Blender 可以用于游戏开发吗?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5bff | 官方: 否 | 付费: 否
答案:
- Blender is a free and open-source 3D creation software used for modeling, animation, simulation, and rendering.
- Blender supports a variety of modeling techniques, including polygon modeling, sculpting, and curve modeling.
- Yes, Blender can be used for game development, with features such as the Blender Game Engine and support for exporting to popular game engines like Unity and Unreal.
201. What is ANSYS? What types of simulations can ANSYS perform? What industries commonly use ANSYS?
什么是 ANSYS?ANSYS 可以执行哪些类型的仿真?哪些行业通常使用 ANSYS?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5c02 | 官方: 否 | 付费: 否
答案:
- ANSYS is a suite of engineering simulation software used for designing and testing products in industries such as aerospace, automotive, and electronics.
- ANSYS can perform a wide range of simulations, including structural analysis, fluid dynamics, and electromagnetic simulations.
- ANSYS is commonly used in industries that require advanced simulation capabilities, such as aerospace, automotive, and medical devices.
202. Have you heard of SolidWorks? What types of design tools does SolidWorks offer? Can SolidWorks be used for simulation?
你听说过 SolidWorks 吗?SolidWorks 提供哪些类型的设计工具?SolidWorks 可以用于仿真吗?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5c05 | 官方: 否 | 付费: 否
答案:
- SolidWorks is a 3D CAD software used for designing products in industries such as manufacturing, engineering, and architecture.
- SolidWorks offers a variety of design tools, including sketching, parametric modeling, and assembly design.
- Yes, SolidWorks offers simulation tools for structural analysis, thermal analysis, and fluid flow analysis.
203. What difficulties do you encounter when building a 3D model?
在构建 3D 模型时,你会遇到哪些困难?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5c08 | 官方: 否 | 付费: 否
答案:
Creating 3D models can be a challenging process, but it is also incredibly rewarding. One of the biggest challenges I face when creating a 3D model is ensuring that all the details are accurate and realistic. This includes making sure that textures, lighting, and shadows are properly applied to create an image that looks as close to real life as possible. Another challenge I often encounter is finding ways to optimize my models for different platforms or applications.
创建 3D 模型可能是一个具有挑战性的过程,但也非常值得。我在创建 3D 模型时面临的最大挑战之一是确保所有细节都准确且逼真。这包括确保纹理、光照和阴影正确应用,以生成尽可能接近真实生活的图像。我经常遇到的另一个挑战是寻找针对不同平台或应用优化模型的方法。
For example, if I am creating a game asset, I need to make sure that the model is optimized for the engine so that it runs smoothly and efficiently. Finally, another challenge I frequently face is staying up-to-date with the latest industry trends and technologies. With new software and tools being released every day, it’s important to stay informed in order to remain competitive in the field.
例如,如果我在创建游戏资产,我需要确保模型针对引擎进行了优化,以便它能够流畅高效地运行。最后,我经常面对的另一个挑战是跟上最新的行业趋势和技术。随着每天都有新软件和工具发布,保持信息灵通以在该领域保持竞争力非常重要。
204. Can you tell me something about Autodesk Maya? What types of animations can be created with Maya? Can Maya be used for virtual reality and augmented reality?
你能告诉我一些关于 Autodesk Maya 的信息吗?Maya 可以创建哪些类型的动画?Maya 可以用于虚拟现实和增强现实吗?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5c0e | 官方: 否 | 付费: 否
答案:
- Autodesk Maya is a 3D animation, modeling, and rendering software used in industries such as film, gaming, and television.
- Maya offers a variety of animation tools, including keyframe animation, motion graphics, and character rigging.
- Yes, Maya can be used to create virtual reality and augmented reality experiences, with features such as the Maya Live Link plugin for real-time collaboration with game engines like Unity and Unreal.
205. What is COMSOL Multiphysics? What types of simulations can be performed with COMSOL Multiphysics?
什么是 COMSOL Multiphysics?使用 COMSOL Multiphysics 可以执行哪些类型的仿真?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5c11 | 官方: 否 | 付费: 否
答案:
COMSOL Multiphysics is a simulation software used for modeling and simulating physics-based systems in industries such as electrical engineering, fluid dynamics, and acoustics.
COMSOL Multiphysics 是一款仿真软件,用于在电气工程、流体动力学和声学等行业中对基于物理的系统进行建模和仿真。
COMSOL Multiphysics offers a wide range of simulation capabilities, including structural mechanics, heat transfer, and chemical reactions.
COMSOL Multiphysics 提供广泛的模拟功能,包括结构力学、热传递和化学反应。
206. What are your thoughts on VR and AR technology?
你对VR和AR技术有什么看法?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5c14 | 官方: 否 | 付费: 否
答案:
Virtual Reality (VR) and Augmented Reality (AR) technology are both rapidly advancing fields that have the potential to significantly impact a wide range of industries.
虚拟现实(VR)和增强现实(AR)技术都是快速发展的领域,有潜力显著影响广泛的行业。
Virtual Reality (VR) is a computer-generated simulation of a three-dimensional environment that can be explored and interacted with in a seemingly real or physical way by a person using a VR headset. It allows people to experience an immersive and realistic environment as if they were physically present in it. It can be used for gaming, entertainment, education, therapy, and even in some cases for training in dangerous or remote environments.
虚拟现实(VR)是一种计算机生成的三维环境模拟,用户通过VR头显可以以看似真实或物理的方式探索和交互。它让人们体验到沉浸式且逼真的环境,仿佛身临其境。它可用于游戏、娱乐、教育、治疗,甚至在某些情况下用于危险或远程环境的培训。
Augmented Reality (AR) on the other hand, is a technology that overlays digital information, such as images, videos, or sounds, on the real world in real-time. It can be used in a wide range of applications, such as gaming, education, navigation, and even in industrial settings to provide workers with real-time information and guidance while they complete tasks.
另一方面,增强现实(AR)是一种将数字信息(如图像、视频或声音)实时叠加到现实世界中的技术。它可用于广泛的应用,如游戏、教育、导航,甚至工业环境中,为工人提供实时信息和指导以完成任务。
Dassault Systemes Interview Preparation
207. Why do you want to join Dassault Systèmes?
你为什么想加入达索系统?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5c25 | 官方: 否 | 付费: 否
答案:
Sample Answer: “I am extremely excited about the opportunity to join Dassault Systèmes as a software engineer. The company's reputation for innovation and excellence in the field of 3D modelling and simulation software aligns perfectly with my passion for utilizing technology to drive progress and improve the world around us. I am confident that my skills and experience in software engineering, combined with the resources and support provided by Dassault Systèmes, will enable me to make a significant impact in this role. I am also eager to continue my professional development and grow with the company.”
示例回答:“我对能以软件工程师身份加入达索系统感到非常兴奋。公司在3D建模和模拟软件领域的创新和卓越声誉与我对利用技术推动进步和改善周围世界的热情完美契合。我相信,我的软件工程技能和经验,加上达索系统提供的资源和支持,将使我在这个角色中产生重大影响。我也渴望继续我的职业发展,并与公司一起成长。”
208. How long is the Interview Process at Dassault Systèmes?
达索系统的面试流程有多长?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5c28 | 官方: 否 | 付费: 否
答案:
The length of the interview process at Dassault Systèmes can vary depending on several factors such as the specific role you are applying for, the location of the office, and the number of candidates being considered.
达索系统的面试流程长度可能因多种因素而异,例如你申请的特定职位、办公室地点以及考虑中的候选人数量。
For software engineer positions, the interview process typically includes multiple rounds, such as online assessments, phone screens, technical interviews, and on-site interviews.
对于软件工程师职位,面试流程通常包括多轮,如在线评估、电话筛选、技术面试和现场面试。
Typically, the process for software engineer positions can take around 2-4 weeks , depending on the number of rounds and the availability of the candidates and interviewers.
通常,软件工程师职位的流程大约需要2-4周,具体取决于轮次数量和候选人及面试官的可用性。
It is also worth noting that the length of the interview process could be affected by the current state of the hiring market, the specific role you are applying for, and the demand for that role. Sometimes the process could be extended or shortened if the company needs more time to evaluate the candidates or if the position needs to be filled urgently.
还需注意,面试流程的长度可能受招聘市场现状、你申请的特定职位以及该职位的需求影响。有时,如果公司需要更多时间评估候选人,或者职位需要紧急填补,流程可能会延长或缩短。
209. How to get a job at Dassault Systèmes?
如何在达索系统获得工作?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5c2b | 官方: 否 | 付费: 否
答案:
Securing a job at Dassault Systèmes can be a challenging process, but here are some ways to help increase your chances:
在达索系统获得工作可能是一个具有挑战性的过程,但以下是一些方法可以帮助增加你的机会:
Visit the Dassault Systèmes Career page: The first step to getting a job at Dassault Systèmes is to visit the company's career page. Here, you can find all the current job openings and apply directly to the position that interests you. 2. Networking: Networking is a great way to get a job at Dassault Systèmes. Reach out to current employees or alumni of the company via LinkedIn, and ask for their advice and recommendations. 3. Use LinkedIn: LinkedIn is a powerful tool for job seekers, and it's a great way to connect with recruiters and hiring managers at Dassault Systèmes. Make sure your LinkedIn profile is up-to-date and highlights your relevant skills and experience. 4. Submit your resume: You can submit your resume directly to the company's recruitment team. Make sure to tailor your resume to the specific position you are applying for. 5. Reference: If you know someone who works at Dassault Systèmes, ask them to refer you. This can greatly increase your chances of getting an interview.
- 访问达索系统职业页面:在达索系统获得工作的第一步是访问公司的职业页面。在这里,你可以找到所有当前职位空缺,并直接申请你感兴趣的职位。2. 建立人脉:人脉是获得达索系统工作的好方法。通过LinkedIn联系现任员工或公司校友,并寻求他们的建议和推荐。3. 使用LinkedIn:LinkedIn是求职者的强大工具,也是与达索系统招聘人员和高管建立联系的好方法。确保你的LinkedIn个人资料是最新的,并突出相关技能和经验。4. 提交简历:你可以直接将简历提交给公司的招聘团队。请确保根据你申请的特定职位量身定制简历。5. 推荐人:如果你认识在达索系统工作的人,请他们推荐你。这可以大大增加你获得面试的机会。
Lastly, apply to the right job that matches your skill set and interests, and be prepared to go through the interview process with a positive attitude and a willingness to learn. Remember that the process can be competitive, but with the right skills, experience, and attitude, you can increase your chances of getting hired at Dassault Systèmes.
最后,申请与你技能和兴趣匹配的正确职位,并准备以积极态度和学习的意愿通过面试流程。请记住,这个过程可能竞争激烈,但凭借正确的技能、经验和态度,你可以增加在达索系统被录用的机会。
210. What is the salary for freshers in Dassault Systèmes?
达索系统的新人薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5c2e | 官方: 否 | 付费: 否
答案:
The salary for freshers at Dassault Systèmes can vary depending on the role they are applying for.
达索系统的新人薪资可能因申请的职位角色而异。
According to Ambitionbox, Entry-level positions such as QA Engineer and Software Developer typically have a starting salary range of around 7-9 Lakhs per year. The average Dassault Systèmes Software Engineer salary in India is ₹ 10.7 Lakhs for experience between 1 year to 8 years.
根据Ambitionbox的数据,入门级职位如QA工程师和软件开发人员的起薪范围通常在每年7-9万卢比左右。达索系统印度软件工程师的平均薪资为每年107万卢比,工作经验在1年至8年之间。
However, it's worth noting that the actual salary offered can depend on factors such as specific job responsibilities, location, and the candidate's qualifications and experience. It's also subject to change over time and can be impacted by factors such as cost of living, talent competition, and the company's financial performance.
然而,值得注意的是,实际提供的薪资可能取决于具体职位职责、地点以及候选人的资质和经验等因素。薪资也会随时间变化,并可能受到生活成本、人才竞争以及公司财务表现等因素的影响。
211. Is the Dassault Systèmes interview hard?
达索系统的面试难吗?
- 知识点: 其他/未分类 (标签: interviewbit, dassault-systemes, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 达索系统
- id: 69b37a5b58d557c902ba5c31 | 官方: 否 | 付费: 否
答案:
Dassault Systèmes is known to have a rigorous and challenging interview process, with a focus on coding and technical skills. The interview process may include a combination of coding challenges, technical discussions, and problem-solving exercises. Candidates should expect to be tested on their knowledge of core technologies, data structures, algorithms, and programming languages.
达索系统以严格且具有挑战性的面试流程而闻名,重点考察编码和技术技能。面试过程可能包括编码挑战、技术讨论和问题解决练习的组合。候选人应准备好接受对其核心技术知识、数据结构、算法和编程语言的测试。
It's not possible to say for certain whether the interview is "hard" or "easy" as it can vary depending on the position you are applying for, your background, and your experience. However, you should be prepared to demonstrate your knowledge and skills and to be able to explain your thought process and problem-solving approach.
不能确切地说面试是“难”还是“易”,因为这取决于你申请的职位、你的背景和你的经验。然而,你应该准备好展示你的知识和技能,并能够解释你的思维过程和问题解决方法。
One thing to consider is to practice coding challenges and problem-solving exercises, to familiarize yourself with the company's products and services, and to be confident while you are in the interview.
需要考虑的一件事是练习编码挑战和问题解决练习,熟悉公司的产品和服务,并在面试中保持自信。
Showing that you have done your research and have a genuine interest in the company and the role you are applying for can also make a good impression. Additionally, always be prepared to ask questions, show enthusiasm and try to explain your solution clearly.
展示你做了充分研究,并对公司和申请的职位有真正的兴趣,也能给人留下好印象。此外,始终准备好提问,表现出热情,并尝试清晰地解释你的解决方案。
212. State some design issues of a computer network.
阐述计算机网络的一些设计问题。
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba681b | 官方: 否 | 付费: 否
答案:
- Reliability-The channels through which the data flows can be unreliable, which is undesirable as it results in loss of data while transferring.
- Scalability-The network should be scalable as sometimes the network can become very large and with the evolution of new technologies, compatibility-related issues can also occur.
- Addressing-Because messages are transmitted between large numbers of senders and receivers, all the information about the senders and receivers should be available so the correct message can be delivered to the correct receiver.
- Error Control-Errors can occur while transferring a message due to various reasons, so both the senders as well as the receiver must agree upon using a standard error detection technique.
- Flow Control-The rate at which the data is sent by the sender should match the rate at which the receiver can receive it to avoid the loss of data.
- Security-Data communication needs to be protected against threats and falsely altered messages. So techniques such as authentication should be used to protect the data.
Useful Resources
有用资源
- QA Interview Questions
- C++ Interview Questions
- Java Interview Questions
- Data Engineer Interview Questions
- Software Engineering Interview Questions
- Front End Developer Interview Questions
- Technical Interview Questions
- Coding Interview Questions
- Interview Resources
- Programming- DSA
- Online Compiler
213. Values in a given range of elements
给定元素范围内的值
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba681e | 官方: 否 | 付费: 否
答案:
Problem Discussion:
问题讨论:
You will be given an array and two integers r1 and r2. You are required to find the count of the number of elements present in the given range of r1 and r2 i.e. r1 and r2 inclusive.
你将得到一个数组和两个整数r1和r2。你需要找出在r1和r2给定范围内(即包括r1和r2)存在的元素个数。
Note: The array given is unsorted.
注意:给定的数组是无序的。
For eg:
例如:
Array=[1, 3, 5, 2]
Array=[1, 3, 5, 2]
r1=1
r1=1
r2=5
r2=5
Output: 4
输出:4
Algorithm:
算法:
- An efficient way of solving this problem is to use binary search.
- First of all, sort the array to apply binary search
- We will apply the binary search for r1 to find its index.
- Similarly, apply the binary search for r2 to find its index
- Once you get both the indices, find the difference in r1 and r2 and add 1 to it to count the exact number of elements present in the given range.
Implementation:
实现:
include<bits/stdc++.h>
include
using namespace std;
using namespace std;
int loweridx(int arr[], int n, int x)
int loweridx(int arr[], int n, int x)
{
int left = 0, right = n - 1;
int left = 0, right = n - 1;
while (left <= right )
while (left <= right )
{
int mid = (left + right ) / 2;
int mid = (left + right ) / 2;
if (arr[mid] >= x)
if (arr[mid] >= x)
right = mid - 1;
right = mid - 1;
else
else
left = mid + 1;
left = mid + 1;
}
return left;
return left;
}
int higheridx(int arr[], int n, int y)
int higheridx(int arr[], int n, int y)
{
int left = 0, right = n - 1;
int left = 0, right = n - 1;
while (left <= right )
while (left <= right )
{
int mid = (left+ right ) / 2;
int mid = (left+ right ) / 2;
if (arr[mid] <= y)
if (arr[mid] <= y)
left = mid + 1;
left = mid + 1;
else
else
right = mid - 1;
right = mid - 1;
}
return right ;
return right;
}
int count_the_elements(int arr[], int n, int r1, int r2)
int count_the_elements(int arr[], int n, int r1, int r2)
{
int count = 0;
int count = 0;
count = higheridx(arr, n, r2) - loweridx(arr, n, r1) + 1;
count = higheridx(arr, n, r2) - loweridx(arr, n, r1) + 1;
return count;
return count;
}
int main()
int main()
{
int arr[] = {1,3,5,2 };
int arr[] = {1,3,5,2 };
int n = sizeof(arr) / sizeof(arr[0]);
int n = sizeof(arr) / sizeof(arr[0]);
sort(arr, arr + n);
sort(arr, arr + n);
int i = 1, j = 5;
int i = 1, j = 5;
cout << count_the_elements(arr, n, i, j) << endl;
cout << count_the_elements(arr, n, i, j) << endl;
}
Time and space analysis: - Time complexity: O(logN), where n is the number of elements in the array.
时间和空间分析:- 时间复杂度:O(logN),其中n是数组中的元素个数。
- Auxiliary complexity: O(1) because we have not used any extra space.
- Data Science
- All Events
- My Events
214. What does cycle stealing mean?
循环窃取是什么意思?
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba6821 | 官方: 否 | 付费: 否
答案:
- Using cycle stealing, which is a DMA transfer method, we can access Random Access Memory or the bus without interrupting the CPU or forcing the CPU to interrupt its operations.
- DMA controllers use cycle stealing to transfer one word at a time, then return control of buses back to the central processing unit.
- It is used by mainly slow devices and an example of a device that uses it is a keyboard.
215. What is a semaphore and what are its uses?
什么是信号量及其用途?
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba6824 | 官方: 否 | 付费: 否
答案:
- Semaphores are basically used to synchronise the processes and these are of 2 different types namely binary semaphore and counting semaphore.
- It is an integer variable that is shared by a lot of processes in a mutually exclusive manner.
Some of the uses of semaphores are:
In counting semaphores the values vary from -infinity to +infinity but in binary semaphores, only 0 and 1 are used which is its main advantage.在计数信号量中,值范围从负无穷到正无穷,但在二进制信号量中,仅使用0和1,这是其主要优势。
The need to check if a condition is met before allowing the process to access a critical section is eliminated, so no resources are wasted waiting in semaphores.
允许进程访问临界区前检查条件是否满足的需求被消除了,因此没有资源在信号量中等待而浪费。
The microkernel executes semaphores independent of the machine on which it's working. Therefore, they are independent of the hardware.
微内核独立于其所工作的机器执行信号量,因此它们与硬件无关。
216. Sort an array relatively.
相对地对一个数组进行排序。
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba682a | 官方: 否 | 付费: 否
答案:
Problem Discussion:
问题讨论:
You are given 2 arrays. All the elements of the second array are present in the first array, but the first array additionally contains elements that are not present in the second array.
给定两个数组。第二个数组的所有元素都存在于第一个数组中,但第一个数组还额外包含第二个数组中不存在的元素。
Note : All elements in the second array are distinct.
注意:第二个数组中的所有元素都是不同的。
You have to sort the elements of the first array so that all the elements come in the same order as the second array and elements of the first array that do not appear in the second array should be placed at the end of the first array in a sorted manner.
你必须对第一个数组的元素进行排序,使得所有元素按第二个数组的顺序排列,并且第一个数组中未出现在第二个数组中的元素应放在第一个数组的末尾,并按有序方式排列。
For eg:
例如:
Input:
输入:
Array1=[2, 1, 2, 5, 7, 1, 9, 3, 6, 8, 8
Array1=[2, 1, 2, 5, 7, 1, 9, 3, 6, 8, 8
Array2=[2, 1,8, 3]
Array2=[2, 1,8, 3]
Output:
输出:
2 2 1 1 8 8 3 5 6 7 9
Algorithm:
算法:
- We will use a map for solving this problem.
- First of all, fill all the elements of array1 in a map along with their frequencies i.e the number of times they are occurring.
- Then iterate over the second array and check whether the element is present in the map or not. If it is present then store it in a result and erase it from the map.
- At last, add the remaining elements of array1 into the result
Implementation:
实现:
vectorrelativeSortArray(vector & arr1, vector & arr2) {
vectorrelativeSortArray(vector & arr1, vector & arr2) {
vector
vectorresult;
map<int, int> interviewbit_map;
map<int, int> interviewbit_map;
for(auto a : arr1){
for(auto a : arr1){
interviewbit_map[a]++;
interviewbit_map[a]++;
}
for(auto a : arr2){
for(auto a : arr2){
if(interviewbit_map[a]){
if(interviewbit_map[a]){
int count = interviewbit_map[a];
int count = interviewbit_map[a];
for(int jtr = 0; jtr < count; jtr++){
for(int jtr = 0; jtr < count; jtr++){
result.push_back(a);
result.push_back(a);
}
interviewbit_map.erase(a);
interviewbit_map.erase(a);
}
}
for(auto m : interviewbit_map){
for(auto m : interviewbit_map){
int count = m.second;
int count = m.second;
for(int jtr = 0; jtr < count; jtr++){
for(int jtr = 0; jtr < count; jtr++){
result.push_back(m.first);
result.push_back(m.first);
}
}
return result;
return result;
}
Time and space analysis: - Time Complexity = O(N * Log(N))
时间与空间分析:- 时间复杂度 = O(N * Log(N))
- Space Complexity = O(N)
217. What do you mean by semantic gap?
你所说的语义鸿沟是什么意思?
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba682d | 官方: 否 | 付费: 否
答案:
A semantic gap is a difference between two domains i.e consider the difference between an HLL that is used by many computer languages and the machine language i.e binary instructions in the form and 0 and 1 used by microprocessors.
语义鸿沟是两个领域之间的差异,例如,许多计算机语言使用的高级语言(HLL)与微处理器使用的机器语言(即由0和1组成的二进制指令)之间的差异。
218. How can you search for an element in a rotated sorted array?
如何在旋转排序数组中搜索一个元素?
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba6830 | 官方: 否 | 付费: 否
答案:
Approach: - To find an element in a rotated sorted array binary search can be used.
方法:- 要查找旋转排序数组中的元素,可以使用二分搜索。
- First, we can find the element present at mid and check whether the left half of the array up to mid is sorted or not by using the condition arr[low] Implementation:
int search(vector
int search(vector& arr, int x) {
int low=0;
int low=0;
int high=arr.size()-1;
int high=arr.size()-1;
while(low<=high){
while(low<=high){
int mid=low+(high-low)/2;
int mid=low+(high-low)/2;
if(arr[mid]==x){
if(arr[mid]==x){
return mid;
返回 mid;
}
if(arr[low]<=arr[mid]){
if(arr[low]<=arr[mid]){
if(x>=arr[low] && x<arr[mid]){
if(x>=arr[low] && x<arr[mid]){
high=mid-1;
高=中间-1;
}
else{
否则{
low=mid+1;
low=mid+1;
}
}
else if(arr[mid]<arr[high]){
else if(arr[mid]<arr[high]){
if(x>arr[mid] && x<=arr[high]){
if(x>arr[mid] && x<=arr[high]){
low=mid+1;
low=mid+1;
}
else{
否则{
high=mid-1;
高=中间-1;
}
}
}
return -1;
return -1;
}
219. Explain the terms demand - paging and pre-paging?
解释术语“请求分页”和“预分页”?
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba6836 | 官方: 否 | 付费: 否
答案:
- You can consider demand paging as the process in which only demanded pages are brought to the memory, i.e. memory is only accessed when a particular location on a page is actually pointed or referenced throughout the execution of a process.
- With pre-paging, the requested pages, as well as the pages which are not demanded, are also brought to the memory location. The operating system calculates ahead of time which pages the process will need and loads them into memory in advance.
220. Could you please suggest some test cases for an ATM machine?
能否请你为ATM机建议一些测试用例?
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba6839 | 官方: 否 | 付费: 否
答案:
- Ensure that the slot in which the card is inserted is in accordance with the specifications
- Check whether the card and PIN are accepted by it or not
- Try to insert a credit card in the wrong way or use an old damaged card, or try to enter an inaccurate pin to verify that the error message is displayed
- Verify whether the touch screen is working properly or not
- Check the functionality of all the buttons present on the machine.
- If the user is inserting a valid card then a message should be displayed asking the user to enter the pin
- Ensure that the card is blocked after entering the inaccurate pin more than the allowed limit.
- Ensure that the user is not permitted to make more than 1 transaction after entering the PIN.
- As soon as the transaction is completed, ensure that the session expires after that and check the duration of time it takes for the system to log out
- Check for all other functionalities like whether the no cash in machine message is displayed, the language selection option is there, the invalid amount entered message should be displayed, daily limit exceeded message should be displayed, etc.
- The cash should come out of the machine after the user enters the details correctly.
- Check whether the machine is asking the user to print the receipt after a successful transaction.
- Confirm the receipt has the correct data printed on it.
221. Maximum sum subtree
最大子树和
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba683c | 官方: 否 | 付费: 否
答案:
Problem Discussion:
问题讨论:
In the input, you will be provided with the values that you have to put in the nodes of the generic tree.
在输入中,将提供给你需要放入通用树节点中的值。
You have to construct a generic tree and print the node having the maximum subtree. See the below image to understand the problem statement.
你必须构造一棵通用树,并输出具有最大子树的节点。请查看下图以理解问题陈述。
As you can see in the above image the subtree having the largest sum is represented by node 6.
如上图所示,具有最大总和的子树由节点6表示。
Algorithm:
算法:
- Create a global variable to store the node containing the largest sum subtree.
- We will be using the idea that the maximum sum subtree contained by the node 0 is the sum of maximum sum subtrees represented by the child nodes of 0 + the value of the root node.
- Now you have to traverse the tree and while returning from a node you have to return the sum represented by the subtree of that node.
Implementation:
实现:
include<bits/stdc++.h>
using namespace std;
using namespace std;
class Node
class Node
{
public:
public:
int val;
int val;
vector <Node*> children;
vector <Node*> children;
};
Node* construct(int arr[],int n)
Node* construct(int arr[],int n)
{
Node *root;
Node *root;
stack <Node*> st;
stack <Node*> st;
Node *t=new Node;
Node *t=new Node;
t->val=arr[0];
t->val=arr[0];
st.push(t);
st.push(t);
root=t;
root=t;
for(int i=1;i<n;i++)
for(int i=1;i<n;i++)
{
if(arr[i]==-1)
if(arr[i]==-1)
{
st.pop();
st.pop();
}
else
else
{
Node *top=st.top();
Node *top=st.top();
Node *t=new Node;
Node *t=new Node;
t->val=arr[i];
t->val=arr[i];
top->children.push_back(t);
top->children.push_back(t);
st.push(t);
st.push(t);
}
}
return root;
return root;
}
int maxsum=INT_MIN;
int maxsum=INT_MIN;
int maxsumnode=0;
int maxsumnode=0;
int maxsumsubtree(Node* n){
int maxsumsubtree(Node* n){
int sum=0;
int sum=0;
for(Node *child:n->children)
for(Node *child:n->children)
{
int sum1=maxsumsubtree(child);
int sum1=maxsumsubtree(child);
sum=sum+sum1;
sum=sum+sum1;
}
sum=sum+n->val;
sum=sum+n->val;
if(sum>maxsum){
if(sum>maxsum){
maxsum=sum;
maxsum=sum;
maxsumnode=n->val;}
maxsumnode=n->val;}
return sum;
return sum;
}
int main()
int main()
{
int n;
int n;
cin>>n;
cin>>n;
int *arr=new int[n];
int *arr=new int[n];
for(int i=0;i<n;i++)
for(int i=0;i<n;i++)
{
cin>>arr[i];
cin>>arr[i];
}
Node *root=construct(arr,n);
Node *root=construct(arr,n);
int val;
int val;
cin>>val;
cin>>val;
maxsumsubtree(root);
maxsumsubtree(root);
cout<<maxsumnode;
cout<<maxsumnode;
}
222. Calculate product of array excluding the present value
计算除当前值外数组的乘积
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba6842 | 官方: 否 | 付费: 否
答案:
Problem Discussion:
问题讨论:
You are given array nums. You are required to return an array whose value at any index is equal to the product of all elements of the array excluding the value at nums[i] without the use of division.
给定数组nums,要求返回一个数组,其中任意索引处的值等于数组中除nums[i]处值外所有元素的乘积,且不能使用除法。
Algorithm:
算法:
- First, we will create 2 arrays arr and arr2 and initialise them with 1.
- Each index of arr will store the product of all the elements up to ith index and each index of arr2 will store the product of all elements which are present at index greater than and equal to ith index.
- Now the value of our ans array at any index will be equal to arr[i-1]*arr2[i+1].
Corner Case:
边界情况:
- If i is at 0 aur nums.size()-1 then we will consider the value present at index -1 and nums.size() is 1.
Implementation:
实现:
vectorproductExceptSelf(vector & nums) {
vectorproductExceptSelf(vector & nums) {
vectorarr(nums.size(),1);
vectorarr(nums.size(),1);
vectorarr2(nums.size(),1);
vectorarr2(nums.size(),1);
int prod=1;
int prod=1;
int prod2;
int prod2;
for(int i=0;i<nums.size();i++){
for(int i=0;i<nums.size();i++){
prod=prod*nums[i];
prod=prod*nums[i];
arr[i]=prod;
arr[i]=prod;
}
prod=1;
prod=1;
for(int i=nums.size()-1;i>=0;i--){
for(int i=nums.size()-1;i>=0;i--){
prod=prod*nums[i];
prod=prod*nums[i];
arr2[i]=prod;
arr2[i]=prod;
}
vector
vectorans;
for(int i=0;i<nums.size();i++){
for(int i=0;i<nums.size();i++){
if(i==0){
if(i==0){
int x=arr2[i+1];
int x=arr2[i+1];
ans.push_back(x);
ans.push_back(x);
}
else if(i==nums.size()-1){
否则如果(i==nums.size()-1){
int x=arr[i-1];
int x=arr[i-1];
ans.push_back(x);
ans.push_back(x);
}
else{
否则{
int x=arr[i-1]*arr2[i+1];
int x=arr[i-1]*arr2[i+1];
ans.push_back(x);
ans.push_back(x);
}
}
return ans;
return ans;
}
Now, to optimise the solution further by avoiding creating the arr which is used for storing the product of elements present at the left of the array. This is because we can calculate the product of the left side of the array while traversing the nums array just by storing the product in a variable.
现在,为了进一步优化解决方案,避免创建用于存储数组左侧元素乘积的arr。这是因为我们可以在遍历nums数组时,仅通过将乘积存储在一个变量中,来计算数组左侧的乘积。
Below is the implementation of the optimised approach:
下面是优化方法的实现:
vector
vectorproductExceptSelf(vector & nums) {
vector
vectorarr2(nums.size(),1);
int prod=1;
int prod=1;
for(int i=nums.size()-1;i>=0;i--){
for(int i=nums.size()-1;i>=0;i--){
prod=prod*nums[i];
prod=prod*nums[i];
arr2[i]=prod;
arr2[i]=prod;
}
vector
vectorans;
prod=1;
prod=1;
for(int i=0;i<nums.size();i++){
for(int i=0;i<nums.size();i++){
if(i==0){
if(i==0){
int x=arr2[i+1];
int x=arr2[i+1];
ans.push_back(x);
ans.push_back(x);
}
else if(i==nums.size()-1){
否则如果(i==nums.size()-1){
prod=prod*nums[i-1];
prod=prod*nums[i-1];
ans.push_back(prod);
ans.push_back(prod);
}
else{
否则{
prod=prod*nums[i-1];
prod=prod*nums[i-1];
int x=prod*arr2[i+1];
int x=prod*arr2[i+1];
ans.push_back(x);
ans.push_back(x);
}
}
return ans;
return ans;
}
Time and space analysis: - Time complexity: O(N)
时间和空间分析:- 时间复杂度:O(N)
- Auxiliary space: O(N)
223. Calculate the number of trailing 0’s in 100!.
计算100!中末尾0的个数。
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba6845 | 官方: 否 | 付费: 否
答案:
Problem Discussion:
问题讨论:
You are required to calculate the number of trailing zeroes that are present in 100!
你需要计算100!中存在的末尾零的个数。
For eg:
例如:
The number of trailing 0’s in 5! Is 1 as 5! Is equal to 120.
5!中末尾0的个数是1,因为5!等于120。
Now we will see a method in which we can calculate the number of trailing zeroes in any factorial without actually calculating the value of the factorial.
现在我们将看到一种方法,可以在不实际计算阶乘值的情况下,计算任何阶乘中末尾零的个数。
Let’s take a smaller example first. Suppose you have to find trailing zeroes in 10!.
我们先来看一个更小的例子。假设你要计算 10! 中末尾零的个数。
10!=1234……910
Now the number of trailing 0’s will be equal to the number of times 10 is present in 10!. So basically we have to find the number of times the factors of 10 i.e. 2 and 5 are coming. Also, the number of occurrences of 2 will be much larger than the occurrences of 5 therefore we just have to calculate the occurrences of 5.
末尾 0 的个数将等于 10 在 10! 中出现的次数。所以基本上我们要找出 10 的因子即 2 和 5 出现的次数。另外,2 的出现次数会远多于 5 的出现次数,因此我们只需计算 5 的出现次数。
Now the question arises, how to find the occurrences of 5?
现在问题来了,如何找出 5 的出现次数?
This is given by a basic formula which tells how many times 5 is present in any factorial. So for calculating how many times 5 appear in 100!, we can use the formula:
这由一个基本公式给出,该公式告诉我们任何阶乘中 5 出现了多少次。因此要计算 100! 中 5 出现了多少次,我们可以使用该公式:
You can neglect the 3rd term because it will be 0.
你可以忽略第 3 项,因为它将是 0。
So, the answer will be 20+4=24 i.e. number of trailing 0’s present in 100! is 24.
所以,答案将是 20+4=24,即 100! 中末尾 0 的个数是 24。
224. When is a switch considered congested?
交换机在什么情况下被认为拥塞?
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba6848 | 官方: 否 | 付费: 否
答案:
When the data is transferred to the switch at a rate faster than the rate at which it can collect and store the data in the memory then the buffer space will be drained therefore there will be some packets that must be dropped in this state, which is referred to as a congested state.
当数据以快于交换机从内存中收集和存储数据的速率传入交换机时,缓冲区空间将被耗尽,因而在这种状态下会有一些数据包必须被丢弃,这被称为拥塞状态。
225. Given an array arr, find the peak element in arr.
给定一个数组 arr,找出 arr 中的峰值元素。
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba684b | 官方: 否 | 付费: 否
答案:
Problem Discussion:
问题讨论:
You will be given an unsorted array containing integers. You are required to find the local maxima/peak element i.e. element whose value is greater than both its neighbours.
你会得到一个包含整数的未排序数组。你需要找出局部最大值/峰值元素,即其值大于其两个相邻元素的元素。
Note: The array can contain multiple peak values, therefore you can return any one of them.
注意:数组可以包含多个峰值,因此你可以返回其中任意一个。
Given: array[-1] = array[n] = -∞.
给定:array[-1] = array[n] = -∞。
For example: If you are given an array [10,40,30,20,10,60,50] then the peak elements are 40 and 60;
例如:如果给定数组 [10,40,30,20,10,60,50],那么峰值元素是 40 和 60;
Algorithm:
算法:
- A brute force approach could be iterating over all the elements one by one to find the peak elements which will take order of N time.
- We will solve it in a more optimised way, that is, we can use a modification of binary search in this question.
- First, find the element present in the middle and check whether it is greater than both its neighbouring elements. If it's greater then return the middle element.
- If the middle element is less than its left neighbouring element then the peak would lie on the left side of the array.
- If the middle element is less than its right neighbouring element then the peak will definitely lie on the right side of the array.
Corner cases:
边界情况:
If you are at the 0th or last element of the array then you have to compare the current element with only 1 neighbouring element because it's given in the question that array[-1] = array[n] = -∞.
如果你位于数组的第0个或最后一个元素,则必须只与1个相邻元素比较,因为题目中给出array[-1] = array[n] = -∞。
Implementation:
实现:
int findPeakElement(vector& nums) {
int findPeakElement(vector& nums) {
int low=0;
int low=0;
int high=nums.size()-1;
int high=nums.size()-1;
if(nums.size()==1){
if(nums.size()==1){
return 0;
return 0;
}
while(low<=high){
while(low<=high){
int mid=low+(high-low)/2;
int mid=low+(high-low)/2;
if(mid>0 && mid<nums.size()-1){
if(mid>0 && mid<nums.size()-1){
if(nums[mid]>nums[mid+1] && nums[mid]>nums[mid-1]){
if(nums[mid]>nums[mid+1] && nums[mid]>nums[mid-1]){
return mid;
返回 mid;
}
else if(nums[mid]<nums[mid+1] && nums[mid]>nums[mid-1]){
else if(nums[mid]<nums[mid+1] && nums[mid]>nums[mid-1]){
low=mid+1;
low=mid+1;
}
else if(nums[mid]>nums[mid+1] && nums[mid]<nums[mid-1]){
else if(nums[mid]>nums[mid+1] && nums[mid]<nums[mid-1]){
high=mid-1;
高=中间-1;
}
else{
否则{
high=mid-1;
高=中间-1;
}
}
else if(mid==0){
否则如果(中间==0){
if(nums[0]>nums[1]){
如果(nums[0]>nums[1]){
return 0;
return 0;
}
else{
否则{
return 1;
return 1;
}
}
else if(mid==nums.size()-1){
否则如果(中间==nums.size()-1){
if(nums[nums.size()-1]>nums[nums.size()-2]){
如果(nums[nums.size()-1]>nums[nums.size()-2]){
return nums.size()-1;
返回nums.size()-1;
}
else{
否则{
return nums.size()-2;
返回nums.size()-2;
}
}
}
return -1;
return -1;
}
Time and space analysis: - Time complexity: We are using binary search, therefore time complexity will be logarithmic, i.e. O(logN) where N is the number of elements in the array.
时间和空间分析:- 时间复杂度:我们使用了二分查找,因此时间复杂度将是对数级别的,即O(logN),其中N是数组中的元素数量。
- Auxiliary Space: O(1)
226. What is a MAC address and it consists of how many bits?
什么是MAC地址,它由多少位组成?
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba684e | 官方: 否 | 付费: 否
答案:
- MAC address basically stands for Media Access Control.
- With the help of MAC addresses, each node on the Local Area Network is identified.
These MAC addresses are unique and can’t be changed as these MAC addresses are assigned by the manufacturer.
For example, Let’s suppose the IP Address is the location of a person then the MAC address would be the name of the person i.e. wherever he goes his name remains the same but the location changes.例如,假设IP地址是一个人的位置,那么MAC地址就是那个人的名字,即无论他走到哪里,他的名字保持不变,但位置会改变。
- These MAC addresses are represented in hexadecimal. For checking the MAC or physical address you can go to the command prompt and type: ipconfig/aļl.There you will find the MAC address similar to this:
- The number of bits present in a MAC address is equal to 48.
227. Explain the term checksum error correction?
解释术语“校验和纠错”?
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba6851 | 官方: 否 | 付费: 否
答案:
- Check is a term you will hear quite often in computer networks and as the name suggests, checksum means it is going to check the sum.
- So, the sender is going to create the message and with the message, it is going to calculate the checksum, and then it will attach the checksum to the message.
- On the sender’s side, the checksum is created and on the receiver's side checksum is validated.
- After the validation process, if the receiver confirms that there is no error then the data is accepted.
Let’s see how the checksum is created at the receiver’s side:
让我们看看接收方是如何生成校验和的:
The first step is to break the actual message into 'x' number of blocks i.e. 'n' bits per block. 2. The next step is to calculate the sum of all the 'x' data blocks. 3. If there is any carry then add it to the sum. 4. Do 1's complement to the sum= Checksum.
- 第一步是将实际消息分成“x”个块,即每块“n”位。 2. 下一步是计算所有“x”个数据块的总和。 3. 如果有任何进位,则将其加到总和上。 4. 对总和取1的补码=校验和。
CHECKSUM-EXAMPLE
校验和示例
Consider the data unit to be transmitted as:
考虑要传输的数据单元为:
10011001111000100010010010000100
i.e 10011001 11100010 00100100 10000100
即 10011001 11100010 00100100 10000100
Now the sender appends the checksum to the original message and sends it to the receiver.
现在发送方将校验和附加到原始消息上,并将其发送给接收方。
Now the receiver - First accumulates all the data blocks including the checksum.
现在接收方 - 首先累加所有数据块(包括校验和)。
- Then it calculates the sum of all the data blocks along with the checksum.
If the final result includes all 1's, then it is accepted otherwise rejected.
This is known as checksum error detection.这被称为校验和错误检测。
D E Shaw Interview Preparation
228. What is the Eligibility Criteria at DE Shaw?
DE Shaw的资格标准是什么?
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba6865 | 官方: 否 | 付费: 否
答案:
- Interested students in IT, CSE, ECE, MCA, and M.Tech are welcome to apply for D E Shaw campus recruitment.
- The candidate's percentage should be above 65 in high school to be eligible for DE Shaw.
- If a candidate has a backlog in his college in any semester then he is not eligible.
- Communication skills and teamwork skills are important.
229. How long is DE Shaw's interview?
DE Shaw的面试时长是多久?
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba6868 | 官方: 否 | 付费: 否
答案:
In the coding round, you will get 20-30 minutes for coding questions and 30-50 minutes for solving the MCQ sections. As far as technical interviews are concerned, they can be stretched over to 1 to 1.5 hr generally depending on the interviewers.
在编码轮中,你会有20-30分钟用于编码问题,30-50分钟用于解决选择题部分。至于技术面试,通常可以延长到1到1.5小时,具体取决于面试官。
All technical rounds are conducted on the same day and the HR round is conducted after you qualify in the technical rounds.
所有技术轮次都在同一天进行,人力资源轮次在你通过技术轮次后进行。
230. Are DE Shaw interviews tough?
DE Shaw的面试难吗?
- 知识点: 其他/未分类 (标签: interviewbit, de-shaw, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: D. E. Shaw
- id: 69b37a6d58d557c902ba686b | 官方: 否 | 付费: 否
答案:
D.E Shaw mainly focuses on your problem-solving abilities and how you approach a particular problem because they believe in hiring employees with extraordinary skills. So you should be well prepared for the interviews. The interviewers will go into the depths of every topic but if you are clear with the fundamentals and have practised enough to develop your problem-solving skills then you can easily crack the DE Shaw interview.
D.E Shaw主要关注你的问题解决能力以及你如何处理特定问题,因为他们相信雇用具有非凡技能的员工。因此,你应该为面试做好充分准备。面试官会深入探讨每个主题,但如果你对基础知识清晰,并且练习足够以培养问题解决能力,那么你可以轻松通过DE Shaw的面试。
231. Explain the OSI model?
解释OSI模型?
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba691b | 官方: 否 | 付费: 否
答案:
- OSI model which stands for open system interconnection model was proposed in 1983 to provide different functionalities for communication between networks.
- It was developed by the International Standards Organization (ISO) and it contains 7 layers, unlike the TCP/IP model which was proposed earlier and contains 5 layers.
- The seven layers of the OSI model are the Physical layer, Data Link layer, Network layer, Transport layer, Session layer, Presentation layer, and Application layer. All these layers provide different functionalities for communication in a network. All the layers of the OSI model are linked to each other.
The functionalities of different layers of the OSI model are
OSI模型各层的功能如下
- Physical Layer: Physical layer of the OSI model is the lowest layer among all and is responsible mainly for the physical connection between networks. The data is sent in the form of bits i.e. 0 and 1. Dealing with cables, repeaters, etc comes under the functionality of the physical layer.
- Data Link Layer: Data link layer is mainly responsible for converting the data into frames and transferring it from one node to another The data link layer is further divided into two layers namely MAC which stands for media access control and another one is LLC which stands for logic link control.
- Network Layer: The network layer provides the functionality of receiving the data in the form of frames from the data link layer and determining the route for sending the data to the destination using the logical addresses. It helps in selecting the optimal path from the source to the destination for the transfer of data.
- Transport Layer: Protocols such as TCP i.e transmission control protocols are present in this layer. The transport layer is responsible for delivering error-free data to the destination address. Acknowledgement of data that is sent through the network is essential and the transport layer takes care of that. If the acknowledgement is not received then the transport layer helps in retransmitting the data.
- Session Layer: The session layer is the 5th layer of the OSI model and functionalities such as providing security during the transmission of data in a network to keep our data safe, authentication, synchronization establishment, and termination of connections are provided by the session layer of OSI model.
- Presentation Layer: The presentation layer checks the data for syntax and semantics before sending it to the application layer. Other functionalities of the presentation layer include encrypting and describing the data and also reducing the size of data while transferring which is known as compression.
- Application Layer: Among the 7 layers of the OSI model, the application layer stands at the top. This layer is responsible for the interaction of the end-user with the application. This layer mainly helps in communicating with other devices. FTP, SMTP, and HTTP are the important protocols that are present in this layer.
232. Write a program for calculating the Stock Span
编写一个计算股票跨度(Stock Span)的程序
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba6921 | 官方: 否 | 付费: 否
答案:
Problem Discussion:
问题讨论:
You are given an array arr containing prices of the stock on different days. Your task is to calculate span i.e the number of days before the current day during which the price of the stock was equal to or less than the price at which the stock is trading on a given day.
给定一个数组arr,包含不同日期的股票价格。你的任务是计算跨度,即在当前日期之前,股票价格等于或低于给定日期交易价格的天数。
The figure below shows the span of stocks on different days.
下图展示了不同日期股票的跨度。
Algorithm: - We will be using a stack for storing the index
算法:- 我们将使用一个栈来存储索引
- Create a span array and put 1 at the 0th index because the span for the first element will be 1.
- Create a stack and push the first index i.e. 0.
- Start traversing from the first index of the array and for each element:
- If the value of the current element is greater than the top element present in the stack then pop all the elements of the stack until the stack is empty or the value of the current element becomes less than the top element of the stack
- Now check whether the stack is empty or not.
If the stack is empty that means that the current stock price is highest until now therefore store index+1 in the span array else store the difference between the current index and the top of the stack.
Implementation:实现:
include<stdbool.h>
include
using namespace std;
using namespace std;
include
class node{
class node{
public:
public:
int data;
int data;
class node* next;
class node* next;
node()
node()
{
data=0;
data=0;
next=NULL;
next=NULL;
}
}*top=NULL;
}*top=NULL;
class Stack{
class Stack{
public:
public:
void push(int x){
void push(int x){
node *p=new node;
node *p=new node;
if(top==NULL){
if(top==NULL){
p->data=x;
p->data=x;
p->next=NULL;
p->next=NULL;
top=p;}
top=p;}
else{
否则{
p->data=x;
p->data=x;
p->next=top;
p->next=top;
top=p;
top=p;
}
}
int pop(){
int pop(){
int ch;
int ch;
ch=top->data;
ch=top->data;
top=top->next;
top=top->next;
return ch;
return ch;
}
bool isempty(){
bool isempty(){
if(top==NULL){
if(top==NULL){
return true;}
return true;}
else{
否则{
return false;
返回 false;
}
}
};
void stkspan(int arr[],int n){
void stkspan(int arr[],int n){
Stack st;
Stack st;
int arr1[n];
int arr1[n];
arr1[0]=1;
arr1[0]=1;
st.push(0);
st.push(0);
for(int i=1;i<n;i++){
for(int i=1;i<n;i++){
while(st.isempty()==false && arr[i]>=arr[top->data])
while(st.isempty()==false && arr[i]>=arr[top->data])
{
st.pop();
st.pop();
}
if(st.isempty()==true)
if(st.isempty()==true)
{
arr1[i]=i+1;
arr1[i]=i+1;
}
else{
否则{
arr1[i]=i-top->data;
arr1[i]=i-top->data;
}
st.push(i);
st.push(i);
}
for(int j=0;j<n;j++)
for(int j=0;j<n;j++)
{
cout<<arr1[j]<<endl;
cout<<arr1[j]<<endl;
}
}
int main()
int main()
{
int n;
int n;
cin>>n;
cin>>n;
int *arr=new int[n];
int *arr=new int[n];
for(int i=0;i<n;i++){
for(int i=0;i<n;i++){
cin>>arr[i];
cin>>arr[i];
}
stkspan(arr,n);
stkspan(arr,n);
}
Time and Space analysis: - Time Complexity: O(N), where n is the number of elements in the array.
时间和空间分析:- 时间复杂度:O(N),其中 n 是数组中的元素个数。
- Space Complexity: O(N), where n is the number of elements in the array.
- Data Science
- All Events
- My Events
233. Write a program to calculate the power of a number.
编写一个程序来计算一个数的幂。
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba6927 | 官方: 否 | 付费: 否
答案:
Algorithm: - The approach is simple. We will use the divide and conquer method i.e we will divide a larger problem into subproblems recursively for calculation of the power of a number.
算法:- 方法很简单。我们将使用分治法,即递归地将一个大问题分解为子问题来计算一个数的幂。
- In the base case return 1 since the power of any number to the power 0 is 1.
We will store the recursive function in a temporary variable instead of calling the function 2 times to optimize the solution from O(N) to log(N).
Implementation:实现:
include
using namespace std;
using namespace std;
class Interviewbit
class Interviewbit
{
public:
public:
int pow_function(int a, unsigned int b)
int pow_function(int a, unsigned int b)
{ int x;
{ int x;
if (b == 0){
如果 (b 等于 0){
return 1;
return 1;
}
x=pow_function(a, b / 2);
x=pow_function(a, b / 2);
if (b % 2 == 0){
如果 (b 取余 2 等于 0){
return x * x;}
返回 x * x;}
else{
否则{
return a x x;
返回 a x x;
}
}
};
int main()
int main()
{
Interviewbit i;
Interviewbit i;
int a = 4;
int a = 4;
unsigned int b = 6;
unsigned int b = 6;
cout << i.pow_function(a, b);
输出 i.pow_function(a, b);
}
Time and Space analysis: - Time Complexity: O(log n)
时间和空间分析:- 时间复杂度:O(log n)
- Auxiliary Space: O(1)
234. Draw the process state diagram of the OS.
绘制操作系统的进程状态图。
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba692a | 官方: 否 | 付费: 否
答案:
(补充答案·AI 生成(AI-Generated))
进程状态图(经典五态):New(新建,进程被创建)→ Ready(就绪,等待 CPU)→ Running(运行,占用 CPU)→ Terminated(终止,执行结束)。执行中若等待 I/O 或事件则进入 Waiting/Blocked(等待/阻塞);阻塞事件完成后回到 Ready,而非直接回 Running。此外还有挂起态(Swapped-out Ready/Blocked)、以及僵尸态(zombie state,已终止但父进程未回收)。转移:调度(Ready→Running)、时间片耗尽/被抢占(Running→Ready)、发起 I/O(Running→Waiting)、I/O 完成(Waiting→Ready)、退出(Running→Terminated)。
235. How do processes and programs differ?
进程和程序有何区别?
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba6930 | 官方: 否 | 付费: 否
答案:
A program is a set of instructions to be performed that resides in the secondary memory but when a program is executed it gets converted to a process which is then loaded to the main memory.
程序是存储在辅助存储器中待执行的一组指令,但程序执行时会转化为进程,然后加载到主存储器中。
236. You are given 8 matchsticks out of which 4 are of the same length having length x while the other 4 are of the same length having length y. Given y=x/2, can you form 3 squares of the same size using these sticks?
给你8根火柴,其中4根长度相同为x,另外4根长度相同为y。已知y=x/2,你能用这些火柴组成3个大小相同的正方形吗?
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba6936 | 官方: 否 | 付费: 否
答案:
You can follow the steps mentioned below to form 3 squares of equal sizes:
你可以按照以下步骤组成3个大小相等的正方形:
- Initially, place the first matchstick having length x in the horizontal direction
- In the next step place the second matchstick having length x in the vertical direction such that they form a cross.
- In step 3, place the 3rd matchstick of length x below the vertical matchstick in a horizontal direction as shown in the figure.
- Now place the last matchstick of length x in the vertical direction such that it forms a square and divides the last-placed matchstick into 2 halves.
- Now start placing the matchstick of length y in a horizontal direction at the last level.
- Complete another square by placing the matchstick in a vertical direction.
- Place another matchstick in the horizontal direction at the top level.
- Finally, complete the structure by forming three squares of equal size by placing the last matchstick of length y in the vertical direction.
Successful Tech Career for FREE!
免费开启成功的科技职业生涯!
Successful Tech Career!
成功的技术职业生涯!
Interview Process
面试流程
CTC & Designation
CTC与职位级别
Projects on the Job
工作项目
Referral System
推荐系统
Try It Out
试试看
2 Lakh+ Roadmaps Created
已生成20万+职业规划
237. Find maximum distance between occurrences
找出出现位置之间的最大距离
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba6939 | 官方: 否 | 付费: 否
答案:
Problem Discussion:
问题讨论:
You will be given an array arr. Your task is to find the maximum distance between the two same elements in the array.
给定一个数组 arr,你的任务是找出数组中两个相同元素之间的最大距离。
For eg:
例如:
Input array arr=[3, 4, 6, 7, 4, 8, 9, 3]
输入数组 arr=[3, 4, 6, 7, 4, 8, 9, 3]
The output will be 7 because the maximum distance is between the first element and the last element of the array.
输出将是 7,因为最大距离位于数组的第一个元素和最后一个元素之间。
Note: The given array arr will always contain repeated elements.
注意:给定的数组 arr 始终包含重复元素。
Algorithm: - A brute force approach is to use nested for loops and calculate the maximum distance between two occurrences for each and every elements but it would take O(n2) time.
算法: - 一种暴力方法是使用嵌套的 for 循环,计算每个元素两次出现之间的最大距离,但这需要 O(n2) 的时间。
- An optimized approach that would take O(n) can be implemented using a map.
- First of all, declare a map for storing the first occurrence of each element.
- Using a loop, traverse every element and check whether the element is already present in the map or not.
- If the element is already present then update the maximum distance between two occurrences and if it is not found then store the index of the current element in the map.
At last return the maximum distance
Implementation:实现:
include<bits/stdc++.h>
using namespace std;
using namespace std;
int disBetweenOccurence(int arr[], int n)
int disBetweenOccurence(int arr[], int n)
{
unordered_map<int, int> interviewbit_mp;
unordered_map<int, int> interviewbit_mp;
int dist_betweeen_occurences = 0;
int dist_betweeen_occurences = 0;
for (int i=0; i<n; i++)
for (int i=0; i<n; i++)
{
if (interviewbit_mp.find(arr[i]) == interviewbit_mp.end())
if (interviewbit_mp.find(arr[i]) == interviewbit_mp.end())
{
interviewbit_mp[arr[i]] = i;
interviewbit_mp[arr[i]] = i;
}
else{
否则{
dist_betweeen_occurences = max(dist_betweeen_occurences, i - interviewbit_mp[arr[i]]);
dist_betweeen_occurences = max(dist_betweeen_occurences, i - interviewbit_mp[arr[i]]);
}
}
return dist_betweeen_occurences;
return dist_betweeen_occurences;
}
int main()
int main()
{
int arr[] = {3, 4, 6, 7, 4, 8, 9, 3};
int arr[] = {3, 4, 6, 7, 4, 8, 9, 3};
int n = sizeof(arr)/sizeof(arr[0]);
int n = sizeof(arr)/sizeof(arr[0]);
cout << disBetweenOccurence(arr, n);
cout << disBetweenOccurence(arr, n);
return 0;
return 0;
}
Time and space analysis: - Time complexity:O(N), where n is the number of elements in the array.
时间与空间分析: - 时间复杂度:O(N),其中 n 是数组中的元素个数。
- Space Complexity: O(N), where n is the number of elements in the array.
238. In what condition does the worst case of QuickSort occur?
在什么条件下会出现快速排序的最坏情况?
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba693c | 官方: 否 | 付费: 否
答案:
- The worst case of the quick sort occurs when the array is sorted, resulting in time complexity of O(N2).
- We use the partitioning method in quick sort in which we select a pivot and find the correct position for that pivot element. The elements smaller than the pivot element are on one side and the greater elements are on the other side.
- If the array is sorted then partitioning happens at the end of the array resulting in time complexity of O(N2).
239. What is the basic difference between function overloading and function overriding?
函数重载和函数重写之间的基本区别是什么?
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba693f | 官方: 否 | 付费: 否
答案:
Function overloading means 2 functions that are declared with the same name but have any one of the following parameters different among them:
The number of arguments passed to the function can be different传递给函数的参数数量可以不同
The type of arguments passed can be different
传递的参数类型可以不同
The ordering of arguments in the function can be different
函数中参数的顺序可以不同- Function overriding is similar to overloading but in overriding both the functions are in different class i.e. base class and derived class whereas in overloading both functions are in the same class. Overriding is applied in the situations where a function is defined in the base class but more functionalities are defined in the derived class.
240. Find 2 missing numbers
找出2个缺失的数字
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba6948 | 官方: 否 | 付费: 否
答案:
Problem Discussion:
问题讨论:
This is a follow up question of finding missing elements. If you successfully tell the approach for finding missing elements to the interviewer then you will surely get this follow up question. In the previous question, you were required to find a single missing element but in this question, you have to find 2 missing elements in the range 0 to n.
这是查找缺失元素问题的后续问题。如果你能成功向面试官讲述查找缺失元素的方法,那么肯定会得到这个后续问题。在之前的问题中,你只需要找到一个缺失的元素,但在这个问题中,你需要在0到n范围内找到2个缺失的元素。
Algorithm: - This question can be solved using xor operations efficiently.
算法:- 这个问题可以高效地使用异或运算来解决。
- First of all take the xor of all the elements present in the array with natural numbers from 1 to n. For eg: If the given array is [1,2,4,6] then xor these with natural numbers from 1 to 6. This will give us 3^5. But the problem is we don’t know which are the exact numbers that are missing, we just know the xor of those numbers.
- So to solve this problem we will consider the rightmost set bit in xor of 3 and 5. The rightmost bit can be calculated using the formula XOR & ~(XOR-1).
In xor operation a set bit is formed by combination of 0 and 1. Therefore if we perform xor operation of all the elements in the array which have their rightmost set bit as 1 with all the natural numbers in the range then we will get the first missing number. Similarly, if we perform xor operation of all the elements in the array which do not have their rightmost set bit as 1 with all the natural numbers in the range then we will get another missing number.
Implementation:实现:
include<bits/stdc++.h>
void function_for_missing(int nums[], int n)
void function_for_missing(int nums[], int n)
{
int XOR = nums[0];
int XOR = nums[0];
for (int i = 1; i < n-2; i++)
for (int i = 1; i < n-2; i++)
XOR ^= nums[i];
XOR ^= nums[i];
for (int i = 1; i <= n; i++)
for (int i = 1; i <= n; i++)
XOR ^= i;
XOR ^= i;
int set_bit_no = XOR & ~(XOR-1);
int set_bit_no = XOR & ~(XOR-1);
int a = 0, b = 0;
int a = 0, b = 0;
for (int i = 0; i < n-2; i++)
for (int i = 0; i < n-2; i++)
{
if (nums[i] & set_bit_no)
if (nums[i] & set_bit_no)
a = a ^ nums[i];
a = a ^ nums[i];
else
else
b = b ^ nums[i];
b = b ^ nums[i];
}
for (int i = 1; i <= n; i++)
for (int i = 1; i <= n; i++)
{
if (i & set_bit_no)
if (i & set_bit_no)
a = a ^ i;
a = a ^ i;
else
else
b = b ^ i;
b = b ^ i;
}
printf("The numbers which are not present are\n %d %d", a, b);
printf("两个缺失的数字是\n %d %d", a, b);
}
int main()
int main()
{
int nums[] = {1, 3, 5, 6};
int nums[] = {1, 3, 5, 6};
int n = 2 + sizeof(nums)/sizeof(nums[0]);
int n = 2 + sizeof(nums)/sizeof(nums[0]);
function_for_missing(nums, n);
function_for_missing(nums, n);
return 0;
return 0;
}
Time and Space analysis:
时间和空间分析:
Time Complexity : O(n)
时间复杂度:O(n)
Auxiliary Space : O(1)
辅助空间:O(1)
241. Min distance between 2 distinct numbers
2 个不同数字之间的最小距离
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba694b | 官方: 否 | 付费: 否
答案:
Problem Discussion:
问题讨论:
You are given an array arr and two numbers a and b. Your task is to find the minimum gap between the numbers a and b.
给定一个数组 arr 和两个数字 a 和 b。你的任务是找出 a 和 b 之间的最小间距。
Note:
注意:
The array given will be unsorted and it may contain duplicates.
Both a and b are different and surely present in the given array arr.
a 和 b 是不同的,并且肯定存在于给定数组 arr 中。
For eg:
例如:
arr[] = {4, 5, 4, 2, 1, 4, 0, 0, 5, 4, 8, 4}, a=b and b=1
arr[] = {4, 5, 4, 2, 1, 4, 0, 0, 5, 4, 8, 4},a=b 且 b=1
The minimum gap will be 1.
最小间距将是 1。
Algorithm: - A brute force approach would be to use nested loops which would take O(N2) time.
算法:- 一种暴力方法是使用嵌套循环,这将花费 O(N^2) 时间。
- This problem can also be solved using a single loop.
- Traverse the array and maintain a variable min_gap.
- If the element is equal to a or b update the min gap else just updates the position of p i.e the previous element.
If min_gap==INT_MAX, in that case, return -1 which means the minimum gap is not found
Implementation:实现:
include <bits/stdc++.h>
using namespace std;
using namespace std;
int findminimumgap(int arr[], int n, int a, int b)
int findminimumgap(int arr[], int n, int a, int b)
{
int p = -1, min_gap = INT_MAX;
int p = -1, min_gap = INT_MAX;
for(int i=0 ; i<n ; i++)
for(int i=0 ; i<n ; i++)
{
if(arr[i]==a|| arr[i]==b)
if(arr[i]==a|| arr[i]==b)
{
if( p != -1 && arr[i] != arr[p])
if( p != -1 && arr[i] != arr[p])
min_gap = min(min_gap , i-p);
min_gap = min(min_gap , i-p);
p=i;
p=i;
}
}
if(min_gap==INT_MAX)
if(min_gap==INT_MAX)
return -1;
return -1;
return min_gap;
return min_gap;
}
int main()
int main()
{
int arr[] = {4, 5, 4, 2, 1, 4, 0, 0, 5, 4, 8, 4};
int arr[] = {4, 5, 4, 2, 1, 4, 0, 0, 5, 4, 8, 4};
int n = sizeof(arr) / sizeof(arr[0]);
int n = sizeof(arr) / sizeof(arr[0]);
int a = 4;
int a = 4;
int b = 1;
int b = 1;
cout << "Minimum distance is -> "<<
cout << "Minimum distance is -> "<<
findminimumgap(arr, n, a, b) << endl;
findminimumgap(arr, n, a, b) << endl;
return 0;
return 0;
}
Time and space analysis: - Time Complexity: O(N2), where N is the number of elements in the array
时间与空间分析: - 时间复杂度:O(N2),其中 N 是数组中的元素数量
- Space Complexity: O(1)
242. Compare the different version numbers
比较不同的版本号
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba6951 | 官方: 否 | 付费: 否
答案:
Problem Discussion:
问题讨论:
You are given version numbers and these are of the form w.x.y.z where x,y, z and w are strings which are separated by a dot. Your task is to compare two given strings/version numbers and return the version number which is smaller. Suppose you are given two versions 2.0 and 2.1 then 2.0 will be considered smaller.
给定版本号,其形式为 w.x.y.z,其中 x、y、z 和 w 是由点分隔的字符串。您的任务是比较两个给定的字符串/版本号,并返回较小的版本号。假设您有两个版本 2.0 和 2.1,则 2.0 会被视为较小。
For eg:
例如:
s1=7.0.1.23
s1=7.0.1.23
s2=7.0.1.17
s2=7.0.1.17
The output will be 7.0.1.17 because s2 is smaller
输出将是 7.0.1.17,因为 s2 较小
Algorithm: - The given string or versions contain dots therefore we have to trace them part by part.
算法: - 给定的字符串或版本包含点,因此我们必须逐部分追踪它们。
- Traverse the versions and compare the strings between dots.
- For comparing the string first compare them into integer
- Maintain two variables version1 and version2 for calculating the value between dots.
If both the numbers between dots are equal make version1 and version2 zero and traverse again else return the version which is smaller.
Implementation:实现:
include <bits/stdc++.h>
using namespace std;
using namespace std;
int check(string s1, string s2)
int check(string s1, string s2)
{
int version1 = 0, version2 = 0;
int version1 = 0, version2 = 0;
for (int i = 0, j = 0; (i < s1.length()
for (int i = 0, j = 0; (i < s1.length()
| | j < s2.length());) { |
while (i < s1.length() && s1[i] != '.') {
当(i < s1.length() 且 s1[i] 不等于 '.')时执行以下操作 {
version1 = version1 * 10 + (s1[i] - '0');
version1 = version1 * 10 + (s1[i] - '0');
i++;
i++;
}
while (j < s2.length() && s2[j] != '.') {
当(j < s2.length() 且 s2[j] 不等于 '.')时执行以下操作 {
version2 = version2 * 10 + (s2[j] - '0');
version2 = version2 * 10 + (s2[j] - '0');
j++;
j++;
}
if (version1> version2)
如果(version1 > version2)
return 1;
return 1;
if (version2 > version1)
如果(version2 > version1)
return -1;
return -1;
version1 = version2= 0;
version1 = version2 = 0;
i++;
i++;
j++;
j++;
}
return 0;
return 0;
}
int main()
int main()
{
string s1 = "0.5.3";
string s1 = "0.5.3";
string s2 = "0.5.7";
string s2 = "0.5.7";
if (check(s1, s2) < 0)
if (check(s1, s2) < 0)
cout << s1 << " is smaller\n";
cout << s1 << " is smaller\n";
else if (check(s1, s2) > 0)
else if (check(s1, s2) > 0)
cout << s2 << " is smaller\n";
cout << s2 << " is smaller\n";
else
else
cout << "Both version are equal\n";
cout << "Both version are equal\n";
}
Time and space analysis: - Time Complexity: O(n), where n is the length of the string.
时间与空间分析:- 时间复杂度:O(n),其中 n 是字符串的长度。
- Auxiliary space: O(1)
243. Find the missing number.
找到缺失的数字。
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba6954 | 官方: 否 | 付费: 否
答案:
Problem Discussion:
问题讨论:
You are given an unsorted array of size n in which 1 element is missing in the range of 0 to n. Your task is to find that number.
给定一个大小为 n 的未排序数组,其中在 0 到 n 范围内缺少 1 个元素。你的任务是找到那个数字。
For eg:
例如:
Suppose the given array is [3,0,1].
假设给定数组是 [3,0,1]。
The output will be 2 since the size of the array is 3.
输出将是 2,因为数组的大小是 3。
Algorithm: - The missing number can be found easily using the xor operation in just O(N) time.
算法:- 使用异或操作可以在 O(N) 时间内轻松找到缺失的数字。
Keep in mind the following properties of xor before coding the solution:
Xor of two different numbers is 1. Xor of the number with itself is 0. Xor of a number with 0 is the number itself. - So for finding the missing number do xor of all the numbers between 1 to n and then xor those numbers with all the numbers present in the array.两个不同数字的异或是 1。数字与自身的异或是 0。数字与 0 的异或是数字本身。- 因此,为了找到缺失的数字,先对 1 到 n 的所有数字进行异或,然后将这些数字与数组中存在的所有数字进行异或。
After performing these operations you will finally get the missing element.
Implementation:实现:
include <bits/stdc++.h>
using namespace std;
using namespace std;
int main()
int main()
{
int n;
int n;
cin>>n;
cin>>n;
int a[n-1];
int a[n-1];
for(int loop=0;loop<n-1;loop++)
for(int loop=0;loop<n-1;loop++)
{
cin>>a[loop];
cin>>a[loop];
}
int xor1 = 0,xor2 = 0;
int xor1 = 0,xor2 = 0;
for(int i=1;i<=n;i++)
for(int i=1;i<=n;i++)
{
xor1^=i;
xor1^=i;
}
for(int i=0;i<n-1;i++)
for(int i=0;i<n-1;i++)
{
xor2^=a[i];
xor2^=a[i];
}
int ans=xor1^xor2;
int ans=xor1^xor2;
cout<<"The number not present between 0-n is: "<<ans<<endl;
cout<<"The number not present between 0-n is: "<<ans<<endl;
return 0;
return 0;
}
Time and space analysis: - Time Complexity: O(N)
时间和空间分析:- 时间复杂度:O(N)
Space Complexity: O(1)
Useful Resources - DBMS Interview Questions有用资源 - DBMS面试问题
- OOPs Interview Questions
- Networking Interview Questions
- Software Engineering Interview Questions
- Front End Developer Interview Questions
- Technical Interview Questions
- Coding Interview Questions
Mock Interview
Delhivery Interview Preparation
244. Why do you want to work at Delhivery?
你为什么想在Delhivery工作?
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba6967 | 官方: 否 | 付费: 否
答案:
- Delivery is a very good company to work for. The company has been growing exponentially for the past 5 years and delhivery always gives credit for its success to its employees.
- Delhivery has a very good work-life balance and you will get to learn a lot while working for delhivery. The colleagues are very helpful and the HR team is also very supportive whenever you face any difficulty.
- In terms of compensation, Delhivery pays a good amount for candidates with extraordinary skills.
245. What is the salary for freshers in Delhivery?
Delhivery新员工的薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba696a | 官方: 否 | 付费: 否
答案:
Delhivery software developer salaries are very good. Delhivery pays its freshers an average salary of 8-10.1 lakhs per year for the Developer role. Delhivery's leading position is that of Senior Director, which comes with pay of ₹41.2 Lakhs per year. Those in the top one per cent earn more than ₹29.9 lakhs each year.
Delhivery软件开发人员的薪资非常优厚。Delhivery为开发岗位的新员工提供平均年薪8-10.1万卢比的薪酬。Delhivery的最高职位是高级总监,年薪为41.2万卢比。收入最高的百分之一人群每年收入超过29.9万卢比。
246. How long is the Interview Process at Delhivery?
Delhivery的面试流程需要多长时间?
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba696d | 官方: 否 | 付费: 否
答案:
The interview process starts with a coding test on the HackerEarth platform which is generally 90 min. If you qualify for that test, one week later you will have your interview scheduled which is of 60-90 min duration each. So it takes approximately 1-2 weeks for the interview process to complete.
面试流程始于HackerEarth平台上的编码测试,通常为90分钟。如果你通过该测试,一周后你将安排面试,每次面试时长60-90分钟。因此,整个面试流程大约需要1-2周完成。
247. What is the Eligibility Criteria at Delhivery?
Delhivery的资格标准是什么?
- 知识点: 其他/未分类 (标签: interviewbit, delhivery, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Delhivery
- id: 69b37a6e58d557c902ba6970 | 官方: 否 | 付费: 否
答案:
To apply for the role of software engineer at Delhivery, here are the required eligibility criteria: - Educational Qualification: BE/B.Tech (with any specialization)
要申请Delhivery软件工程师职位,以下是所需的资格标准:- 学历要求:BE/B.Tech(任何专业方向)
- GPA of 6.5 or more throughout with no running backlog
- Good Programming Skills.
- Good Analytical Skills.
Good Communication Skills.
Coding Problems
0/1
Easy Problems
简单问题
Heaps And Maps
堆与映射
K Largest Elements
K个最大元素
Easy
简单
20.34 Mins
20.34分钟
Solve
解答
0/1
Intermediate Problems
中级问题
Dynamic Programming
动态规划
Best Time to Buy and Sell Stock atmost B times
最多进行B次交易的最佳买卖股票时机
Medium
中等
64.27 Mins
64.27分钟
Solve
解答
248. Given a two-dimensional boolean array with each row sorted. There are m rows and n columns in the matrix. Find the row that has the most 1s in it.
给定一个二维布尔数组,其中每一行都已排序。矩阵有m行和n列。找出其中1的数量最多的那一行。
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba69a2 | 官方: 否 | 付费: 否
答案:
- Brute force method: An easy way is to traverse the matrix row by row, counting the amount of 1s in each row, and comparing the count to the maximum. Finally, with a maximum of 1s, return the index of the row. This approach has an O(m*n) time complexity, where m is the number of rows and n is the number of columns in the matrix.
- Optimized approach using binary search: We can still do better. We can use Binary Search to count the number of 1s in each row because each row is sorted. In each row, we obtain the index of the first occurrence of 1. The entire number of columns minus the index of the first 1 will equal the number of 1s. The time complexity for this approach will be O(mlogn).
- Further Optimization: The previous solution can be improved somewhat more. Instead of performing a binary search in each row, we first determine whether the row has more 1s than the maximum number of 1s. If there are additional 1s in the row, only count the 1s. We also don't execute a binary search across the entire row to count 1s in a row; instead, we search before the index of the last max. The worst-case time complexity is also O(mLogn), but the will solution performs better on average.
int rowWMax1s(bool matrixm)
int rowWMax1s(bool matrixm)
{
int i, index;
int i, index;
// Initialize maximum by using the values of the first row.
// 通过使用第一行的值来初始化最大值。
int max_rowIndex = 0;
int max_rowIndex = 0;
int maximum = first(matrix[0], 0, C - 1);
int maximum = first(matrix[0], 0, C - 1);
// count number of 1s while traversing each row
// 在遍历每一行时统计1的数量
// by checking the index of the first 1
// 通过检查第一个1的索引
for (i = 1; i < m; i++)
for (i = 1; i < m; i++)
{
// Count 1s for this row only; if this row
// 仅统计该行的1;如果该行
// has greater number of 1s than maximum so far
// 1的数量大于到目前为止的最大值
if (maximum != -1 && matrixi == 1)
if (maximum != -1 && matrixi == 1)
{
index = first (matrix[i], 0, n - maximum);
index = first (matrix[i], 0, n - maximum);
if (index != -1 && n - index > maximum)
if (index != -1 && n - index > maximum)
{
maximum = n - index;
maximum = n - index;
max_rowIndex = i;
max_rowIndex = i;
}
}
else
else
{
maximum = first(matrix[i], 0, n - 1);
maximum = first(matrix[i], 0, n - 1);
}
}
return max_rowIndex;
return max_rowIndex;
}
Here, the variable maximum is first initialized by using the values of the first row. We then check to see if the row has more 1s than the maximum number of 1s. Only count the 1s if there are any more in the row. To count 1s in a row, we don't run a binary search across the full row; instead, we search before the index of the last maximum.
这里,变量maximum首先通过使用第一行的值进行初始化。然后我们检查该行的1的数量是否大于最大1的数量。只有当行中有更多1时才进行计数。要统计一行中的1,我们不会对整个行运行二分搜索;而是在上一次最大值的索引之前进行搜索。
249. List the differences between Echo and Print in PHP.
列出PHP中Echo和Print之间的区别。
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba69a8 | 官方: 否 | 付费: 否
答案:
The functions of echo and print are nearly identical. Both are used to display info on the screen.
echo和print的功能几乎相同。两者都用于在屏幕上显示信息。
The differences are minor: - Echo returns nothing, whereas print returns 1 and can be used in expressions.
区别很小: - Echo不返回任何值,而Print返回1,并且可以用在表达式中。
- While echo can take many parameters, print only takes one.
Because echo does not return a value, it is faster than print.
Example:示例:
<!DOCTYPE html>
<!DOCTYPE html>
<?php
<?php
print "PHP is fun!
";
print "PHP is fun!
";
echo "PHP is fun.
";
echo "PHP is fun.
";
echo "PHP ", "is ", "fun.";
echo "PHP ", "is ", "fun.";
?>
Output:
输出:
PHP is fun!
PHP is fun!
PHP is fun.
PHP 很有趣。
PHP is fun.
PHP 很有趣。
The above example shows that echo can take many parameters whereas print cannot. We obtain a syntax error if we try to pass multiple parameters into print.
上述示例表明,echo 可以接受多个参数,而 print 则不能。如果我们尝试向 print 传递多个参数,就会遇到语法错误。
250. Discuss honeypots in context to Cyber Security.
在网络安全背景下讨论蜜罐。
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba69ae | 官方: 否 | 付费: 否
答案:
Honeypots are attack targets put up to study how different attackers try to exploit vulnerabilities. Honeypot is a spoof computer system that keeps track of all user transactions, interactions, and behaviours. The same idea, which is extensively utilised in academic settings, can be employed by private companies and governments to assess their risks.
蜜罐是设置好的攻击目标,用于研究不同攻击者如何尝试利用漏洞。蜜罐是一个诱饵计算机系统,它会记录所有用户事务、交互和行为。这一理念在学术环境中被广泛使用,私营公司和政府也可以采用它来评估自身风险。
Production Honeypots and research Honeypots are the two types of Honeypots available. - Production Honeypot: Its purpose is to collect genuine data in order for the administrator to access vulnerabilities. To improve security, they're usually installed inside production networks.
生产蜜罐和研究蜜罐是两种可用的蜜罐类型。- 生产蜜罐:其目的是收集真实数据,以便管理员访问漏洞。为了提高安全性,它们通常部署在生产网络内部。
- Research Honeypot: It is employed by educational institutions and organisations for the sole aim of examining the back-hat community's reasons and strategies for targeting various networks.
251. What is SMTP (Simple Mail Transfer Protocol) in Computer Networks?
在计算机网络中,SMTP(简单邮件传输协议)是什么?
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba69c1 | 官方: 否 | 付费: 否
答案:
Email is quickly becoming one of the most valuable services available on the internet. SMTP is the most used technique for transferring mail from one user to another over the internet. SMTP is a push protocol that is used to transmit mail. It is an application layer protocol. The client who wants to send the email establishes a TCP connection with the SMTP server and then sends the email via it. The SMTP server is always set to listen. The SMTP process establishes a connection as soon as it detects a TCP connection from any client. The client process sends the letter immediately after successfully establishing a TCP connection.
电子邮件正迅速成为互联网上最有价值的服务之一。SMTP 是在互联网上从一个用户向另一个用户传输邮件的最常用技术。SMTP 是一种用于传输邮件的推送协议。它是一种应用层协议。想要发送邮件的客户端会与 SMTP 服务器建立 TCP 连接,然后通过它发送邮件。SMTP 服务器始终处于监听状态。SMTP 进程一旦检测到来自任何客户端的 TCP 连接,就会立即建立连接。客户端进程在成功建立 TCP 连接后立即发送邮件。
252. List the differences between CSMA/CD (Carrier Sense Multiple Access / Collision Detection) and CSMA/CA (Carrier Sense Multiple Access / Collision Avoidance) in Computer Networks.
列出计算机网络中 CSMA/CD(载波侦听多路访问/冲突检测)和 CSMA/CA(载波侦听多路访问/冲突避免)之间的区别。
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba69c4 | 官方: 否 | 付费: 否
答案:
Carrier Sense Multiple Access / Collision Detection (CSMA/CD) is a carrier transmission network protocol. It is used in the medium access control layer (the layer that monitors the hardware which is responsible for the interaction with the wired, optical or wireless transmission medium). It detects if the shared channel for broadcasting is busy and interrupts the broadcast till the channel becomes available. Collisions in CSMA/CD are identified via broadcast sensing from other stations. In CSMA/CD, when a collision is detected, the transmission is halted and the stations send a jam signal, after which the station waits for a random time context before retransmission.
载波侦听多路访问/冲突检测(CSMA/CD)是一种载波传输网络协议。它用于介质访问控制层(该层监控负责与有线、光纤或无线传输介质交互的硬件)。它会检测用于广播的共享信道是否繁忙,并在信道可用之前中断广播。CSMA/CD 中的冲突通过来自其他站点的广播侦听来识别。在 CSMA/CD 中,当检测到冲突时,传输会停止,站点会发送阻塞信号,之后站点在重传前等待一个随机时间。
Carrier Sense Multiple Access / Collision Avoidance (CSMA/CA) is a carrier transmission network protocol. It operates in the same media access control layer as CSMA/CD. Unlike CSMA/CD, which only works after a collision, CSMA/CA works before a collision.
载波侦听多路访问/冲突避免(CSMA/CA)是一种载波传输网络协议。它运行在与 CSMA/CD 相同的介质访问控制层。与仅在冲突后工作的 CSMA/CD 不同,CSMA/CA 在冲突前工作。
| CSMA/CD | CSMA/CA |
|---|---|
| After a collision, CSMA/CD is effective. 冲突后,CSMA/CD 有效。 | CSMA / CA is effective before a collision. CSMA/CA 在冲突前有效。 |
| CSMA / CD is generally used in wired networks. CSMA/CD 通常用于有线网络。 | CSMA / CA is generally used in wireless networks. CSMA/CA 通常用于无线网络。 |
| CSMA / CD reduces the recovery time only. CSMA/CD 仅减少恢复时间。 | CSMA/ CA reduces the possibility of a collision. CSMA/CA 减少冲突的可能性。 |
| When a conflict develops, CSMA/CD resends the data frame. 当冲突发生时,CSMA/CD 会重发数据帧。 | The CSMA / CA will convey the intent to send for data transmission first, in case of a collision. 在冲突情况下,CSMA/CA 会先传达发送意图以进行数据传输。 |
253. What do you understand about tunneling protocol in Computer Networks?
在计算机网络中,你对隧道协议有何理解?
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba69c7 | 官方: 否 | 付费: 否
答案:
A tunneling protocol is a communications protocol that allows data to be moved from one network to another. Through a technique known as encapsulation, private network communications can be sent via a public network (such as the Internet).
隧道协议是一种通信协议,允许数据从一个网络移动到另一个网络。通过称为封装的技术,可以通过公共网络(如互联网)发送私有网络通信。
Because tunnelling entails repackaging traffic data into a different format, possibly with encryption as a standard, the nature of communication that passes via a tunnel can be hidden. The data component of a packet (the payload) is used by the tunnelling protocol to carry the packets that actually provide the service. Tunneling follows a layered protocol model, such as the OSI or TCP/IP protocol suites, but frequently breaks the layering by using the payload to convey a service that the network does not normally provide. In the layered approach, the delivery protocol is usually equal to or higher than the payload protocol.
由于隧道化涉及将流量数据重新打包为不同格式,可能还以加密为标准,因此通过隧道传输的通信性质可以被隐藏。隧道协议使用数据包的数据部分(有效载荷)来承载实际提供服务的包。隧道遵循分层协议模型,如 OSI 或 TCP/IP 协议套件,但经常通过使用有效载荷来传达网络通常不提供的服务,从而打破分层。在分层方法中,传递协议通常等于或高于载荷协议。
254. Discuss the physical layer of the OSI (Open Systems Interconnection) Model in context of Computer Networks.
在计算机网络背景下讨论 OSI(开放系统互连)模型的物理层。
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba69cd | 官方: 否 | 付费: 否
答案:
The physical layer is the lowest layer in the OSI reference model. It is in charge of establishing a physical connection between the devices. Bits of information are stored in the physical layer. It is in charge of sending individual bits from one node to another. When this layer receives data, it converts the signal received into 0s and 1s and sends them to the Data Link layer, which reassembles the frame.
物理层是OSI参考模型中的最低层。它负责在设备之间建立物理连接。信息比特存储在物理层中。它负责将单个比特从一个节点发送到另一个节点。当该层接收到数据时,它会将接收到的信号转换为0和1,并将其发送到数据链路层,数据链路层重新组装帧。
The physical layer's functions are as follows: - Bit synchronisation: A clock is provided by the physical layer, which allows the bits to be synchronised. This clock controls both the sender and the receiver, ensuring bit-level synchronisation.
物理层的功能如下:- 比特同步:物理层提供一个时钟,使比特能够同步。该时钟控制发送方和接收方,确保比特级同步。
- Bit rate control: The transmission rate, or the number of bits transferred per second, is likewise defined by the Physical layer.
- Physical topologies: The physical layer defines the arrangement of devices/nodes in a network, such as bus, star, or mesh topologies.
- Transmission mode: The physical layer also specifies how data is passed between the two linked devices. Simplex, half-duplex, and full-duplex transmission modes are available.
255. Differentiate between Hash join, Sort Merge join and Nested Loop join in DBMS.
区分数据库管理系统(DBMS)中的哈希连接、排序合并连接和嵌套循环连接。
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba69d0 | 官方: 否 | 付费: 否
答案:
- Hash-join: A hash join is a form of physical join method that is used to join two tables internally. The fact that the join is an internal join technique implies that we can't see it. The query optimizer does the join selection automatically.
- Sort Merge Join: In the case of sorted relations, the Sort Merge Join is the quickest join. This join, like the nested loop join, is an internal join. We can't observe or implement the algorithm; all we can do is direct the engine to utilize it. The merge and sort phases of this method are used for combining and sorting tasks, respectively.
- Nested Loop join: In a nested loop join, the driving table (main) retrieves rows by index range scan, and the driving table's result set is nested with the probing of the other (secondary) table via the index scan method.
256. Explain the DDL (Data Definition Language), DML (Data Manipulation Language) and DCL (Data Control Language) statements in SQL.
解释SQL中的DDL(数据定义语言)、DML(数据操作语言)和DCL(数据控制语言)语句。
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba69d3 | 官方: 否 | 付费: 否
答案:
- DDL: The Data Definition Language is a set of SQL queries that are used to specify the database and schema structure, such as CREATE, ALTER, TRUNCATE, DROP, and RENAME.
- DCL: The Data Control Language is a set of SQL instructions that are used to control user access to the database. It includes operations like GRANT and REVOKE.
- DML: Data Manipulation Language is used to manage data using SQL queries such as SELECT, INSERT, DELETE, and UPDATE.
257. What is a Kernel in OS?
操作系统中的内核是什么?
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba69d6 | 官方: 否 | 付费: 否
答案:
Kernel is a component of an operating system that manages computer and hardware functions. It primarily oversees memory and CPU functions. It's a crucial part of any operating system. Kernel serves as a link between applications and hardware-based data processing via inter-process communication and system calls.
内核是操作系统中管理计算机和硬件功能的组件。它主要负责内存和CPU功能。它是任何操作系统的关键部分。内核通过进程间通信和系统调用,在应用程序和基于硬件的数据处理之间充当链接。
When an operating system is loaded, the kernel is loaded initially and remains in memory until the operating system is shut down. It's in charge of things like disk utility, task management, and memory management. It determines which processes should be assigned to the CPU and which should be kept in the main memory for execution. It basically serves as an interface between user software and hardware. The kernel's primary goal is to manage communication between software, such as user-level applications, and hardware, such as the CPU and disc memory.
当操作系统被加载时,内核首先被加载并驻留在内存中,直到操作系统关闭。它负责磁盘实用程序、任务管理和内存管理等事务。它决定哪些进程应分配给CPU,哪些应保留在主内存中执行。它基本上充当用户软件和硬件之间的接口。内核的主要目标是管理软件(如用户级应用程序)和硬件(如CPU和磁盘内存)之间的通信。
258. How does reference counting deal with objects that are memory allocated in context to OS? When does it fail to reclaim objects?
引用计数如何处理在操作系统上下文中内存分配的对象?它何时无法回收对象?
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba69dc | 官方: 否 | 付费: 否
答案:
Every object gains a count of how many times it has been referred to in the context of reference counting. Every time a reference to that item is made, the count is increased. A reference's value is also decremented every time it is deleted. This operation continues until the reference count reaches zero. When an object's reference count reaches 0, the object can be recovered. By preserving a count in each object, reference counting systems may do autonomous memory management. Any object without a reference count can be regarded as "dead," and its memory can be recovered.
在引用计数的上下文中,每个对象都会获得一个计数,表示它被引用的次数。每次对该对象的引用被创建时,计数会增加。每次引用被删除时,其值也会递减。此操作持续到引用计数达到零。当对象的引用计数达到0时,该对象可以被回收。通过在每个对象中保留计数,引用计数系统可以实现自主内存管理。任何没有引用计数的对象都可以被视为“死亡”,其内存可以被回收。
In the situation of cyclic references, the reference counting method may fail to reclaim objects. There are no concrete solutions to this problem, therefore it is usually recommended to design architecture without circular references.
在循环引用的情况下,引用计数方法可能无法回收对象。对于这个问题没有具体的解决方案,因此通常建议设计架构时避免循环引用。
259. What is the difference between declaration and definition for a variable or a function in C?
在C语言中,变量或函数的声明和定义之间有什么区别?
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba69e5 | 官方: 否 | 付费: 否
答案:
The declaration of a variable or function simply states that it exists at some place in the program but that no memory has been allocated for it. The declaration of a variable or function is crucial because it informs the program about the type of the variable or function. It also tells the program the arguments, their data types, the order of those arguments, and the function's return type in the case of function declarations. That concludes the declaration.
变量或函数的声明仅说明它在程序中的某个位置存在,但没有为其分配内存。变量或函数的声明至关重要,因为它告知程序该变量或函数的类型。对于函数声明,它还告知程序参数、参数的数据类型、这些参数的顺序以及函数的返回类型。这就是声明的内容。
In relation to the definition, defining a variable or function does more than just declare it; it also allocates memory for that variable or function. As a result, we can consider declaration to be a subset of definition (or declaration as a superset of definition).
关于定义,定义变量或函数不仅声明它,还为该变量或函数分配内存。因此,我们可以将声明视为定义的子集(或定义视为声明的超集)。
Variable:
变量:
A variable is defined and declared at the same time in the C programming language. There is no distinction between declaration and definition for a variable in C, in other words.
在C编程语言中,变量是同时定义和声明的。换句话说,在C中,变量的声明和定义没有区别。
Example:
示例:
int x;
int x;
The information, such as the variable name: x and the data type: int, is passed to the compiler and is saved in the symbol table data structure. A memory of size 2 bytes will also be allocated (depending on the type of compiler).
诸如变量名:x 和数据类型:int 等信息会传递给编译器,并保存在符号表数据结构中。还将分配大小为2字节的内存(取决于编译器类型)。
If we merely want to declare variables and not define them, i.e. we don't want to allocate memory space, we can use the following declaration:
如果只想声明变量而不定义它们,即不想分配内存空间,可以使用以下声明:
extern int x;
extern int x;
Only the information about the variable is sent in this example, and no memory is allocated. The above information informs the compiler that variable an is declared now, but memory for it will be defined later, either in the same file or in a separate file.
此示例中仅发送了变量的信息,且不分配内存。上述信息告知编译器变量an现已声明,但其内存将在稍后定义,无论是在同一文件还是单独文件中。
Function:
函数:
The function declaration provides to the compiler, the name of the function, the number and type of arguments it accepts, and the return type. Consider the following code, for example:
函数声明向编译器提供函数名、接受的参数数量和类型以及返回类型。例如,考虑以下代码:
int sum (int, int);
int sum (int, int);
A function named sum is declared with two int arguments and an int return type. At this time, no memory will be allocated.
声明了一个名为sum的函数,带有两个int参数和int返回类型。此时不会分配内存。
Allocating memory for the function is based on the function's definition. Consider the following function definition, for example:
函数的内存分配取决于函数的定义。例如,考虑以下函数定义:
int sum (int x, int y)
int sum (int x, int y)
{
return (x+y);
return (x+y);
}
The memory for the function add will be allocated during this function definition. A variable or function can be declared as many times as needed, but it can only be defined once.
函数add的内存将在该函数定义期间分配。变量或函数可以根据需要多次声明,但只能定义一次。
260. What are the different storage classes in C?
C语言中有哪些不同的存储类?
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba69e8 | 官方: 否 | 付费: 否
答案:
Storage Classes are used to specify a variable or function's characteristics. These characteristics include scope, visibility, and lifetime, which allow us to track the presence of a variable during the course of a program's execution. The C programming language has four storage classes: - Auto: For all variables declared inside a function or a block, this is the default storage class. Auto variables can only be used within the block/function in which they were declared, not outside of it (which defines their scope). They can, however, be accessed outside of their scope using the idea of pointers, which are used to point to the actual memory address where the variables are stored. Whenever they are declared, they are given a garbage value by default.
存储类用于指定变量或函数的特性。这些特性包括作用域、可见性和生命周期,它们允许我们在程序执行过程中跟踪变量的存在。C编程语言有四种存储类:- Auto:对于在函数或块内声明的所有变量,这是默认存储类。Auto变量只能在使用它们声明的块/函数内使用,不能在其外部使用(这定义了它们的作用域)。但是,可以使用指针的概念在其作用域之外访问它们,指针用于指向存储变量的实际内存地址。每当我们声明它们时,默认会赋予一个垃圾值。
- Extern: Extern storage class simply indicates that the variable is defined outside of the block in which it is used. Essentially, the value is assigned to it in a different block, and this can also be overwritten/changed in another block. A regular global variable can also be made extern by including the 'extern' keyword before its declaration or definition in any function or block. This means we're not creating a new variable; instead, we're merely using/accessing the global variable. Variables and functions can have their visibility extended using the extern keyword. The usage of extern in function declarations or definitions is unnecessary because functions are visible throughout the program by default. Its application is implicit. When you use extern with a variable, you're merely declaring it, not defining it.
- Static: This storage class is used to declare static variables, which are commonly used in C language programs. Static variables have the ability to retain their value even after they have been removed from their scope!. As a result, we can claim that they are only initialised once and exist till the program ends. Because they are not re-declared, no new memory is allocated. They have a limited scope that is limited to the role to which they were assigned. The program's global static variables can be accessed from anywhere in the code. The compiler assigns the value 0 to them by default.
- Register: This storage class declares register variables, which are similar to auto variables in functionality. The only difference is that if a free registration is available, the compiler tries to store these variables in the register of the CPU. If no free registers are available, these are stored solely in memory. The register keyword is used to define a few variables that will be accessed frequently in a program, which reduces the program's run time. The address of a register variable cannot be obtained via pointers, which is a crucial point to remember.
Deloitte Interview Preparation
261. Are Deloitte interviews hard?
德勤的面试难吗?
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba6a02 | 官方: 否 | 付费: 否
答案:
Whether the Deloitte interview is challenging or simple makes no difference. The truth is that the more you prepare for the interview, the better your chances of succeeding are. Learn everything there is to know about interview stages, rounds, and questions, among other things. Understand the role completely, including what they anticipate from you, the skill sets you'll need, and the qualifications you'll need.
德勤面试是难是简单并无区别。事实是,你为面试准备得越充分,成功的机会就越大。了解面试阶段、轮次和问题等所有相关信息。完全理解职位角色,包括他们期望你具备什么、你需要哪些技能,以及你需要哪些资质。
262. Where do you see yourself in 5 years?
你未来5年的规划是什么?
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba6a05 | 官方: 否 | 付费: 否
答案:
Tell them that you wish to learn about and master a specific technology. You should be able to persuade them that you intend to stay with the organization for a longer time. "I want to be more skilled, more confident, and maintain a prominent position in your firm," you might remark. For seasoned professionals, you can begin by saying, "Within the next five years, I want to be recognized as an authority in this subject." The recruiter is solely interested in learning how long you expect to stay with the company and how happy you are with the current role for which you will be employed.
告诉他们你希望学习并精通某项特定技术。你应该能说服他们你想长期留在公司。你可以说:“我想变得更熟练、更自信,并在贵公司保持重要地位。”对于有经验的专业人士,你可以先说:“在未来五年内,我想成为这个领域的权威。”招聘者只关心你打算在公司待多久,以及你对即将担任的职位有多满意。
263. What is your salary expectation?
你的期望薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba6a08 | 官方: 否 | 付费: 否
答案:
This is a difficult one. You may or may not opt to quote the actual amount, but you must inform them of the percentage raise you are considering. Don't ask for a certain salary; instead, demonstrate your devotion to the position.
这个问题比较难。你可以选择不报具体金额,但必须告知他们你考虑的加薪百分比。不要要求特定薪资,而是展示你对职位的投入。
264. Why should we hire you Deloitte?
为什么我们应该聘用你加入德勤?
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba6a0e | 官方: 否 | 付费: 否
答案:
The interviewer is trying to figure out whether you'd be a good fit for their company. As a result, you'll have to convince them. "I am a quick learner who can swiftly assimilate something new to me," is how you can frame it. Here you can talk about your abilities, skills, and past experiences, as well as how you can add something new to the role.
面试官在试图判断你是否适合他们公司。因此,你必须说服他们。你可以这样表述:“我是一个快速学习者,能迅速吸收新事物。”在这里,你可以谈论你的能力、技能和过往经验,以及你如何为该职位带来新东西。
265. How do you handle stress or tight deadlines?
你如何处理压力或紧迫的截止日期?
- 知识点: 其他/未分类 (标签: interviewbit, deloitte, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 德勤
- id: 69b37a6f58d557c902ba6a15 | 官方: 否 | 付费: 否
答案:
Employers are looking for instances of how stressful conditions motivate you or how you may minimize stressful situations with proper planning and good communication skills. Give an example of how you dealt with a challenging scenario at a previous job to demonstrate your ability to perform under pressure.
雇主寻找的是压力环境如何激励你,或你如何通过合理规划和良好沟通技巧来减少压力情况的例子。给出一个你在之前工作中处理挑战性场景的例子,以展示你在压力下工作的能力。
Coding Problems
0/2
Easy Problems
简单问题
Arrays
数组
Max Sum Contiguous Subarray
最大连续子数组和
Easy
简单
33.39 Mins
33.39分钟
Solve
解答
Product of All
所有元素的乘积
Easy
简单
34.4 Mins
34.4分钟
Solve
解答
0/4
Intermediate Problems
中级问题
Arrays
数组
Hashing
哈希
Dynamic Programming
动态规划
First Missing Integer
第一个缺失的正整数
Medium
中等
64.38 Mins
64.38分钟
Solve
解答
Anagrams
字谜
Medium
中等
46.36 Mins
46.36分钟
Solve
解答
Coin Sum Infinite
硬币求和无限
Medium
中等
65.18 Mins
65.18分钟
Solve
解答
Dice Rolls
掷骰子
Medium
中等
27.24 Mins
27.24分钟
Solve
解答
0/1
Advanced Problems
进阶问题
Math
数学
Find Nth Fibonacci
查找第N个斐波那契数
Hard
困难
55.0 Mins
55.0分钟
Solve
解答
266. What do you understand about Network Reliability? State the criteria to check the network reliability.
你对网络可靠性有何理解?说明检查网络可靠性的标准。
- 知识点: 其他/未分类 (标签: interviewbit, dxc, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: DXC Technology
- id: 69b37ab758d557c902ba94c9 | 官方: 否 | 付费: 否
答案:
Network dependability refers to the network's capacity to perform the requested operation through a network, such as communication. In order for a network to function well, it must be reliable. The network monitoring systems and devices are necessary for the network to be reliable. The network monitoring system detects network faults, while network devices ensure that data reaches its intended destination.
网络可靠性指的是网络执行通过网络(如通信)所请求操作的能力。为了使网络正常运行,它必须是可靠的。网络监控系统和设备对于网络的可靠性是必要的。网络监控系统检测网络故障,而网络设备确保数据到达预期目的地。
The following factors can be used to assess a network's reliability: - Downtime: Downtime is defined as the amount of time it takes for a network to recover.
以下因素可用于评估网络的可靠性:- 停机时间:停机时间定义为网络恢复所需的时间。
- Failure Frequency: This is the number of times a network fails to work as anticipated.
- Catastrophe: It means that the network has been hit by an unforeseen incident, such as a fire or an earthquake.
267. What do you understand about Data Independence?
你对数据独立性有何理解?
- 知识点: 其他/未分类 (标签: interviewbit, dxc, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: DXC Technology
- id: 69b37ab758d557c902ba94d2 | 官方: 否 | 付费: 否
答案:
Data independence is a notion that states that changes in data at one level of a three-tier DataBase Management System design should not affect data at another level. There are two types of data independence: Physical data independence and Conceptual data independence. - Physical Data Independence: Any change in the physical location of tables and indexes should have no impact on the conceptual level or the external display of data, according to Physical Data Independence. The majority of Database Management Systems offer this data independence, which is straightforward to establish.
数据独立性是一种概念,它指出三层数据库管理系统设计中某一层级的数据变化不应影响另一层级的数据。数据独立性有两种类型:物理数据独立性和概念数据独立性。- 物理数据独立性:根据物理数据独立性,表和索引物理位置的任何变化都不应影响概念层或数据的外部显示。大多数数据库管理系统提供这种数据独立性,并且这种独立性易于建立。
- Conceptual Data Independence: Data at the conceptual and external levels must be independent, according to Conceptual Data Independence. Any changes to the conceptual schema should have no effect on the external schema. Changing the appearance of a table by adding or removing features, for example, should have no impact on the user's view of the table. This type of independence, however, is more difficult to accomplish than physical data independence since changes in conceptual schema are mirrored in the user's view.
268. What do you understand about inline functions?
你对内联函数有什么理解?
- 知识点: 其他/未分类 (标签: interviewbit, dxc, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: DXC Technology
- id: 69b37ab758d557c902ba94d5 | 官方: 否 | 付费: 否
答案:
In C or C++, an inline function is a function that is declared using the keyword "inline." It has two functions: - It is a compiler directive that requests that the compiler replace the body of the function inline by performing inline expansion, that is, placing the function code at the location of each function call, thus reducing the overhead of a function call (it is not mandatory for the compiler to comply with the request of the inline function). In this way, it is analogous to the register storage class specifier, which also provides an optimization indication. For frequent calls to the same function, inline functions are typically employed.
在C或C++中,内联函数是使用关键字“inline”声明的函数。它有两个作用:- 它是一个编译器指令,请求编译器通过执行内联扩展来替换函数的函数体,即将函数代码放置在每次函数调用的位置,从而减少函数调用的开销(编译器并非必须遵从内联函数的请求)。这样,它与寄存器存储类说明符类似,后者也提供优化指示。对于频繁调用同一函数的情况,通常采用内联函数。
The keyword "inline" has a second goal: to change the behaviour of links. The C/C++ separate compilation and linkage architecture requires this, in part because the function's definition (body) must be reproduced in all translation units where it is used to allow inlining during compilation, which causes a collision during linking if the function has external linkage (it violates uniqueness of external symbols). C and C++ (as well as dialects such as GNU C and Visual C++) handle this in different ways.
Given below is an example to understand inline functions in a better way:下面提供一个示例,以便更好地理解内联函数:
inline void multiplyNums(int x, int y)
inline void multiplyNums(int x, int y)
{
int answer = x * y;
int answer = x * y;
printf("Product of the two numbers given is: %d", answer);
printf("Product of the two numbers given is: %d", answer);
}
Let us assume that the above inline function is called at someplace in the main function of our C program as shown below:
假设上述内联函数在我们的C程序的主函数中的某个位置被调用,如下所示:
int i = 20;
int i = 20;
int j = 40;
int j = 40;
multiplyNums(i, j);
multiplyNums(i, j);
Note that the "multiplyNums(i, j);" function call will be replaced by the following piece of code in the main function itself by the C compiler:
注意,“multiplyNums(i, j);”函数调用将被C编译器在主函数中替换为以下代码片段:
int i = 20;
int i = 20;
int j = 40;
int j = 40;
int answer = i * j;
int answer = i * j;
printf("Product of the two numbers given is: %d", answer);
printf("Product of the two numbers given is: %d", answer);
269. What are the unary operations in Relational Algebra in context to SQL.
在SQL背景下,关系代数中的一元运算有哪些?
- 知识点: 其他/未分类 (标签: interviewbit, dxc, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: DXC Technology
- id: 69b37ab758d557c902ba94d8 | 官方: 否 | 付费: 否
答案:
In Relational Algebra, one operand operations are known as unary operations. The procedures PROJECTION, SELECTION, and RENAME are unary operations in relational algebra: - The SELECT operation: The SELECT operation selects a subset of tuples from a relation that fulfils a set of criteria. The SELECT operation is a filter that keeps only those tuples that fulfil a set of criteria. Alternatively, you may use the SELECT method to limit the tuples to those that fulfil the criteria. The SELECT operation can be thought of as dividing the relation horizontally into two groups of tuples: those that meet the criteria and are selected, and those that do not and are rejected.
在关系代数中,单操作数的运算被称为一元运算。投影、选择和重命名过程是关系代数中的一元运算:- 选择操作:选择操作从关系中选取满足一组条件的元组子集。选择操作是一个过滤器,只保留满足一组条件的元组。或者,您可以使用选择方法将元组限制为满足条件的那些。选择操作可以被视为将关系水平划分成两组元组:满足条件并被选中的,以及不满足条件而被拒绝的。
- The PROJECT operation: If a relation is viewed as a table, the SELECT operation selects certain rows while discarding others. In contrast, the PROJECT operation selects a subset of the table's columns while rejecting the remainder. We can use the PROJECT operation to project a relation over just a few of its attributes if we're just interested in a few of them. As a result, the result of the PROJECT operation can be viewed as a vertical partition of the relation into two relations: one with the needed columns (attributes) and the operation's result, and the other with the rejected columns.
The RENAME operation: It is occasionally simple and suitable to break a complicated chain of operations and rename it as a relation with new names. Renaming a relationship can be done for a variety of reasons, including:
It is possible that we'll want to save a relation as the result of a relational algebra expression. It is possible that we'll want to join a relation to itself.我们有可能希望将关系代数表达式的结果保存为一个关系。我们也有可能希望将关系与自身进行连接。
270. What happens when we try to connect to any website, for instance, when we try to visit www.facebook.com ?
当我们尝试连接到任何网站时,例如尝试访问www.facebook.com,会发生什么?
- 知识点: 其他/未分类 (标签: interviewbit, dxc, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: DXC Technology
- id: 69b37ab758d557c902ba94de | 官方: 否 | 付费: 否
答案:
When we try to connect to any website, for instance, when we try to visit www.facebook.com the following steps take place: - The browser cache is first checked to see if the content is fresh and whether it is present in the browser cache or not. If it is present in the browser cache, then it is displayed.
当我们尝试连接到任何网站时,例如尝试访问www.facebook.com,会经历以下步骤:- 首先检查浏览器缓存,看内容是否新鲜以及是否存在于浏览器缓存中。如果存在于浏览器缓存中,则将其显示。
- If not present in the browser cache, the browser checks if the URL's IP address is in the cache (browser and OS), and if it is not, it asks the Operating System to perform a DNS (Domain Name System) search using UDP (User Datagram Protocol ) to obtain the URL's (Uniform Resource Locator) associated IP address from the DNS server, and then establishes a new TCP connection.
- Three-way handshaking establishes a new TCP connection between the browser and the server.
- The TCP connection is used to send an HTTP request to the server.
- The web servers on the Servers process HTTP requests and respond with HTTP responses.
- The browser decodes the server's HTTP answer and decides whether to close or reuse the TCP connection for future requests.
- If the data in the response is cacheable, browsers will save it.
- The response is decoded by the browser.
271. What are some of the benefits of using a Virtual Private Network (VPN)?
使用虚拟专用网络(VPN)有哪些好处?
- 知识点: 其他/未分类 (标签: interviewbit, dxc, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: DXC Technology
- id: 69b37ab758d557c902ba94e4 | 官方: 否 | 付费: 否
答案:
The following are some of the benefits of using a VPN: - When compared to Wide Area Network connections, VPN is used to connect offices in different geographical locations remotely.
以下是使用VPN的一些好处:- 与广域网连接相比,VPN用于远程连接不同地理位置的办公室。
- VPNs are used to safeguard transactions and move secret data between workplaces in different parts of the world.
- By using virtualization, a VPN protects an organization's information safe from any potential threats or invasions.
- VPN encrypts internet traffic and hides the user's identity online.
272. What do you understand about a Virtual Private Network or a VPN? What are the different types of VPNs?
你对虚拟专用网络或VPN有何理解?VPN有哪些不同类型?
- 知识点: 其他/未分类 (标签: interviewbit, dxc, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: DXC Technology
- id: 69b37ab758d557c902ba94e7 | 官方: 否 | 付费: 否
答案:
A virtual private network (VPN) extends a private network across a public network, allowing users to send and receive data as if their computers were physically linked to the private network. Increased functionality, security, and control of the private network are all advantages of using a VPN. It is frequently used by telecommuting workers to gain access to resources that are not available on the public network. Although encryption is widespread, it is not a requirement of a VPN connection. A VPN is formed by using dedicated circuits or tunnelling technologies to build a virtual point-to-point connection over existing networks. Some of the benefits of a wide area network can be obtained using a VPN accessible via the public Internet (WAN). The resources provided within the private network can be accessed remotely from the user's perspective.
虚拟专用网络(VPN)通过公共网络扩展私有网络,允许用户发送和接收数据,就像他们的计算机物理连接到私有网络一样。增加的功能、安全性和对私有网络的控制都是使用VPN的优点。远程办公人员经常使用它来访问公共网络上不可用的资源。尽管加密很普遍,但它不是VPN连接的必要条件。VPN是通过使用专用电路或隧道技术在现有网络上构建虚拟点对点连接而形成的。使用可通过公共互联网访问的VPN,可以获得广域网(WAN)的一些好处。从用户的角度来看,私有网络内提供的资源可以被远程访问。
The different types of VPNs are as follows: - Access VPN: Access VPN is a type of virtual private network that allows remote mobile users and telecommuters to connect to the internet. It can be used as a substitute for dial-up or ISDN (Integrated Services Digital Network) connections. It is a low-cost option with a wide range of connectivity options.
VPN的不同类型如下:- 访问VPN:访问VPN是一种虚拟专用网络,允许远程移动用户和远程办公人员连接到互联网。它可以作为拨号或ISDN(综合业务数字网)连接的替代品。这是一种低成本选项,具有广泛的连接选择。
Site to Site VPN: A Site to Site VPN, also known as a Router to Router VPN, is a type of virtual private network that connects the networks of two offices in different locations. As listed below, there are two subcategories:
Intranet VPN: An intranet VPN connects remote offices in different geographic areas using common infrastructure (internet connectivity and servers) and the same accessibility policies as a private WAN (wide area network).内联网VPN:内联网VPN使用公共基础设施(互联网连接和服务器)和与私有广域网(WAN)相同的可访问策略,连接不同地理区域的远程办公室。
Extranet VPN: Extranet VPN connects intranet users, suppliers, consumers, partners, and other entities via dedicated connections using shared infrastructure.
外联网VPN:外联网VPN通过使用共享基础设施的专用连接,连接内联网用户、供应商、消费者、合作伙伴和其他实体。
273. Define abstract classes. Can we create objects or instances of abstract classes?
定义抽象类。我们能否创建抽象类的对象或实例?
- 知识点: 其他/未分类 (标签: interviewbit, dxc, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: DXC Technology
- id: 69b37ab758d557c902ba94ea | 官方: 否 | 付费: 否
答案:
A class with abstract methods is known as an abstract class. Although these methods are declared, they are not defined in the abstract classes. If these methods are to be utilized in a subclass, they must be specified in that subclass solely.
具有抽象方法的类被称为抽象类。虽然这些方法被声明,但它们没有在抽象类中定义。如果这些方法要在子类中使用,则必须在子类中单独指定。
No, we cannot create objects or instances of abstract classes. Because an abstract class lacks a complete implementation, no instances can be produced. It is possible to build instances of subclasses that inherit the abstract class.
不,我们不能创建抽象类的对象或实例。因为抽象类缺乏完整的实现,所以不能产生实例。可以构建继承抽象类的子类的实例。
274. What are the key differences between an abstract class and an interface.
抽象类和接口之间的关键区别是什么?
- 知识点: 其他/未分类 (标签: interviewbit, dxc, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: DXC Technology
- id: 69b37ab758d557c902ba94ed | 官方: 否 | 付费: 否
答案:
The key differences between an abstract class and an interface are as follows:
抽象类和接口之间的关键区别如下:
| Comparison Parameter 比较参数 | Abstract Class 抽象类 | Interface 接口 |
|---|---|---|
| Usage 用途 | Abstract Classes are extended. 抽象类被继承。 | Interfaces are implemented. 接口被实现。 |
| Final Variables 最终变量 | Abstract classes can or cannot contain final variables and non-final variables 抽象类可以包含或不包含最终变量和非最终变量 | In interfaces, all variables are final by default. 在接口中,所有变量默认是最终的。 |
| Accessibility of Data Members 数据成员的可访问性 | Abstract classes can be private, public, etc. 抽象类可以是私有的、公有的等。 | Interfaces are public by default. 接口默认是公有的。 |
| Methods 方法 | Abstract, as well as other types of methods, are allowed in abstract classes. 抽象类中允许抽象方法以及其他类型的方法。 | Only abstract methods can be present in an interface. 接口中只能存在抽象方法。 |
| Implementation 实现 | Abstract classes cannot be implemented. 抽象类不能被实现。 | Interfaces can be implemented. 接口可以被实现。 |
275. Discuss some of the limitations of inheritance.
讨论继承的一些局限性。
- 知识点: 其他/未分类 (标签: interviewbit, dxc, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: DXC Technology
- id: 69b37ab758d557c902ba94f2 | 官方: 否 | 付费: 否
答案:
Some of the limitations of inheritance are as follows: - Jumping back and forth between different classes lengthens the time and effort required to complete a program.
继承的一些局限性如下:在不同类之间来回跳转会延长完成程序所需的时间和精力。
- The parent and child classes become inextricably linked.
- Any changes to the program would necessitate changes in both the parent and child classes.
- It necessitates careful implementation or else, wrong results will follow.
276. Why do you want to choose DXC Technology as your place of work?
你为什么选择DXC Technology作为你的工作场所?
- 知识点: 其他/未分类 (标签: interviewbit, dxc, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: DXC Technology
- id: 69b37ab758d557c902ba950f | 官方: 否 | 付费: 否
答案:
A sample answer to the given question can be as follows:
对给定问题的示例回答可以如下:
“DXC Technology attracts and retains top talent by providing inclusive and fast-growing opportunities through a digital learning environment that can be accessed anywhere, anytime, on any device. DXC Technology is a great place to start a new employee's career as they provide a great work environment that promotes personal and corporate development. These are some of the reasons why aspiring programmers today look forward to joining DXC.”
“DXC Technology通过提供一种可在任何地点、任何时间、任何设备上访问的数字学习环境,吸引和留住顶尖人才,提供包容且快速成长的机会。DXC Technology是新员工职业发展的绝佳起点,因为他们提供了促进个人和企业发展的良好工作环境。这些都是当今有志程序员期待加入DXC的一些原因。”
277. Is the DXC Technology interview easy?
DXC Technology的面试容易吗?
- 知识点: 其他/未分类 (标签: interviewbit, dxc, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: DXC Technology
- id: 69b37ab758d557c902ba9512 | 官方: 否 | 付费: 否
答案:
It does not matter if the DXC Technology interview is tough or easy. The truth is that the more ready you are for the interview, the easier it will be to pass the interview. Above all, get a good understanding of the interview stage, rounds, and questions. Candidate resumes (past experience, past activities) and job requirements are used to conduct the interview. Topics covered include programming languages, inference, products, software, and projects that candidates have recently or previously worked on. Therefore, one should not think a lot about the toughness of the interview and instead focus on how to improve their technical and cultural skills.
DXC Technology的面试是难是易并不重要。事实是,你为面试准备得越充分,通过面试就越容易。最重要的是,要详细了解面试阶段、轮次和问题。面试是根据应聘者的简历(过往经验、过往活动)和工作要求进行的。涵盖的主题包括编程语言、推理、产品、软件以及应聘者最近或以前参与过的项目。因此,不应过多考虑面试的难度,而应专注于如何提高自己的技术和文化技能。
278. What are DXC CLEAR values?
DXC CLEAR价值观是什么?
- 知识点: 其他/未分类 (标签: interviewbit, dxc, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: DXC Technology
- id: 69b37ab758d557c902ba951c | 官方: 否 | 付费: 否
答案:
The DXC Technology company's CLEAR Values is an acronym for Client focused, Leadership, Execution, Aspiration, Results . These are the basic five cultural principles that guide the instincts of the employees at this company and inform their actions. Every employee in the company is expected to imbibe these principles and put them into action in their day to day lives as members of DXC Technology.
DXC Technology公司的CLEAR价值观是客户关注(Client focused)、领导力(Leadership)、执行(Execution)、抱负(Aspiration)、结果(Results)的首字母缩写。这是指导公司员工本能并影响其行为的五项基本文化原则。公司每位员工都应践行这些原则,并将其落实到作为DXC Technology成员的日常工作中。
279. What are some of the most important topics to prepare for a DXC Technology Interview?
为准备DXC Technology面试,最重要的主题有哪些?
- 知识点: 其他/未分类 (标签: interviewbit, dxc, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: DXC Technology
- id: 69b37ab758d557c902ba951f | 官方: 否 | 付费: 否
答案:
In the DXC Technology Interview, you will be tested on your programming skills. Computer networking, DBMS, software management, operating systems, and cloud computing are some of the topics on which students will be asked questions. Prepare well for the projects which you have made. Preparing the basics of HTML, C, C++, and other computer-related topics also might help. Prepare the topics mentioned in your resume. The most frequently asked questions in employee interviews are about relocation, resume, reasons for leaving, and expected salary. You can also ask questions about your company. Scroll to the above section to Learn More .
在DXC Technology面试中,你将在编程技能方面接受测试。计算机网络、数据库管理系统、软件管理、操作系统和云计算是学生可能被问及的一些主题。为你所做过的项目做好充分准备。准备HTML、C、C++和其他计算机相关主题的基础知识也可能有所帮助。准备简历中提到的主题。员工面试中最常问的问题是有关搬迁、简历、离职原因和期望薪资。你也可以询问关于公司的问题。滚动到上述部分以了解更多。
280. Why are you suitable for this position?
你为什么适合这个职位?
- 知识点: 其他/未分类 (标签: interviewbit, dxc, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: DXC Technology
- id: 69b37ab758d557c902ba9522 | 官方: 否 | 付费: 否
答案:
When asked a question like this, one should highlight the skills and abilities that are relevant to the job to have a positive impact on the interviewer and make him or her feel that you are an ideal candidate for the job. An example of a typical answer to this question is:
当被问到这样的问题时,应突出与工作相关的技能和能力,以便给面试官留下积极印象,让他或她觉得你是该职位的理想候选人。对这个问题的一个典型回答示例是:
“There are many reasons as to why I am suitable for this position, but most importantly, I am convinced that I am worthy of this position because I have the will to succeed. I have all the skills I need to be successful in this profession. I am constantly working to learn the latest technologies. My abilities and skills are well suited for the requirements of this post. Last, of all, my communication and leadership qualities make me an excellent candidate for this position.”
“有很多理由说明我适合这个职位,但最重要的是,我确信自己配得上这个职位,因为我有成功的意志。我拥有在这个职业中取得成功所需的所有技能。我不断学习最新技术。我的能力和技能非常适合这个职位的要求。最后,我的沟通和领导能力使我成为这个职位的优秀候选人。”
281. What is the salary of an Associate Software Developer (fresher) at DXC Technology?
DXC Technology的助理软件开发人员(应届生)薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, dxc, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: DXC Technology
- id: 69b37ab758d557c902ba9525 | 官方: 否 | 付费: 否
答案:
The average compensation for a DXC Technology Associate Software Developer (Fresher) is Rs. 3,60,000 per year. At DXC Technology, fresher wages can range from Rs. 3,00,000 to Rs. 5,00,000 per year.
DXC Technology助理软件开发人员(应届生)的平均薪酬为每年36万卢比。在DXC Technology,应届生工资范围可以是每年30万到50万卢比。
282. What happens when a method or variable contains the static keyword?
当方法或变量包含static关键字时会发生什么?
- 知识点: 其他/未分类 (标签: interviewbit, epam, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: EPAM Systems
- id: 69b37aea58d557c902bab2cb | 官方: 否 | 付费: 否
答案:
Static keywords are mainly used for memory management in Java, and can be used with blocks, methods, variables, and nested classes. When you use a static keyword with a method or variable within a class, those static members will remain constant (you cannot change or modify them) for every instance you create of that particular class.
静态关键字主要用于Java中的内存管理,可用于块、方法、变量和嵌套类。当你在类中对方法或变量使用static关键字时,这些静态成员对于你创建的该特定类的每个实例都将保持不变(你不能更改或修改它们)。
283. Can you explain each keyword from the public static void main(String args[])>?
你能解释一下public static void main(String args[])中的每个关键字吗?
- 知识点: 其他/未分类 (标签: interviewbit, epam, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: EPAM Systems
- id: 69b37aea58d557c902bab2d1 | 官方: 否 | 付费: 否
答案:
Java's most important method is public static void main(String[] args). Java programs begin with the main method whose syntax is public static void main(String[] args). Only the String array argument name can be changed, for example, args can be changed to myStringArgs.
Java最重要的方法是public static void main(String[] args)。Java程序以main方法开始,其语法为public static void main(String[] args)。只有字符串数组参数名可以更改,例如,args可以改为myStringArgs。
- Public: It is an Access modifier that specifies where and who can access the method. When you make a method non-public, it will not be executed by any program, since there are certain restrictions on access.
- Static: At the beginning of the Java runtime, there are no objects of the class defined. As main() is static, the JVM (Java Virtual Machine) can invoke it without having to instantiate (without creating the object) the class. Furthermore, this prevents the unnecessary consumption of memory by objects that are declared only for calling main() methods by the JVM.
- Void: Every method in Java must provide a return type. Because Java's main method returns nothing, its return type is void. A Java program terminates once the main() method has terminated. Therefore, the main() method cannot return any value, as the JVM cannot do anything with its return value.
- Main: It's the name of Java's main method. The JVM searches for this identifier as the starting point for the Java program.
- String[] args: In Java, the main method takes only one argument of the type String array. These arguments are also known as Java command line arguments.
- Data Science
- All Events
- My Events
284. Write a program to count the number of vowels occurring in all the substrings of a given String.
编写一个程序,统计给定字符串的所有子串中元音字母出现的次数。
- 知识点: 其他/未分类 (标签: interviewbit, epam, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: EPAM Systems
- id: 69b37aea58d557c902bab2d4 | 官方: 否 | 付费: 否
答案:
Consider a string of lowercase characters that contains 0 or more vowels. The string is of length n and can be divided into n(n+1)/2 substrings. The simple solution is to count the number of vowels within each substring and then add them together to get the final result. Here is the code to count the number of vowels in all the substrings of a given string.
考虑一个包含0个或多个元音的小写字母字符串。该字符串长度为n,可划分为n(n+1)/2个子串。简单的解决方案是统计每个子串中的元音数量,然后将它们相加得到最终结果。以下是统计给定字符串所有子串中元音数量的代码。
Code:
代码:
import java.io.*;
import java.io.*;
import java.util.*;
import java.util.*;
import java.util.Scanner;
import java.util.Scanner;
public class Main {
public class Main {
//calculates total sum of all vowel occurrences
//计算所有元音出现次数的总和
static int vowel_calc(String str)
static int vowel_calc(String str)
{
int n = str.length();
int n = str.length();
int arr[] = new int[n];
int arr[] = new int[n];
for (int i = 0; i < n; i++)
for (int i = 0; i < n; i++)
{
if (i == 0)
if (i == 0)
// Number of times the 0th character occurs in all substrings
//第0个字符在所有子串中出现的次数
arr[i] = n;
arr[i] = n;
else
else
// Number of times the ith character occurs in all substrings
// 第i个字符在所有子串中出现的次数
arr[i] = (n - i) + arr[i - 1] - i;
arr[i] = (n - i) + arr[i - 1] - i;
}
int sum = 0;
int sum = 0;
for (int i = 0; i < n; i++) {
for (int i = 0; i < n; i++) {
char ch = str.charAt(i);
char ch = str.charAt(i);
// Check to see if ith character is a vowel
// 检查第i个字符是否为元音
if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
sum += arr[i];
sum += arr[i];
}
// Return total sum of all vowel occurrences
// 返回所有元音出现次数的总和
return sum;
return sum;
}
// Driver Code
// 驱动代码
public static void main(String args[])
public static void main(String args[])
{
Scanner sc= new Scanner(System.in);
Scanner sc= new Scanner(System.in);
System.out.println("Enter a String");
System.out.println("Enter a String");
String str=sc.nextLine();
String str=sc.nextLine();
System.out.println(vowel_calc(str));
System.out.println(vowel_calc(str));
}
}
Output:
输出:
Enter a String
输入一个字符串
Scaler
Scaler
22
285. What are constructors? Write its types.
什么是构造函数?写出它的类型。
- 知识点: 其他/未分类 (标签: interviewbit, epam, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: EPAM Systems
- id: 69b37aea58d557c902bab2da | 官方: 否 | 付费: 否
答案:
Constructors can be defined as a special member function of a class that is responsible for initializing a newly created object of the class. Constructors are automatically called when we create an instance (object) of a class. Unlike other functions, constructors have no return type, and their name should be the same as that of the class they are declared in.
构造函数可以定义为类的一个特殊成员函数,负责初始化类的新创建对象。当我们创建类的实例(对象)时,构造函数会自动调用。与其他函数不同,构造函数没有返回类型,并且其名称应与声明它的类名相同。
Syntax:
语法:
class Scaler
class Scaler
{
Scaler() {
Scaler() {
// constructor body
// 构造函数体
}
}
Types of Constructors:
构造函数的类型:
- Default Constructors: When there is no constructor defined, the Java compiler automatically creates a no-arg constructor at runtime, known as the default constructor.
- No-Arg Constructors: Like methods, a Java constructor may or may not contain any arguments (parameters). Constructors without any parameters are known as no-argument constructors.
- Parameterized Constructors: Constructors with one or more parameters are known as parameterized constructors.
286. Can you explain the difference between ArrayList and Vector?
你能解释一下ArrayList和Vector之间的区别吗?
- 知识点: 其他/未分类 (标签: interviewbit, epam, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: EPAM Systems
- id: 69b37aea58d557c902bab2f9 | 官方: 否 | 付费: 否
答案:
ArrayList and Vector are both dynamic arrays (resizable arrays) used in Java to implement the list interface.
ArrayList和Vector都是Java中用于实现列表接口的动态数组(可调整大小的数组)。
| ArrayList | Vector |
|---|---|
| By default, ArrayList is not synchronized. This means that ArrayList can be used by multiple threads simultaneously. 默认情况下,ArrayList不是同步的。这意味着ArrayList可以同时被多个线程使用。 | It is synchronized. This means that Vector can be used by only one thread at a time. 它是同步的。这意味着Vector一次只能被一个线程使用。 |
| ArrayList increases its size by 50% if the number of elements exceeds its maximum capacity. 当元素数量超过其最大容量时,ArrayList的大小增加50%。 | Vector increases its size by 100% if the number of elements exceeds its maximum capacity. 当元素数量超过其最大容量时,Vector的大小增加100%。 |
| Since ArrayLists are unsynchronized, they are faster as compared to vectors. 由于ArrayList是非同步的,它们比Vector更快。 | Since Vectors are unsynchronized, they are slower as compared to ArrayLists. 由于Vector是同步的,它们比ArrayList更慢。 |
| The iterator interface can be used to traverse the elements of the ArrayList. 可以使用迭代器接口来遍历ArrayList的元素。 | Both the Enumeration interface and Iterator interface can be used to traverse the elements of Vector. 枚举接口和迭代器接口都可以用于遍历Vector的元素。 |
287. Write a program to implement abstraction.
编写一个程序来实现抽象。
- 知识点: 其他/未分类 (标签: interviewbit, epam, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: EPAM Systems
- id: 69b37aea58d557c902bab2fc | 官方: 否 | 付费: 否
答案:
Abstraction: Java uses interfaces and abstract classes to implement abstraction. The following program illustrates the implementation of abstraction.
抽象:Java使用接口和抽象类来实现抽象。以下程序说明了抽象的实现。
Code:
代码:
// Java program to illustrate abstraction implementation
// Java程序,用于说明抽象的实现
//abstract class
// 抽象类
abstract class InterviewBit
abstract class InterviewBit
{
//abstract method
// 抽象方法
abstract void products();
abstract void products();
}
//extends the abstract class
// 继承抽象类
class ScalerAcademy extends InterviewBit
class ScalerAcademy extends InterviewBit
{
@Override
@Override
void products()
void products()
{
System.out.println("Scaler Academy by InterviewBit");
System.out.println("Scaler Academy by InterviewBit");
}
}
class ScalerEdge extends InterviewBit
class ScalerEdge extends InterviewBit
{
@Override
@Override
void products()
void products()
{
System.out.println("Scale Edge by Scaler");
System.out.println("Scale Edge by Scaler");
}
}
public class Main
public class Main
{
public static void main(String[] args)
public static void main(String[] args)
{
InterviewBit obj1 = new ScalerAcademy();
InterviewBit obj1 = new ScalerAcademy();
InterviewBit obj2 = new ScalerEdge();
InterviewBit obj2 = new ScalerEdge();
//invoking abstract method
//调用抽象方法
obj1.products();
obj1.products();
obj2.products();
obj2.products();
}
}
Output:
输出:
Scaler Academy by InterviewBit
Scaler Academy by InterviewBit
Scale Edge by Scaler
Scale Edge by Scaler
288. Explain abstract class and abstract method.
解释抽象类和抽象方法。
- 知识点: 其他/未分类 (标签: interviewbit, epam, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: EPAM Systems
- id: 69b37aea58d557c902bab2ff | 官方: 否 | 付费: 否
答案:
- Abstract class: This class can never be instantiated i.e., objects of abstract classes cannot be created. There can be both regular and abstract methods in an abstract class. Abstract classes are declared using the abstract keyword. It is necessary to extend (inherit) the abstract class. The subclass of an abstract class, i.e., the class inherited from it, usually implements all of the abstract methods of the parent class (abstract class).
- Abstract method: Abstract methods can only be used in abstract classes, and they do not have bodies. The body of the abstract method is provided by the subclass. The abstract keyword is also used for abstract methods.
Example:
示例:
// Abstract class
// 抽象类
abstract class InterviewBit
abstract class InterviewBit
{
// Abstract method (does not have a body)
// 抽象方法(没有方法体)
abstract void Products();
abstract void Products();
// regular method
// 常规方法
void method();
void method();
{
...
}
}
289. State the difference between HashMap and HashTable.
阐述HashMap和HashTable之间的区别。
- 知识点: 其他/未分类 (标签: interviewbit, epam, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: EPAM Systems
- id: 69b37aea58d557c902bab305 | 官方: 否 | 付费: 否
答案:
Both HashMaps and Hashtables store data in the key-value form. Each store's unique keys use hashing techniques.
两者HashMap和Hashtable都以键值对形式存储数据。每个存储的唯一键都使用哈希技术。
| HashMap | HashTable |
|---|---|
| It is non-synchronized. As a result, two or more threads can access the HashMap data at the same time. 它是非同步的。因此,两个或更多线程可以同时访问HashMap数据。 | It is synchronized. As a result, only one thread can access the Hashtable data at a time. 它是同步的。因此,一次只能有一个线程访问Hashtable数据。 |
| This is not thread-safe, so it cannot be shared among many threads without proper synchronization. 它不是线程安全的,因此如果没有适当的同步,就不能在许多线程之间共享。 | It is thread-safe, so it can be shared among many threads. 它是线程安全的,因此可以在许多线程之间共享。 |
| In a hashmap, there can be one null key and any number of null values. 在hashmap中,可以有一个null键和任意数量的null值。 | Hashtables do not allow null keys or null values. Hashtable不允许null键或null值。 |
| HashMap values are iterated by using an iterator. HashMap值通过使用迭代器进行迭代。 | A HashTable, however, also includes an Enumerator along with Iterator for traversing/iterating the value stored in it. 然而,HashTable除了Iterator之外,还包含一个Enumerator,用于遍历/迭代存储在其中的值。 |
| Since HashMaps are unsynchronized, they are faster and use less memory than Hashtables. 由于HashMap是非同步的,它们比Hashtable更快且使用更少的内存。 | Since Hashtables are synchronized, they are slow and use more memory than HashMaps. But, it eliminates the need to write extra code for synchronization. 由于Hashtable是同步的,它们比HashMap慢且使用更多内存。但是,它消除了编写额外同步代码的必要。 |
290. What is the purpose of the final, finally, and finalize keyword?
final、finally和finalize关键字的作用是什么?
- 知识点: 其他/未分类 (标签: interviewbit, epam, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: EPAM Systems
- id: 69b37aea58d557c902bab308 | 官方: 否 | 付费: 否
答案:
- Final: Final is a reserved keyword in Java that can be used in multiple contexts to define an entity. Final variables have fixed values, i.e. they cannot be changed after they have been assigned. Depending on whether it is used for a variable, a class, or a method, the final keyword has different meanings.
Final Variable: Once a final variable has been initialized, its value cannot be changed.
Final变量:一旦final变量被初始化,其值就不能被更改。
Final Method: A subclass cannot override the final method. Declaring a method final means that it cannot be overridden.
Final方法:子类不能覆盖final方法。将方法声明为final意味着它不能被覆盖。
Final Class: When a class is final, it cannot be subclassed. Declaring a class final means that we cannot extend or make a subclass of it in any way. - Finally: Finally is a keyword that is used in conjunction with a try/catch block and ensures that a section of code will be executed, regardless of whether an exception is handled or not. It executes important code such as resource cleanup or releasing memory usage.
Final类:当一个类是final时,它不能被继承。将类声明为final意味着我们不能再任何方式扩展它或创建它的子类。 - Finally:Finally是一个与try/catch块结合使用的关键字,确保一段代码无论是否处理了异常都会被执行。它执行重要代码,如资源清理或释放内存使用。
Finalize: A garbage collector always calls the finalize method just before it deletes or destroys an object to perform cleanup activities. The clean-up activity means closing resources associated with that object, such as databases and network connections, or de-allocating resources. It is defined in the Object class.
EPAM Interview Preparation
291. What is the Eligibility Criteria at Epam?
Epam的资格标准是什么?
- 知识点: 其他/未分类 (标签: interviewbit, epam, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: EPAM Systems
- id: 69b37aeb58d557c902bab31e | 官方: 否 | 付费: 否
答案:
The following are the eligibility criteria for Junior Software Engineer at Epam:
以下是Epam初级软件工程师的资格标准:
| Eligibility Criteria 资格标准 | Details 详情 |
|---|---|
| Graduation 学历 | Eligible: B.E/ B.Tech/ M.E/ M.Tech/ MCA 合格:B.E/ B.Tech/ M.E/ M.Tech/ MCA |
| Stream 专业 | CSE/ECE/IT/other CS Stream Only 仅限CSE/ECE/IT/其他CS相关专业 |
| Academic and Graduation Criteria 学业和毕业标准 | 60% or 6.0 CGPA across 10th, 12th, & UG/PG 10年级、12年级和本科/研究生阶段成绩为60%或6.0 CGPA |
| Backlogs 欠修课程 | No active/current Backlogs 无当前未完成的欠修课程 |
292. How long does the Epam interview process take?
Epam面试过程需要多长时间?
- 知识点: 其他/未分类 (标签: interviewbit, epam, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: EPAM Systems
- id: 69b37aeb58d557c902bab321 | 官方: 否 | 付费: 否
答案:
A total of 5 rounds are involved in the Epam hiring process; Java online coding challenge, MCQs, Group Discussion, Technical Interview, and lastly, HR Interview. Epam officials generally follow this interview process; however, they may conduct more rounds depending on the company's requirements, your experience, and the job profile you hold. An individual who has cleared all rounds should receive an offer letter within approximately 5–7 working days.
Epam招聘过程共涉及5轮;Java在线编码挑战、选择题、小组讨论、技术面试,最后是HR面试。Epam官方通常遵循这一面试流程;然而,根据公司需求、您的经验和您所担任的职位,他们可能会进行更多轮次。所有轮次通过的个人应在大约5-7个工作日内收到录用通知。
293. What is the salary for freshers in Epam?
Epam新人的薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, epam, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: EPAM Systems
- id: 69b37aeb58d557c902bab327 | 官方: 否 | 付费: 否
答案:
Epam package for freshers (Junior Software Engineer) starts at ₹ 3 LPA and goes up to ₹ 11 LPA. An entry-level Software Engineer with less than one year of experience is expected to earn an average salary of ₹ 6 LPA in India.
Epam对新人(初级软件工程师)的薪资方案从₹ 3 LPA起,最高可达₹ 11 LPA。在印度,经验不足一年的入门级软件工程师预计平均薪资为₹ 6 LPA。
294. How do I get placed in EPAM?
我怎样才能被EPAM录用?
- 知识点: 其他/未分类 (标签: interviewbit, epam, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: EPAM Systems
- id: 69b37aeb58d557c902bab32a | 官方: 否 | 付费: 否
答案:
EPAM Systems hires graduates for Junior Software Engineer positions through both on-campus and off-campus placements. Interested applicants can reach out to the organization either by attending an on-campus placement drive or by submitting an online application on the organization's official website. Below is a small overview of how to join EPAM. - Apply for the position that best matches your skills and interests on the company's official website.
EPAM Systems通过校园招聘和校外招聘两种方式招聘毕业生担任初级软件工程师职位。有意向的申请者可以通过参加校园招聘会或在组织官方网站上提交在线申请来联系该组织。以下是加入EPAM的一个简要概述。- 在公司的官方网站上申请最符合你技能和兴趣的职位。
- Usually, within two to three business days (and sometimes up to a week), they will review your application and check if you are a good fit for the position. In case the match is right, they will contact you for further processing.
- You will now go through the standard EPAM interview process.
- After the interview, if the feedback is positive, you will receive an offer.
295. Is the Epam interview difficult?
EPAM面试难吗?
- 知识点: 其他/未分类 (标签: interviewbit, epam, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: EPAM Systems
- id: 69b37aeb58d557c902bab32d | 官方: 否 | 付费: 否
答案:
The EPAM Systems recruitment process usually involves five rounds; the difficulty level ranges from easy to medium. An individual who has good Java programming skills and computer science knowledge can crack the interview. As part of their recruitment process, EPAM judges a candidate solely on the perks that can be expected in real life. You need to be prepared to appear relaxed, calm, and collected during your interview, which is what employers are looking for in their ideal candidate.
EPAM Systems的招聘流程通常包括五轮;难度级别从简单到中等。拥有良好Java编程技能和计算机科学知识的人可以顺利通过面试。作为招聘流程的一部分,EPAM仅根据候选人在现实生活中所能获得的福利来评判候选人。你需要在面试中表现得放松、冷静和沉着,这正是雇主在理想候选人身上所寻找的特质。
296. What is the Epam test?
EPAM测试是什么?
- 知识点: 其他/未分类 (标签: interviewbit, epam, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: EPAM Systems
- id: 69b37aeb58d557c902bab330 | 官方: 否 | 付费: 否
答案:
The EPAM Systems recruitment process consists of five stages; the first of which is an online test. It is a Java Online Coding Challenge, in which the candidates must answer three questions. One unique aspect of the EPAM Test is that the tests are in Java language only.
EPAM Systems的招聘流程包括五个阶段;第一阶段是在线测试。这是一个Java在线编码挑战,考生必须回答三个问题。EPAM测试的一个独特之处在于测试仅使用Java语言。
297. Why Epam?
为什么选择EPAM?
- 知识点: 其他/未分类 (标签: interviewbit, epam, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: EPAM Systems
- id: 69b37aeb58d557c902bab333 | 官方: 否 | 付费: 否
答案:
EPM is an American company that specializes in digital platform engineering and product design, product development, and consulting. They have an excellent work culture, no-frills, excellent digital engineering teams, great leaders, very down-to-earth, and fewer politics. EPAM team members exhibit outstanding teamwork and collaboration. They place more emphasis on quality than quantity. EPAM has many high-quality projects with the newest technologies, so there is a greater chance to work on varied and excellent projects.
EPM是一家美国公司,专注于数字平台工程和产品设计、产品开发以及咨询。他们拥有优秀的工作文化、无多余装饰、出色的数字工程团队、优秀的领导者、非常务实且政治斗争较少。EPAM团队成员展现出卓越的团队合作和协作精神。他们更注重质量而非数量。EPAM有许多采用最新技术的高质量项目,因此有更多机会参与多样且优秀的项目。
298. Discuss memory management.
讨论内存管理。
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aee58d557c902bab5ee | 官方: 否 | 付费: 否
答案:
In a computer that supports multiprogramming, the operating system stays in some part of the memory and the rest is used by different processes. This task of dividing the memory among different processes is known as memory management.
在支持多道程序设计的计算机中,操作系统驻留在内存的某一部分,其余部分由不同进程使用。在不同进程之间划分内存的这一任务被称为内存管理。
Why memory management is required: - Efficient utilization of the memory.
为什么需要内存管理:- 高效利用内存。
- To minimize fragmentation.
- To ensure data integrity when a process is being executed.
- To keep the track of the memory space used by different processes.
299. Explain malloc() and calloc() in C.
解释C语言中的malloc()和calloc()。
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aee58d557c902bab5f7 | 官方: 否 | 付费: 否
答案:
- malloc() function:
The malloc() function also known as the memory allocation function is used to dynamically allocate a block of memory by specifying the size.
malloc()函数,也称为内存分配函数,用于通过指定大小动态分配一块内存。
- Syntax:
ptr = (cast-type*) malloc(byte-size)
ptr = (cast-type*) malloc(byte-size)
- For example,
ptr = (int) malloc(100 sizeof(int));
ptr = (int) malloc(100 sizeof(int));
Since the size of int is 4 bytes. Therefore, this statement allocates 400 bytes of memory and ptr holds the address of the first byte.
因为int的大小是4字节,所以此语句分配400字节的内存,ptr保存第一个字节的地址。
If allocation fails then it returns NULL.
如果分配失败,则返回NULL。
- calloc() function:
The calloc() function also known as the contiguous allocation function is used to dynamically allocate specified blocks of memory of a specific size.
calloc()函数,也称为连续分配函数,用于动态分配指定大小和数量的内存块。
- Syntax:
ptr = (cast-type*) calloc(n, size)
ptr = (cast-type*) calloc(n, size)
- For example,
ptr = (int*) calloc(10, sizeof(int));
ptr = (int*) calloc(10, sizeof(int));
Since, the size of int is 4 bytes. Therefore, this statement allocates contiguous space of memory for 10 elements each of size 4.
因为int的大小是4字节,所以此语句为10个元素分配连续的内存空间,每个元素大小为4。
If allocation fails then it returns NULL.
如果分配失败,则返回NULL。
300. Differentiate between compiler and interpreter.
区分编译器和解释器。
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aee58d557c902bab5fa | 官方: 否 | 付费: 否
答案:
| Compiler 编译器 | Interpreter 解释器 |
|---|---|
| Scans the program and translates the entire program into machine code in one go. 扫描程序并一次性将整个程序翻译成机器代码。 | At a time only a single statement is translated into machine code i.e., line-by-line translation. 每次只翻译一条语句为机器代码,即逐行翻译。 |
| Object code is generated by a compiler. Therefore, they are less memory efficient. 编译器生成目标代码,因此内存效率较低。 | No object code is generated by the interpreter. Therefore, they are more memory efficient. 解释器不生成目标代码,因此内存效率较高。 |
| A compiler takes more time to analyze the entire program. 编译器分析整个程序需要更多时间。 | Interpreter takes less time to analyze the entire program. 解释器分析整个程序所需时间较少。 |
| Execution time is faster in the case of compilers. 编译器情况下的执行时间更快。 | Execution time is not very fast in the case of interpreters. 解释器情况下的执行时间不是很快。 |
301. Problem statement: You are given the head of two linked lists and you need to determine the data present at the intersection of linked lists. If there is no intersection between the lists then return -1.
问题描述:给你两个链表的头节点,你需要确定链表相交处的数据。如果两个链表没有相交,则返回 -1。
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aee58d557c902bab600 | 官方: 否 | 付费: 否
答案:
Input Format:
输入格式:
You need to complete findIntersection(ListNode headA, ListNode headB) function.
你需要完成 findIntersection(ListNode headA, ListNode headB) 函数。
Output:
输出:
Return the data present at the intersection.
返回相交处的数据。
If there is no intersection then return -1
如果没有相交则返回 -1
Constraints:
约束:
1 -10^9 Time Limit: 1 sec
1 -10^9 时间限制:1 秒
Sample Input 1:
样本输入 1:
Sample Output 1:
样本输出 1:
5
Sample Input 2:
样本输入 2:
Sample Output 2:
样本输出 2:
-1
Approach
方法
We can first determine the lengths of both lists by traversing through the lists. Note that after the intersection the number of nodes remains the same for both the lists. Let the lengths come out to be equal to len1 and len2. If len1 exceeds len2 then we move the head pointer of ListNode1 by (len1 - len2) times forward otherwise len2 exceeds len1 so we will move the head pointer of ListNode2 by (len2 - len1) times ahead.
我们首先可以通过遍历两个链表来确定它们的长度。请注意,在交点之后,两个链表的节点数量是相同的。假设长度分别等于 len1 和 len2。如果 len1 大于 len2,则将 ListNode1 的头指针向前移动 (len1 - len2) 次;否则,len2 大于 len1,因此我们将 ListNode2 的头指针向前移动 (len2 - len1) 次。
Now we will iterate unless either of them (head1 or head2) becomes NULL or head1 and head2 pointing to the same node. At the end of the iteration, we will check whether either of the head of lists is NULL, if it is so then we will return -1 otherwise we will return value (data) stored at head1 or head2.
现在我们将进行迭代,直到其中一个(head1 或 head2)变为 NULL,或者 head1 和 head2 指向同一个节点。在迭代结束时,我们将检查两个链表的头指针是否有一个为 NULL,如果是,则返回 -1;否则,返回 head1 或 head2 中存储的值(数据)。
Source Code:
源代码:
/**
Definition for singly-linked list.
- 单链表的定义。
struct ListNode {
- struct ListNode {
int data;
- int data;
ListNode *next;
- ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
- ListNode(int x) : val(x), next(NULL) {}
};
*/
class Solution {class Solution {
public:
public:
ListNode findIntersection(ListNode headA, ListNode *headB) {
ListNode findIntersection(ListNode headA, ListNode *headB) {
// Variables to store the length
// 用于存储两个链表长度的变量
// of both the lists
//
int lenA = 0;
int lenA = 0;
int lenB = 0;
int lenB = 0;
ListNode* currA = headA;
ListNode* currA = headA;
ListNode* currB = headB;
ListNode* currB = headB;
/*
Find the length of both the lists
找出两个链表的长度
*/
while(currA || currB)
while(currA || currB)
{
if(currA)
if(currA)
{
lenA++;
lenA++;
currA = currA -> next;
当前节点A = 当前节点A 指向的下一个节点;
}
else
else
{
lenB++;
lenB++;
currB = currB -> next;
当前节点B = 当前节点B 指向的下一个节点;
}
}
if(lenA > lenB)
if(lenA > lenB)
{
currA = headA;
当前节点A = 链表A头节点;
currB = headB;
当前节点B = 链表B头节点;
int difference = lenA - lenB;
int difference = lenA - lenB;
while(difference > 0)
当(差值大于0)时
{
currA = currA -> next;
当前节点A = 当前节点A 指向的下一个节点;
difference--;
差值减一;
}
}
else
else
{
currB = headB;
当前节点B = 链表B头节点;
currA = headA;
当前节点A = 链表A头节点;
int difference = lenB - lenA;
整型变量差值 = 链表B长度 - 链表A长度;
while(difference > 0)
当(差值大于0)时
{
currB = currB -> next;
当前节点B = 当前节点B 指向的下一个节点;
difference--;
差值减一;
}
}
while(currA != NULL && currB != NULL && currA != currB)
当(当前节点A非空 且 当前节点B非空 且 当前节点A不等于当前节点B)时
{
currA = currA -> next;
当前节点A = 当前节点A 指向的下一个节点;
currB = currB -> next;
当前节点B = 当前节点B 指向的下一个节点;
}
return ((currA == NULL || curB == NULL) ? -1 : currA -> data);
返回((当前节点A为空 或 当前节点B为空)? -1 : 当前节点A的数据);
}
};
302. What are the advantages of using the stored procedures?
使用存储过程有哪些优点?
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aee58d557c902bab603 | 官方: 否 | 付费: 否
答案:
Store procedure specifies a type of code in SQL that can be stored by the user for later use and can be used many times.
存储过程指定了SQL中一种可由用户存储以供后续使用的代码类型,且可多次使用。
Syntax:
语法:
CREATE PROCEDURE name_of_the_procedure
创建存储过程 存储过程名称
AS
AS
sql_statement
sql_statement
GO;
GO;
The advantages of stored procedures are the following: - Increased productivity: The same piece of code is used again and again which results in higher productivity.
存储过程的优势如下:- 提高生产力:相同的代码被反复使用,从而带来更高的生产力。
- Better performance: The calls made to the procedure are quick and efficient as stored procedures are compiled once and stored in the executable form which leads to better performance.
- Easily maintainable: Maintaining a procedure on a server is quite easier than maintaining its replica on a different client machine.
- Security: We can restrict access to the oracle data by allowing the users to use stored procedures within specific privileges.
303. Where do we generally create an index?
我们通常在何处创建索引?
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aee58d557c902bab606 | 官方: 否 | 付费: 否
答案:
The index is generally created at the time of the table creation in the database. For example, in MySQL, we can use the following statements to create a table with an index that holds two columns column1 and column2.
索引通常在数据库中创建表时创建。例如,在 MySQL 中,我们可以使用以下语句创建一个包含两列 column1 和 column2 的索引的表。
mysql> CREATE TABLE t_index
mysql> CREATE TABLE t_index
( column1 INT PRIMARY KEY, column2 INT NOT NULL, column3 INT NOT NULL, column4 VARCHAR(20), INDEX (column1,column2) );
( column1 INT PRIMARY KEY, column2 INT NOT NULL, column3 INT NOT NULL, column4 VARCHAR(20), INDEX (column1,column2) );
If want to add an index to the table, we can use the following statement:
如果想向表中添加索引,可以使用以下语句:
mysql>
mysql>
CREATE INDEX [index] ON [table] (column)
CREATE INDEX [index] ON [table] (column)
Here: - index: It represents the name of the index,
此处:- index:它表示索引的名称,
- table: It represents the name of the table to which the index belongs, and
- column: It represents the list of columns.
304. Differentiate between abstract class and interface.
区分抽象类与接口。
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aee58d557c902bab609 | 官方: 否 | 付费: 否
答案:
| Abstract Class 抽象类 | Interface 接口 |
|---|---|
| Abstract class can contain abstract as well as non-abstract methods. 抽象类可以包含抽象方法和非抽象方法。 | An interface can contain abstract methods only. 接口只能包含抽象方法。 |
| Abstract class doesn’t support multiple inheritances. 抽象类不支持多重继承。 | There is a way using which multiple inheritances are possible through an interface. 有一种方式可以通过接口实现多重继承。 |
| An abstract class can provide the implementation of the interface. 抽象类可以提供接口的实现。 | An interface cannot provide the implementation of the abstract class. 接口不能提供抽象类的实现。 |
| An abstract class can contain static and non-static, final and non-final members. 抽象类可以包含静态和非静态、最终和非最终的成员。 | An interface can contain final and static variables. 接口可以包含最终和静态变量。 |
305. What is meant by the interface?
接口是什么意思?
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aee58d557c902bab60c | 官方: 否 | 付费: 否
答案:
An interface is a blueprint for a class. It has static constants and abstract methods. It is a way to achieve abstraction. In other words, we can say that an interface can have variables and abstract methods but no method body.
接口是类的蓝图。它包含静态常量和抽象方法。这是一种实现抽象的方式。换句话说,我们可以说接口可以包含变量和抽象方法,但没有方法体。
306. Why is DML provided?
为什么提供DML?
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aef58d557c902bab60f | 官方: 否 | 付费: 否
答案:
Data manipulation language (DML) is provided for the manipulation and processing of databases.
数据操作语言(DML)用于数据库的操作和处理。
307. What is a deadlock?
什么是死锁?
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aef58d557c902bab612 | 官方: 否 | 付费: 否
答案:
Deadlock is a condition in which more than one process is blocked because it is holding a resource but also requires another resource that is currently acquired by some other process. This can be understood with the help of a real-life example: - Consider two trains passing through a railway track in opposite directions. Each waits for the other to pass but none of them can go across the other.
死锁是一种多个进程因持有一个资源但又需要另一个当前被其他进程获取的资源而被阻塞的状态。这可以通过一个现实生活中的例子来理解:- 想象两列火车在铁路轨道上相向行驶。每列火车都在等待对方通过,但两者都无法越过对方。
308. What is the difference between primary key and foreign key?
主键和外键有什么区别?
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aef58d557c902bab618 | 官方: 否 | 付费: 否
答案:
| Primary Key 主键 | Foreign Key 外键 |
|---|---|
| Primary key ensures that data in the specific column is unique. 主键确保特定列中的数据是唯一的。 | Foreign key is a column or group of columns used to link between data present in two tables. 外键是用于关联两个表中数据的列或列组。 |
| One primary key is possible for a table. 一个表只能有一个主键。 | More than one foreign key is possible for a table. 一个表可以有多个外键。 |
| The primary key value cannot be null. 主键值不能为空。 | Primary key values can be null. 外键值可以为空。 |
| It is used to uniquely identify a record in relation to or table. 它用于唯一标识关系或表中的记录。 | It refers to the column in a table that is the primary key of that table. 它引用表中作为该表主键的列。 |
| Unique and not-null constraints together make the primary key. 唯一和非空约束共同构成主键。 | It can contain duplicate values. 它可以包含重复值。 |
309. Explain the need for a lock and also explain the difference between a shared lock and an exclusive lock?
解释锁的必要性,并说明共享锁和排他锁之间的区别。
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aef58d557c902bab61b | 官方: 否 | 付费: 否
答案:
To ensure the isolation of property holds in transactions, we need to make sure that data items be accessed in a mutually exclusive manner. It basically means that when one transaction is accessing a data item then no other transaction can make changes to that data item.
为了确保事务中的隔离属性成立,我们需要确保数据项以互斥方式访问。这基本上意味着当一个事务正在访问某个数据项时,没有其他事务可以对该数据项进行更改。
Thus, to fulfil this requirement, we can allow transactions to access the data item only if it holds a lock on that item.
因此,为了满足这一要求,我们可以允许事务仅在持有该项锁的情况下访问数据项。
Shared lock vs Exclusive lock:
共享锁与排他锁:
| Shared lock 共享锁 | Exclusive lock 排他锁 |
|---|---|
| It allows read-only operation. 它允许只读操作。 | It allows ready and writing operations. 它允许读和写操作。 |
| Protect others from updating the data. 保护其他事务不更新数据。 | Protect others from reading as well as updating the data. 保护其他事务不读取和更新数据。 |
| There is no limitation on the number of transactions that can hold a shared lock on an item. 对持有某项共享锁的事务数量没有限制。 | Exclusive lock can be held by only one transaction 排他锁只能由一个事务持有。 |
| A shared lock is requested using a shared lock operation. 共享锁使用共享锁操作请求。 | An exclusive lock is requested using exclusive lock operation. 排他锁使用排他锁操作请求。 |
310. Define RDBMS?
定义RDBMS?
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aef58d557c902bab61e | 官方: 否 | 付费: 否
答案:
RDBMS is an acronym for relational database management systems . Most database management systems like SQL, MY-SQL, and ORACLE are based on RDBMS. The name relational database management system is given because RDMS is based upon the relational model introduced by E.F. Codd. It is one of the most commonly used databases. It includes several tables or relations and each table has its own primary key.
RDBMS是关系数据库管理系统的缩写。大多数数据库管理系统如SQL、MY-SQL和ORACLE都基于RDBMS。之所以命名为关系数据库管理系统,是因为RDBMS基于E.F. Codd引入的关系模型。它是最常用的数据库之一。它包含多个表或关系,每个表都有自己的主键。
The set of tables is stored in an organized manner in RDBMS, therefore data can be accessed easily in RDBMS.
在RDBMS中,表的集合以有组织的方式存储,因此数据可以轻松访问。
311. How much time does EY take to declare the result?
EY需要多长时间公布结果?
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aef58d557c902bab63f | 官方: 否 | 付费: 否
答案:
It takes about two weeks after the final interview.
最终面试后大约需要两周时间。
312. How long is the EY interview process?
EY的面试流程有多长?
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aef58d557c902bab642 | 官方: 否 | 付费: 否
答案:
It is fairly a long process. Generally, it consists of three rounds but this process can take up to 2 months.
这是一个相当长的过程。通常包括三轮,但整个过程可能需要长达两个月。
313. Is it hard to get into EY?
进入EY难吗?
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aef58d557c902bab64a | 官方: 否 | 付费: 否
答案:
With proper preparation, you can make it to EY easily. EY focuses on logical & analytical ability and computer science fundamentals (especially DBMS). Also, you must have a good understanding of data structures and algorithms.
只要准备充分,你可以轻松进入EY。EY侧重于逻辑和分析能力以及计算机科学基础(尤其是数据库管理系统)。此外,你还需要对数据结构和算法有很好的理解。
314. What is HireVue?
什么是HireVue?
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aef58d557c902bab64d | 官方: 否 | 付费: 否
答案:
A few years back, EY had modified its hiring process by including something called a video interview or HireVue interview. The main objective of this platform is to save everyone’s time. It allows the recruiter to look at non-verbal cues like eye movement, facial expressions, body movement, etc.
几年前,EY修改了其招聘流程,加入了视频面试或HireVue面试。这个平台的主要目的是节省大家的时间。它允许招聘人员观察非语言线索,如眼球运动、面部表情、身体动作等。
315. Why do you want to join EY?
你为什么想加入EY?
- 知识点: 其他/未分类 (标签: interviewbit, ey, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 安永
- id: 69b37aef58d557c902bab650 | 官方: 否 | 付费: 否
答案:
While answering these types of questions, mention the work culture of the company that inspires you to join the company. Also, tell them about your goals to learn new things while working at the company.
回答这类问题时,提到公司的企业文化如何激励你加入。同时告诉他们你在公司工作期间学习新事物的目标。
316. State a few benefits of using C ++ as a language.
简要说明使用 C++ 作为编程语言的一些好处。
- 知识点: 其他/未分类 (标签: interviewbit, genpact, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Genpact
- id: 69b37aff58d557c902babf83 | 官方: 否 | 付费: 否
答案:
A few benefits of using C ++ as a language are as follows: - C++ not only preserves all parts of the C language but also simplifies memory management.
使用 C++ 作为编程语言的一些好处如下:- C++ 不仅保留了 C 语言的所有部分,还简化了内存管理。
- C++ is a highly portable language, which implies that code written in it may operate on any platform.
- Classes, objects, inheritance, polymorphism, and abstraction are all ideas of C++, which is an object-oriented programming language.
- Inheritance is a notion in C ++. Through inheritance, unnecessary code can be removed and existing classes can be reused.
- Data hiding aids the programmer in creating secure applications that are not vulnerable to intruders.
- Message passing is a communication method that allows objects to communicate with one another.
- C++ has a large library of functions.
317. Explain the concept and two types of Data Independence.
解释数据独立性的概念及其两种类型。
- 知识点: 其他/未分类 (标签: interviewbit, genpact, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Genpact
- id: 69b37aff58d557c902babfa5 | 官方: 否 | 付费: 否
答案:
Data independence is a concept according to which, the change in data at one level of the DBMS three-tier architecture should not influence data at another level. Data independence is of two types of data independence: - Physical Data Independence: According to Physical Data Independence, any change in the physical location of tables and indexes should have no bearing on the conceptual level or the external display of data. This data independence is simple to achieve and is supported by the majority of Database Management Systems.
数据独立性是一个概念,根据该概念,DBMS 三层架构中某一层的数据变化不应影响另一层的数据。数据独立性分为两种类型:- 物理数据独立性:根据物理数据独立性,表或索引物理位置的任何变化都不应影响概念层或数据的外部显示。这种数据独立性易于实现,并且得到大多数数据库管理系统的支持。
- Conceptual Data Independence: According to Conceptual Data Independence, data at the conceptual and external levels must be independent. This means that any changes to the conceptual schema should have no impact on the external schema. Adding or removing characteristics from a table, for example, should have no effect on the user's view of the table. However, unlike physical data independence, this form of independence is more difficult to achieve since changes in conceptual schema are mirrored in the user's view.
318. What do you understand about the concept of Data Warehousing?
你对数据仓库的概念有何理解?
- 知识点: 其他/未分类 (标签: interviewbit, genpact, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Genpact
- id: 69b37aff58d557c902babfae | 官方: 否 | 付费: 否
答案:
Data warehousing is the process of collecting, extracting, processing, and importing data from numerous sources and storing it in a single database. A data warehouse can be thought of as a central repository for data analytics that receives data from transactional systems and other relational databases. A data warehouse is a collection of historical data from an organization that aids in decision making. The data from a data warehouse is further used for Data visualization, reporting, business intelligence and many more activities.
数据仓库是从多个来源收集、提取、处理和导入数据,并将其存储在单个数据库中的过程。数据仓库可以被视为数据分析的中心存储库,它从事务系统和其他关系数据库接收数据。数据仓库是组织历史数据的集合,有助于决策制定。来自数据仓库的数据进一步用于数据可视化、报告、商业智能及更多活动。
319. Tips to Prepare for GenPact Interview
准备 GenPact 面试的技巧
- 知识点: 其他/未分类 (标签: interviewbit, genpact, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Genpact
- id: 69b37aff58d557c902babfbe | 官方: 否 | 付费: 否
答案:
Readers of this article should strongly consider the following interview tips for preparing for a Genpact Hiring Process:
本文读者应强烈考虑以下面试技巧,以准备 Genpact 招聘流程:
- Put yourself to the test to see how quickly you can solve a set of coding problems. This will help you improve your problem-solving skills as well as your logic frameworks.
- Recognize your strengths and weaknesses, as well as the experiences and talents that make you qualified for the job. Consider coming up with a one of a kind example to assist you to stand out. The interviewer wants to know what motivates you, why you are interested in the company, and how your previous work experience has prepared you for this position.
- Prepare to demonstrate leadership, teamwork, professional and academic success, communication skills, and the ability to overcome obstacles by sharing your experiences.
- Be aware of the Genpact tools and technologies which are being used by them nowadays by reading up on their blog or website. Know more about the company more in general.
- The better prepared you are for an interview, the more likely you are to get hired. Learn everything there is to know about interviews, including how to prepare for them, the stages, rounds, and questions. For human resource development (HRD) and management interviews, answers to frequently asked questions should be prepared ahead of time. You can also learn about, among other things, firm performance, organizational structure, vision, and work-life balance.
- Maintaining a positive and welcoming attitude is always beneficial. Introduce yourself confidently to start the conversation on a favourable note. Practice introducing yourself before the interview in front of a mirror to be confident during the entire hiring process.
- Look over the company's interview experience articles. This will give you a good idea of what to expect and how the interview will go.
- Consider conducting a mock interview. This will provide you with an idea of how the interview will go. You may use the InterviewBit platform for it. You will be partnered with your peers, and both of you will be permitted to interview, which will be advantageous to you.
320. Is the Genpact interview easy?
GenPact 面试容易吗?
- 知识点: 其他/未分类 (标签: interviewbit, genpact, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Genpact
- id: 69b37aff58d557c902babfcb | 官方: 否 | 付费: 否
答案:
It does not matter whether the GenPact interview is challenging or easy. The truth is that the more you prepare for the interview, the easier it will be to pass. Acquire sufficient understanding of, among other things, interview stages, rounds, and questions. The candidate's CV (prior experience, past works) and the job requirements are used to conduct the interview. Programming languages, logical thinking, and products, software and projects on which the candidate has recently or previously worked are among the topics covered.
GenPact 面试是困难还是容易并不重要。事实是,你为面试准备得越多,通过就会越容易。充分了解面试阶段、轮次和问题等方面。面试是基于候选人的简历(先前经验、过往工作)和职位要求进行的。编程语言、逻辑思维,以及候选人最近或之前参与的产品、软件和项目都是涵盖的主题。
321. Is Genpact good for freshers?
Genpact 对新手好吗?
- 知识点: 其他/未分类 (标签: interviewbit, genpact, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Genpact
- id: 69b37aff58d557c902babfce | 官方: 否 | 付费: 否
答案:
Yes, GenPact is a good company for freshers as it provides a fast-paced development environment which will help them to learn a variety of things in a very short duration of time. The codebases at GenPact are of both types: legacy code bases as well as code bases are written using the cutting edge technologies of today. Hence, the learning curve at GenPact is pretty steep.
是的,GenPact 对新手来说是一家好公司,因为它提供一个快节奏的发展环境,这将帮助他们在很短时间内学到各种东西。GenPact 的代码库有两种类型:遗留代码库以及使用当今尖端技术编写的代码库。因此,GenPact 的学习曲线相当陡峭。
322. What should you say in response to the following question: Why are you qualified for this position?
对于以下问题,你该如何回应:你为什么适合这个职位?
- 知识点: 其他/未分类 (标签: interviewbit, genpact, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Genpact
- id: 69b37aff58d557c902babfd1 | 官方: 否 | 付费: 否
答案:
When asked questions like these, emphasize your skills and abilities that are relevant to the position. An instance of a typical response to the given question could be as the following:
当遇到这类问题时,强调你与该职位相关的技能和能力。对给定问题的一个典型回答示例如下:
"For a variety of reasons, but most significantly because of my will to succeed, I am confident that I am qualified for this position. I have all of the skills required to succeed in this profession. I am constantly attempting to educate myself on the most recent technologies. My abilities and skills are a fantastic match for the requirements of this post. Above all, my communication and leadership skills make me an excellent fit for that position."
“出于多种原因,但最重要的是因为我渴望成功,我确信自己适合这个职位。我拥有在这一职业中取得成功所需的全部技能。我一直在努力自学最新技术。我的能力和技能与该职位的要求非常匹配。最重要的是,我的沟通和领导能力使我成为该职位的绝佳人选。”
323. What is the salary of a fresher at Genpact?
Genpact 新手员工的薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, genpact, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Genpact
- id: 69b37aff58d557c902babfd4 | 官方: 否 | 付费: 否
答案:
The average compensation for a Genpact Fresher is Rs. 2,01,795 per year. At Genpact, fresher wages can range from Rs. 1,22,171 to Rs. 2,48,684 per year.
Genpact 应届毕业生的平均薪酬为每年 201,795 卢比。在 Genpact,应届毕业生的薪资范围从每年 122,171 卢比到 248,684 卢比不等。
324. What is Binet's formula in context to the Fibonacci series?
在斐波那契数列的背景下,Binet 公式是什么?
- 知识点: 其他/未分类 (标签: interviewbit, goldman-sachs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 高盛
- id: 69b37b1458d557c902bacbfb | 官方: 否 | 付费: 否
答案:
For computing the nth Fibonacci number, there is a simple mathematical procedure called Binet's formula that does not require the calculation of the preceding numbers. Hence, we can find out the nth fibonacci number in constant time, without using recursion or iteration.
对于计算第 n 个斐波那契数,存在一个简单的数学方法称为 Binet 公式,它不需要计算前面的数字。因此,我们可以在常数时间内找到第 n 个斐波那契数,而无需使用递归或迭代。
It features the Golden Ratio (x) (ratio of any two successive Fibonacci numbers):
它涉及黄金比例 (x)(任意两个连续斐波那契数之比):
325. Explain the working of AJAX.
解释 AJAX 的工作原理。
- 知识点: 其他/未分类 (标签: interviewbit, goldman-sachs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 高盛
- id: 69b37b1458d557c902bacc04 | 官方: 否 | 付费: 否
答案:
Ajax (Asynchronous JavaScript and XML) is a set of web development approaches that generate asynchronous web applications using various client-side web technologies. Web applications that use Ajax can transmit and get data from a server asynchronously (in the background) without interfering with the existing page's appearance and behaviour.
Ajax(异步 JavaScript 和 XML)是一组 Web 开发方法,利用各种客户端 Web 技术生成异步 Web 应用程序。使用 Ajax 的 Web 应用程序可以异步(在后台)从服务器传输和获取数据,而不干扰现有页面的外观和行为。
The XMLHttpRequest Object is used by Ajax to communicate with the server. The user submits a request using the User Interface, and a JavaScript call is made to the XMLHttpRequest Object, which then sends an XMLHttp request to the XMLHttpRequest Object. At that point, the server interacts with the database via php, servlet, ASP.net, and other technologies. The data is retrieved, and the server transmits it to the XMLHttpRequest Callback method in the form of XML or Jason data. The Data then is presented on the browser using HTML and CSS.
XMLHttpRequest 对象被 Ajax 用于与服务器通信。用户通过用户界面提交请求,然后向 XMLHttpRequest 对象发起 JavaScript 调用,该对象随后向 XMLHttpRequest 对象发送一个 XMLHttp 请求。此时,服务器通过 php、servlet、ASP.net 和其他技术与数据库进行交互。数据被检索后,服务器以 XML 或 JSON 数据的形式将其传输到 XMLHttpRequest 回调方法。随后,数据使用 HTML 和 CSS 在浏览器上呈现。
326. Given an array of strings, you need to remove strings which are anagrams of strings preceding them in the given array. You need to return the remaining strings in sorted order.
给定一个字符串数组,你需要移除那些与其之前字符串为变位词的字符串。你需要以排序后的顺序返回剩余的字符串。
- 知识点: 其他/未分类 (标签: interviewbit, goldman-sachs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 高盛
- id: 69b37b1458d557c902bacc07 | 官方: 否 | 付费: 否
答案:
For example, Input : “tea”, “ate”, “anagram”, “eat”, “gramaan”
例如,输入:“tea”、“ate”、“anagram”、“eat”、“gramaan”
Output : “anagram”, “tea”
输出:“anagram”、“tea”
Explanation : The words "ate" and "eat" are anagrams of the word "tea." Due to the fact that "gramaan" is an anagram of "anagram," the array becomes ["anagram", "tea"].
解释:单词“ate”和“eat”是单词“tea”的变位词。由于“gramaan”是“anagram”的变位词,数组变为[“anagram”,“tea”]。
Approach:
方法:
We can simply sort and compare the given two strings to see if they are anagrams or not. We may also use a hashmap to see if a string has appeared or not. Make an auxiliary array to store the generated strings, as well as a hashmap to keep track of the string we've found thus far. Then iterate through the array's supplied string, sort the current string, and look it up in the hashmap.
我们可以简单地排序并比较给定的两个字符串,以判断它们是否是变位词。我们也可以使用哈希映射来查看某个字符串是否已出现。创建一个辅助数组来存储生成的字符串,以及一个哈希映射来跟踪我们到目前为止已经找到的字符串。然后遍历数组中提供的字符串,对当前字符串进行排序,并在哈希映射中查找它。
If the current text is not found in the hashmap, insert the sorted string arr[i] in the resultant array. After that, sort the array and print each string.
如果在哈希映射中未找到当前文本,则将已排序的字符串arr[i]插入结果数组中。之后,对数组进行排序并打印每个字符串。
Code:
代码:
void uniqueAnagrams(string arr[], int n)
void uniqueAnagrams(string arr[], int n)
{
vector
vectorresult;
//to keep track of already encountered sorted string
//用于跟踪已遇到的排序字符串
unordered_setfound;
unordered_setfound;
for (int i = 0; i < n; i++) {
for (int i = 0; i < n; i++) {
string cur_word = arr[i];
string cur_word = arr[i];
// sorting the current string
//对当前字符串进行排序
sort(begin(cur_word), end(cur_word));
sort(begin(cur_word), end(cur_word));
// Checking if the current sorted string is present in the data structure already
//检查当前排序字符串是否已经存在于数据结构中
if (found.find(cur_word) == found.end()) {
if (found.find(cur_word) == found.end()) {
result.push_back(arr[i]);
result.push_back(arr[i]);
found.insert(cur_word);
found.insert(cur_word);
}
}
// Sorting the answer vector
// 对答案向量进行排序
sort(begin(result), end(result));
sort(begin(result), end(result));
// Printing the answer
// 打印答案
for (int i = 0; i < result.size(); ++i) {
for (int i = 0; i < result.size(); ++i) {
cout << result[i] << " ";
cout << result[i] << " ";
}
}
Explanation:
说明:
In the above code, we created a function uniqueAnagrams, which removes all the duplicate anagrams and prints the sorted array. We take the help of a hashmap to store each visited string in its sorted form. If the current string is not found in the hash map, we push it in the answer vector. At last we sort the answer vector and then display the resultant vector.
在上述代码中,我们创建了一个函数 uniqueAnagrams,它移除所有重复的变位词并打印排序后的数组。我们借助一个哈希映射来存储每个已访问字符串的排序形式。如果当前字符串在哈希映射中未找到,则将其推入答案向量。最后,我们对答案向量进行排序并显示结果向量。
327. Given an array whose elements denote the price of a stock on the ith day, find the maximum profit that you can make by purchasing and selling those stocks. No stock can be bought unless the previously bought stock has been sold.
给定一个数组,其元素表示第 i 天的股票价格,找出通过买卖这些股票可以获得的最大利润。只有之前购买的股票已卖出,才能购买新的股票。
- 知识点: 其他/未分类 (标签: interviewbit, goldman-sachs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 高盛
- id: 69b37b1458d557c902bacc0a | 官方: 否 | 付费: 否
答案:
For example, If the array is 100, 180, 260, 310, 40, 535, 695 Then, the output will be 765
例如,如果数组是 100, 180, 260, 310, 40, 535, 695,那么输出将是 765
Explanation of the above test case: The maximum profit can be achieved by buying on day 0 and selling on day 3 and then buying on day 4 and selling on day 6.
上述测试用例的解释:最大利润可以通过在第 0 天买入、第 3 天卖出,然后在第 4 天买入、第 6 天卖出实现。
Approach:
方法:
In our approach, we will iterate through each of the prices of the stock starting from day 1 and check if its price is greater than the previous day’s price. This is because there is no limit on the number of transactions being made. For example, buying a stock on day 1 and selling on day 4 is equivalent to buying a stock on day 1, selling on day 2, buying on day 2, selling on day 3, buying on day 3, selling on day 4.
在我们的方法中,我们将从第 1 天开始遍历每一只股票的价格,并检查其价格是否高于前一天的價格。这是因为对交易次数没有限制。例如,在第 1 天买入股票并在第 4 天卖出,等同于在第 1 天买入、第 2 天卖出,第 2 天买入、第 3 天卖出,第 3 天买入、第 4 天卖出。
Code:
代码:
include<bits/stdc++.h>
using namespace std;
using namespace std;
//function to calculate the maximum profit attainable
//函数,用于计算可获得的最大利润
int maximiseProfit(int prices[], int size)
int maximiseProfit(int prices[], int size)
{
int maximumProfit = 0; // stores the maximum profit
int maximumProfit = 0; // 存储最大利润
for(int i = 1; i < size; i ++)
for(int i = 1; i < size; i ++)
{
if(prices[i] - prices[i - 1] > 0)
if(prices[i] - prices[i - 1] > 0)
maximumProfit += prices[i] - prices[i - 1];
maximumProfit += prices[i] - prices[i - 1];
}
return maximiseProfit;
return maximiseProfit;
}
int main()
int main()
{
int prices[] = { 100, 180, 260, 310, 40, 535, 695 };
int prices[] = { 100, 180, 260, 310, 40, 535, 695 };
int size = sizeof(prices) / sizeof(prices[0]);
int size = sizeof(prices) / sizeof(prices[0]);
cout << maximiseProfit(prices, size) << endl;
cout << maximiseProfit(prices, size) << endl;
return 0;
return 0;
}
Explanation:
说明:
In the above code, the function maximiseProfit calculates the maximum profit attainable on the given set of stock prices. We iterate over the array and add up any difference in which an element is greater than its preceding element.
在上述代码中,函数 maximiseProfit 计算给定股票价格集合可获得的最大利润。我们遍历数组,并累加任何元素大于其前一个元素时所产生的差值。
328. You are given a number N. You need to check if it can be written as a sum of k prime numbers.
给定一个数字 N,你需要检查它是否可以被写成 k 个质数的和。
- 知识点: 其他/未分类 (标签: interviewbit, goldman-sachs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 高盛
- id: 69b37b1458d557c902bacc0d | 官方: 否 | 付费: 否
答案:
For example, Input : N = 5, k = 2
例如,输入:N = 5, k = 2
Output : True
输出:True
Explanation : 10 can be written as 5 + 5
解释:10 可以写成 5 + 5
Input : N = 2, k = 2
输入:N = 2, k = 2
Output : False
输出:False
Approach:
方法:
We use the Goldbach Conjecture for solving this problem. Goldbach’s conjecture states that every even integer (greater than 2) can be represented as the sum of two primes.
我们使用哥德巴赫猜想来解决此问题。哥德巴赫猜想指出,每个大于 2 的偶整数都可以表示为两个质数的和。
When N >= 2k and k = 1:
当 N >= 2k 且 k = 1 时:
The answer will be True if and only if N is a prime number
当且仅当 N 是素数时,答案才为 True
When N >= 2K and K = 2:
当 N >= 2K 且 K = 2 时:
If N is an even number the answer will be Yes(Goldbach’s conjecture)
如果 N 是偶数,答案为 Yes(哥德巴赫猜想)
If N is odd the answer will be No if N-2 is not a prime number and Yes if N-2 is a prime number.
如果 N 是奇数,答案为 No(当 N-2 不是素数)或 Yes(当 N-2 是素数)。
This is because we know odd + odd = even and even + odd = odd. So when N is odd, and K = 2 one number must be 2 as it is the only even prime number so now the answer depends on whether N-2 is odd or not.
这是因为我们知道奇数 + 奇数 = 偶数,偶数 + 奇数 = 奇数。所以当 N 是奇数且 K = 2 时,其中一个数必须是 2,因为它是唯一的偶素数,因此答案取决于 N-2 是否为奇数。
When N >= 2K and K >= 3:
当 N >= 2K 且 K >= 3 时:
The answer will always be True. This is because when N is even N – 2(K-2) is also, even so, N – 2(K – 2) can be written as the sum of two prime numbers p, q and N can be written as 2, 2 …..K – 2 times, p, q.
答案总是 True。这是因为当 N 是偶数时,N – 2(K-2) 也是偶数,所以 N – 2(K – 2) 可以写成两个素数 p, q 的和,N 可以写成 2, 2 …..(K – 2 次),p, q。
When N is odd N – 3 -2*(K – 3) is even so it can be written as the sum of two prime numbers p, q and N can be written as 2, 2 …..K-3 times, 3, p, q
当 N 是奇数时,N – 3 -2*(K – 3) 是偶数,所以它可以写成两个素数 p, q 的和,N 可以写成 2, 2 …..(K-3 次),3, p, q
// function to check if a number is prime
// 函数用于检查一个数是否为素数
bool checkPrime(int x)
bool checkPrime(int x)
{
for (int i = 2; i * i <= x; i++)
for (int i = 2; i * i <= x; i++)
if (x % i == 0)
if (x % i == 0)
return false;
返回 false;
return true;
返回 true;
}
bool checkSumOfKPrimes(int N, int k)
bool checkSumOfKPrimes(int N, int k)
{
// We return false if N < 2*k
// 如果 N < 2*k,我们返回 false
if (N < 2*k)
if (N < 2*k)
return false;
返回 false;
// If k = 1 we check if N is prime or not
// 如果 k = 1,我们检查 N 是否为质数
if (k == 1)
if (k == 1)
return checkPrime(N);
return checkPrime(N);
if (k == 2)
if (k == 2)
{
// if N is even the answer is true;
// 如果 N 是偶数,答案为 true;
if (N % 2 == 0)
if (N % 2 == 0)
return true;
返回 true;
// If N is odd, we check if N - 2 is prime or not
// 如果 N 是奇数,我们检查 N - 2 是否为质数
return checkPrime(N - 2);
return checkPrime(N - 2);
}
// If k >= 3, we return true;
// 如果 k >= 3,我们返回 true;
return true;
返回 true;
}
Explanation:
说明:
In the above code, we created a function checkPrime which takes one input parameter and we check if the given input is a prime number or not. We also created a function checkSumOfKPrimes which takes two input parameters N and k. In the function, we check if N can be represented as a sum of k prime numbers using the conditions of the Goldman Conjecture.
在上述代码中,我们创建了一个函数 checkPrime,它接受一个输入参数,并检查给定输入是否为质数。我们还创建了一个函数 checkSumOfKPrimes,它接受两个输入参数 N 和 k。在该函数中,我们使用哥德巴赫猜想的条件检查 N 是否可以表示为 k 个质数的和。
329. Explain BFS (Breadth First Search) vs DFS (Depth First Search) in context of graph traversal.
在图遍历的背景下,解释 BFS(广度优先搜索)与 DFS(深度优先搜索)的区别。
- 知识点: 其他/未分类 (标签: interviewbit, goldman-sachs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 高盛
- id: 69b37b1458d557c902bacc13 | 官方: 否 | 付费: 否
答案:
- Breadth-First Search (BFS) is a vertex-based method that begins at the root of the tree and traverses all nodes at the current depth level before moving on to nodes at the next depth level. It employs a Queue data structure that follows the first-in, first-out principle. In BFS, one vertex is visited and marked at a time, then its neighbours are visited and placed in the queue.
- Depth First Search (DFS) is an edge-based approach. It employs the Stack data structure and operates in two stages: first, visited vertices are pushed into the stack, and subsequently, if no vertices are present, visited vertices are popped.
| BFS | DFS |
|---|---|
| BFS stands for Breadth First Search. BFS代表广度优先搜索。 | DFS stands for Depth First Search. DFS代表深度优先搜索。 |
| BFS(Breadth First Search) employs the Queue data structure to determine the shortest path. BFS(广度优先搜索)使用队列数据结构来确定最短路径。 | DFS(Depth First Search) employs the Stack data structure. DFS(深度优先搜索)使用栈数据结构。 |
| Because BFS reaches a vertex with the fewest number of edges from a source vertex, it can be used to identify a single source shortest path in an unweighted graph. 由于BFS从源顶点出发经过最少边数到达顶点,因此可用于在无权图中识别单源最短路径。 | To get from a source vertex to a destination vertex in DFS, we may have to traverse through additional edges. 在DFS中,要从源顶点到达目标顶点,我们可能需要遍历额外的边。 |
| BFS is better at finding vertices that are close to the specified source. BFS在查找靠近指定源的顶点方面更优。 | When there are solutions that are not close to the source, DFS is a better option. 当存在不靠近源的解决方案时,DFS是更好的选择。 |
| BFS has a time complexity of O(V + E) when using an Adjacency List and O(V^2) when using an Adjacency Matrix, where V stands for vertices and E stands for edges. 使用邻接表时BFS的时间复杂度为O(V + E),使用邻接矩阵时为O(V^2),其中V代表顶点,E代表边。 | DFS also has a time complexity of O(V + E) when using an Adjacency List and O(V2) when using an Adjacency Matrix, where V stands for vertices and E stands for edges. 使用邻接表时DFS的时间复杂度也为O(V + E),使用邻接矩阵时为O(V^2),其中V代表顶点,E代表边。 |
| Here, the siblings of a node are visited before visiting the children. 在此,访问节点的兄弟节点先于其子节点。 | Here, children of a node are visited before visiting the siblings. 在此,访问节点的子节点先于其兄弟节点。 |
330. Differentiate between StringBuffer and StringBuilder classes in the context of Java.
在Java上下文中区分StringBuffer和StringBuilder类。
- 知识点: 其他/未分类 (标签: interviewbit, goldman-sachs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 高盛
- id: 69b37b1458d557c902bacc2b | 官方: 否 | 付费: 否
答案:
Strings are Java objects that are internally supported by a char array. Strings are immutable because arrays are immutable (they can't grow). Every time you make a change to a String, a new String is produced. Java, on the other hand, has a number of classes that can be used to manipulate strings. StringBuffer and StringBuilder are two such classes.
字符串是由字符数组内部支持的Java对象。由于数组是不可变的(它们不能增长),因此字符串是不可变的。每次对字符串进行更改时,都会生成一个新的字符串。另一方面,Java有许多可用于操作字符串的类。StringBuffer和StringBuilder就是两个这样的类。
| StringBuffer | StringBuilder |
|---|---|
| The StringBuffer class is synchronized. This means that several threads cannot call the StringBuffer methods at the same time. StringBuffer类是同步的。这意味着多个线程不能同时调用StringBuffer方法。 | The StringBuilder class is asynchronized. This means that several threads cannot call the StringBuilder methods at the same time. StringBuilder类是异步的。这意味着多个线程不能同时调用StringBuilder方法。 |
| StringBuffer is known as a thread-safe class because of its synchronisation. 由于其同步性,StringBuffer被称为线程安全类。 | StringBuilder is not a thread-safe class due to its asynchronous nature. 由于其异步特性,StringBuilder不是线程安全类。 |
| StringBuffer is much slower than StringBuilder due to synchronisation. 由于同步,StringBuffer比StringBuilder慢得多。 | StringBuilder is much faster than StringBuffer since there is no preliminary check for multiple threads. 由于没有多线程的初步检查,StringBuilder比StringBuffer快得多。 |
331. Discuss the final keyword in Java.
讨论Java中的final关键字。
- 知识点: 其他/未分类 (标签: interviewbit, goldman-sachs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 高盛
- id: 69b37b1458d557c902bacc2e | 官方: 否 | 付费: 否
答案:
In Java, the final keyword is used to restrict the user. The final keyword in Java can be used in a variety of situations. The final keyword could be used with a variable, method or class. Once a variable, function, or class has been declared final, it can only be assigned once. That is to say, - Final variable: If you mark a variable as final, you won't be allowed to change its value (It will be constant).
在Java中,final关键字用于限制用户。Java中的final关键字可以在各种情况下使用。final关键字可以与变量、方法或类一起使用。一旦变量、函数或类被声明为final,它就只能被赋值一次。也就是说,- final变量:如果你将变量标记为final,你将不允许更改其值(它将成为常量)。
- Final method: You can't override a method that has been marked as final.
- Final class: You can't extend a class that has been marked as final.
332. Explain hashCode() and equals() in Java.
解释Java中的hashCode()和equals()。
- 知识点: 其他/未分类 (标签: interviewbit, goldman-sachs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 高盛
- id: 69b37b1458d557c902bacc31 | 官方: 否 | 付费: 否
答案:
HashMap is part of the Java collection framework. HashMap uses a technique known as hashing. Hashing is the process of converting an object into an integer value. Indexing and search speed are aided by the integer value. It is in charge of creating the map interface. It stores the data in a Key/Value pair. In HashMap, the node is represented as a class that holds an array of nodes. Internally, it uses an array and LinkedList data structure to hold Key and Value. There are four fields in HashMap.
HashMap是Java集合框架的一部分。HashMap使用一种称为哈希的技术。哈希是将对象转换为整数值的过程。整数值有助于索引和搜索速度。它负责创建映射接口。它以键/值对的形式存储数据。在HashMap中,节点表示为一个包含节点数组的类。在内部,它使用数组和链表数据结构来存储键和值。HashMap中有四个字段。
- equals() is a function that compares two objects to see if they are equal. It compares the Key to see if they are equivalent. It belongs to the Object class and is a method. It is possible to override it. It is required to override the hashCode() method if you override the equals() method.
- hashCode() is an object class method. It returns the object's memory reference in integer form. The bucket number is determined by the value returned by the method. The address of the element within the map is represented by the bucket number. Null Key's hash code is 0.
333. How many rounds are there in Goldman Sachs internship?
高盛实习有几轮?
- 知识点: 其他/未分类 (标签: interviewbit, goldman-sachs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 高盛
- id: 69b37b1458d557c902bacc5f | 官方: 否 | 付费: 否
答案:
Generally, there will be 3 rounds for the Goldman Sachs internship : - Online assessment test
通常,高盛实习会有3轮:- 在线评估测试
- Technical interviews
- HR interview
334. How much does Goldman Sachs pay interns?
高盛支付实习生多少工资?
- 知识点: 其他/未分类 (标签: interviewbit, goldman-sachs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 高盛
- id: 69b37b1458d557c902bacc62 | 官方: 否 | 付费: 否
答案:
The average annual pay for a summer intern can be around 4 lakhs per annum.
暑期实习生的平均年薪大约为每年40万卢比。
335. Are Goldman Sachs interviews tough?
高盛的面试难吗?
- 知识点: 其他/未分类 (标签: interviewbit, goldman-sachs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 高盛
- id: 69b37b1458d557c902bacc65 | 官方: 否 | 付费: 否
答案:
It makes no difference if the Goldman Sachs interview is difficult or simple. The truth is that the more you prepare for the interviews, the more likely you are to succeed. Learn everything there is to know about interviews, including stages, rounds, and questions. Understand the role completely, including what they expect from you, the skill sets you'll require, and the credentials you'll require.
高盛面试是难还是简单并不重要。事实是,你为面试准备得越多,成功的可能性就越大。了解关于面试的一切,包括阶段、轮次和问题。完全理解职位角色,包括他们对你的期望、你所需的技能组合以及你所需的资质。
336. Why Goldman sachs?
为什么选择高盛?
- 知识点: 其他/未分类 (标签: interviewbit, goldman-sachs, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 高盛
- id: 69b37b1458d557c902bacc70 | 官方: 否 | 付费: 否
答案:
Engineers at Goldman Sachs don't just make things; they make things possible. Goldman Sachs gives candidates the chance to solve the most difficult and pressing engineering problems for clients while also leveraging machine learning and financial engineering to continuously turn data into action and create new businesses, transform finance, and explore a world of opportunity at market speed.
高盛的工程师不只是创造东西;他们使事情成为可能。高盛给候选人机会解决客户端最困难和最紧迫的工程问题,同时利用机器学习和金融工程不断将数据转化为行动,创造新业务、变革金融,并以市场速度探索充满机遇的世界。
Coding Problems
0/3
Easy Problems
简单问题
Dynamic Programming
动态规划
Arrays
数组
Puzzles
谜题
Stairs
阶梯
Easy
简单
15.14 Mins
15.14分钟
Solve
解答
Max Sum Contiguous Subarray
最大连续子数组和
Easy
简单
33.39 Mins
33.39分钟
Solve
解答
Fastest Horses
最快的马
Easy
简单
7.52 Mins
7.52分钟
Solve
解答
0/5
Intermediate Problems
中级问题
Greedy Algorithm
贪心算法
Arrays
数组
Hashing
哈希
Binary Search
二分查找
Gas Station
加油站
Medium
中等
56.42 Mins
56.42分钟
Solve
解答
Largest Number
最大数
Medium
中等
70.26 Mins
70.26 分钟
Solve
解答
First Missing Integer
第一个缺失的正整数
Medium
中等
64.38 Mins
64.38分钟
Solve
解答
Anagrams
字谜
Medium
中等
46.36 Mins
46.36分钟
Solve
解答
Median of Array
数组的中位数
Medium
中等
87.6 Mins
87.6分钟
Solve
解答
0/2
Advanced Problems
进阶问题
Dynamic Programming
动态规划
Stacks And Queues
栈和队列
Regular Expression Match
正则表达式匹配
Hard
困难
80.12 Mins
80.12 分钟
Solve
解答
Rain Water Trapped
雨水收集
Hard
困难
59.6 Mins
59.6 分钟
Solve
解答
337. Given an array arr = [4, 5, 3, 7, 2, 11]. Print the array such that each index consists of the element which is next greater to it.
给定一个数组 arr = [4, 5, 3, 7, 2, 11]。打印数组,使每个索引包含其后第一个比它大的元素。
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b2f58d557c902badb86 | 官方: 否 | 付费: 否
答案:
Example - Output array = [5, 7, 7, 11, 11, 0]
示例 - 输出数组 = [5, 7, 7, 11, 11, 0]
Explanation -
解释 -
5 is the next greater element of 4.
5 是 4 的后面第一个更大的元素。
7 is the next greater element of 5.
7 是 5 的下一个更大元素。
7 is the next greater element of 3.
7 是 3 的下一个更大元素。
11 is the next greater element of 7.
11 是 7 的下一个更大元素。
11 the next greater element of 2.
11 是 2 的下一个更大元素。
Last is 0 because there is no next greater element to this.
最后是 0,因为该元素之后没有更大的元素。
Solution:
解决方案:
The intuitive solution is to find the greater element just after the current element. For this, we can use the brute force approach by using the nested loop. But this solution's time complexity will be O(n^2). Which is not very optimal. So for optimization, we can use a monotonic stack.
直观的解决方案是找到当前元素之后的更大元素。为此,我们可以使用嵌套循环的暴力方法。但此解决方案的时间复杂度为 O(n^2),并不理想。因此,为了优化,我们可以使用单调栈。
import java.util.Stack;
import java.util.Stack;
import java.util.ArrayList;
import java.util.ArrayList;
import java.util.List;
import java.util.List;
public class InterviewBit
public class InterviewBit
{
public static ListnextGreaterElement(int[] arr){
public static ListnextGreaterElement(int[] arr){
//Integer Array that stores the answer.
//存储答案的整数数组。
Listans = new ArrayList<>();
Listans = new ArrayList<>();
//Using a stack for finding the solution.
//使用栈来找到解决方案。
Stackstack = new Stack<>();
Stackstack = new Stack<>();
for(int i = 0; i < arr.length; i++){
for(int i = 0; i < arr.length; i++){
//Pushing element onto the stack either stack is empty or element is less than stack top.
//将元素压入栈中,无论是栈为空还是元素小于栈顶元素。
if(stack.isEmpty() || arr[i] < stack.peek()) {
if(stack.isEmpty() || arr[i] < stack.peek()) {
stack.push(arr[i]);
stack.push(arr[i]);
}else{
}否则{
//If found the element greater than stack top then that is the next greater element so we need to add it to the answer list.
//如果找到的元素大于栈顶元素,则这就是下一个更大元素,所以我们需要将其添加到答案列表中。
while(!stack.isEmpty() && stack.peek() < arr[i]){
while(!stack.isEmpty() && stack.peek() < arr[i]){
ans.add(arr[i]);
ans.add(arr[i]);
stack.pop();
stack.pop();
}
//Pushing that greater element in stack for next cycle
//将那个更大的元素压入栈中,用于下一轮循环
stack.push(arr[i]);
stack.push(arr[i]);
}
}
//Adding the 0 to the answer array if no greater element exists.
//如果没有更大的元素存在,则将0添加到答案数组中。
while(!stack.isEmpty()){
while(!stack.isEmpty()){
ans.add(0);
ans.add(0);
stack.pop();
stack.pop();
}
return ans;
return ans;
}
public static void main(String[] args) {
public static void main(String[] args) {
System.out.println(nextGreaterElement(new int[]{4,5,3,7,2,11}));
System.out.println(nextGreaterElement(new int[]{4,5,3,7,2,11}));
}
}
The time complexity of the above approach is O(n) because we are only visiting once in every element. Because we are using a stack, the space complexity will also be O(n) .
上述方法的时间复杂度为 O(n),因为我们只对每个元素访问一次。由于我们使用了栈,空间复杂度也为 O(n)。
338. Given an array named prices, you want to determine the profit you can make by purchasing a stock on a single day and then selling it on a different day.
给定一个名为 prices 的数组,你想确定在某一天购买股票并在另一天卖出所能获得的利润。
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b2f58d557c902badb89 | 官方: 否 | 付费: 否
答案:
Example -
示例 -
Input: prices = [4,7,1,8,2,9]
输入:prices = [4,7,1,8,2,9]
Output: 9
输出:9
Explanation: Buy stocks on day 3 (price = 1) and sell on day 6 (price = 9), profit = 9-1 = 9=8.
解释:在第3天(价格为1)买入股票,并在第6天(价格为9)卖出,利润 = 9-1 = 8。
Solution:
解决方案:
Again the brute force way is to try out all the possibilities by purchasing the stock on each day and try selling it on each day next to it. And from that get the max profit we can get. The time complexity for this will be O(n^2). So to optimize this we try the dynamic programming approach by finding the maximum profit seen so far and what can be the current profit for each day. So the solution for this approach will be -
同样,暴力方法是尝试所有可能性,即每天购买股票并尝试在之后的每一天卖出。从中我们可以得到能获得的最大利润。这种方法的时间复杂度为 O(n^2)。为了优化这一点,我们尝试使用动态规划方法,通过找出到目前为止看到的最大利润以及每天可能获得的当前利润。因此,这种方法的解决方案如下:
public class InterviewBit
public class InterviewBit
{
public static int maxProfit(int[] prices) {
public static int maxProfit(int[] prices) {
//Variable to keeptrack of minimum price
//用于跟踪最低价格的变量
int minPrice = Integer.MAX_VALUE;
int minPrice = Integer.MAX_VALUE;
//Variable to keep track of maximum profit seen so far.
//用于跟踪到目前为止看到的最大利润的变量
int profit = 0;
int profit = 0;
for(int i = 0; i < prices.length; i++){
for(int i = 0; i < prices.length; i++){
minPrice = Math.min(minPrice, prices[i]);
minPrice = Math.min(minPrice, prices[i]);
profit = Math.max(profit, (prices[i] - minPrice));
profit = Math.max(profit, (prices[i] - minPrice));
}
return profit;
return profit;
}
public static void main(String[] args) {
public static void main(String[] args) {
System.out.println(maxProfit(new int[]{4,7,1,8,2,9}));
System.out.println(maxProfit(new int[]{4,7,1,8,2,9}));
}
}
The time complexity of the above approach is O(n) because we are traversing to each element only once. And the space complexity is O(1) constant because it only keeps track of a constant variable for any set of input.
上述方法的时间复杂度为 O(n),因为我们只遍历每个元素一次。空间复杂度为 O(1) 常数,因为它对于任何输入集合只跟踪一个常数变量。
339. Return all possible letter combinations that a given number string could represent, given that the digits 2-9 are included. The answer may be returned in any order.
返回给定数字字符串可能表示的所有字母组合,前提是包含数字 2-9。答案可以按任何顺序返回。
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b2f58d557c902badb8f | 官方: 否 | 付费: 否
答案:
For example, if the string “34” is provided, then the possible solutions are - ["dg","dh","di","eg","eh","ei","fg","fh","fi"].
例如,如果提供字符串 “34”,则可能的解为 - ["dg","dh","di","eg","eh","ei","fg","fh","fi"]。
Solution
解决方案
As a result, we need to generate all possible letters. So here we have to apply the brute force backtracking approach because we must explore all possible solutions. So the backtracking solution will be -
因此,我们需要生成所有可能的字母。所以这里我们必须应用暴力回溯方法,因为我们必须探索所有可能的解。所以回溯解决方案将是 -
class InterviewBit {
class InterviewBit {
Listans; //answer that stores all the combinations.
Listans; //存储所有组合的答案。
//method that returns the possible letters from the given keys.
//返回给定键可能字母的方法。
private String letters(char ch){
private String letters(char ch){
switch(ch){
switch(ch){
case '2': return "abc";
case '2': return "abc";
case '3': return "def";
case '3': return "def";
case '4': return "ghi";
case '4': return "ghi";
case '5': return "jkl";
case '5': return "jkl";
case '6': return "mno";
case '6': return "mno";
case '7': return "pqrs";
case '7': return "pqrs";
case '8': return "tuv";
case '8': return "tuv";
case '9': return "wxyz";
case '9': return "wxyz";
default: return "";
default: return "";
}
}
//Method that recursively explores the path to generate the answer.
//递归探索路径以生成答案的方法。
private void solution(String digits, int i, StringBuffer sb){
private void solution(String digits, int i, StringBuffer sb){
//Base case when letters end then the possible combination of letters are added to the answer list.
//基本情况:当字母结束时,将可能的字母组合添加到答案列表中。
if(i == digits.length()){
if(i == digits.length()){
ans.add(sb.toString());
ans.add(sb.toString());
return;
return;
}
//Getting each character and generating all the combinations.
//获取每个字符并生成所有组合。
String letter = letters(digits.charAt(i));
String letter = letters(digits.charAt(i));
for(int j = 0; j < letter.length(); j++){
for(int j = 0; j < letter.length(); j++){
sb.append(letter.charAt(j));
sb.append(letter.charAt(j));
//Recursively generating the other possible combination of letters.
//递归生成其他可能的字母组合。
solution(digits, i+1, new StringBuffer(sb));
solution(digits, i+1, new StringBuffer(sb));
//Backtracking
//回溯
sb.deleteCharAt(sb.length()-1);
sb.deleteCharAt(sb.length()-1);
}
}
public ListcombinationLetters(String digits) {
public ListcombinationLetters(String digits) {
ans = new ArrayList<>();
ans = new ArrayList<>();
solution(digits, 0, new StringBuffer());
solution(digits, 0, new StringBuffer());
return ans;
return ans;
}
}
340. What is an Exception and Why does it happen?
什么是异常以及为什么会发生异常?
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b2f58d557c902badba1 | 官方: 否 | 付费: 否
答案:
Exception is the Unexpected situation that may happen in the program that breaks the normal flow of the program. An exception is usually caused by unexpected situations like invalid user input, network connection failure, disk full, and so on. An exception is often represented by the java keyword throw when raising an exception and try and catch keywords for handling it.
异常是程序中可能发生的意外情况,它会中断程序的正常流程。异常通常由意外情况引起,如无效的用户输入、网络连接失败、磁盘已满等。异常通常用Java关键字throw在引发时表示,用try和catch关键字处理。
341. What is Context Switching?
什么是上下文切换?
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b2f58d557c902badba4 | 官方: 否 | 付费: 否
答案:
Context switching is often done by a kernel’s task scheduler, which maintains a list of processes that are currently executing and another list of processes that are ready to execute but not currently executing. When a process on the ready list needs to be switched to the executing list, either because it has completed its task or it has been given a new task, the kernel’s task scheduler determines which process on the executing list to switch out, and which process on the ready list to switch in.
上下文切换通常由内核的任务调度器完成,它维护当前正在执行的进程列表和准备执行但尚未执行的进程列表。当准备列表中的进程需要切换到执行列表时,无论是因其任务已完成还是被赋予新任务,内核的任务调度器会确定执行列表中的哪个进程被切换出去,以及准备列表中的哪个进程被切换进来。
342. Explains something about VPN with an example.
用一个例子解释VPN的相关内容。
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b2f58d557c902badbaa | 官方: 否 | 付费: 否
答案:
VPN (Virtual Private Network) is the private network that establishes a secure connection between two nodes.
VPN(虚拟专用网络)是一种在两个节点之间建立安全连接的专用网络。
For Example - The client’s computer is connected to the organization’s network via the internet. The VPN software helps protect the computer and the data being transmitted. The VPN client software creates a secure connection to a remote server. The VPN server acts as a go-between, receiving data from your computer and then forwarding it to the destination you desire — be it a website, remote network, or some other computer. VPNs work by putting your computer in a “tunnel” that blocks all uninvited guests. It does this by encrypting your data and routing it through a different IP address — one belonging to the VPN company. VPNs also keep you anonymous by not logging your IP address.
例如——客户端计算机通过互联网连接到组织的网络。VPN软件有助于保护计算机和正在传输的数据。VPN客户端软件会与远程服务器建立安全连接。VPN服务器充当中间人,接收来自您计算机的数据,然后将其转发到您想要的目的地——无论是网站、远程网络还是其他计算机。VPN通过将您的计算机置于一个“隧道”中来阻止所有不速之客。它通过加密您的数据并通过不同的IP地址(属于VPN公司的IP地址)进行路由来实现这一点。VPN还通过不记录您的IP地址来保持您的匿名性。
343. What is RAID Structure in OS?
什么是操作系统中的RAID结构?
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b2f58d557c902badbad | 官方: 否 | 付费: 否
答案:
RAID (Redundant Arrays of Independent Disks) is an information virtualization technology that uses multiple hard disks to store data. It combines independent hard drives to store data in order to save data. It balances data security, system performance, storage capacity, and other variables. Data storage performance and reliability are enhanced with RAID. It improves the performance and reliability of data storage. RAID increases storage capacity and minimizes data loss by providing data redundancy.
RAID(独立磁盘冗余阵列)是一种信息虚拟化技术,使用多个硬盘来存储数据。它将独立的硬盘组合起来存储数据以保存数据。它平衡了数据安全性、系统性能、存储容量和其他变量。RAID增强了数据存储的性能和可靠性。它提高了数据存储的性能和可靠性。RAID通过提供数据冗余来增加存储容量并最小化数据丢失。
344. What are Semaphores and why is it used?
什么是信号量,为什么使用它?
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b3058d557c902badbb3 | 官方: 否 | 付费: 否
答案:
A semaphore can be used to synchronize access to critical sections in a program by using the two atomic operations wait() and signal(). The atomic operation signal() indicates that the critical section is available, and the atomic operation wait() prevents other processes from entering the critical section until the current process finishes using it. A semaphore can only hold one positive integer value.
信号量可用于同步程序中关键部分的访问,通过使用两个原子操作wait()和signal()。原子操作signal()表示关键部分可用,而原子操作wait()阻止其他进程进入关键部分,直到当前进程使用完它。信号量只能保存一个正整数。
Semaphores are used in situations where you have to control the flow of activities and/or secure a resource. For example, let’s say you are working with a company and you have to create a system that will only allow a certain number of employees to log in at any given time. You can use semaphores to control the flow of employees logging in to the system and prevent the system from being overloaded. Semaphores are widely used in real-time systems like communications, real-time control systems, process control systems, manufacturing systems, and so on.
信号量用于需要控制活动流程和/或保护资源的场景。例如,假设您在一家公司工作,必须创建一个系统,该系统在任何给定时间只允许一定数量的员工登录。您可以使用信号量来控制员工登录系统的流程,并防止系统过载。信号量广泛用于实时系统,如通信、实时控制系统、过程控制系统、制造系统等。
345. Explain something about DHCP?
请解释一下DHCP是什么?
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b3058d557c902badbb7 | 官方: 否 | 付费: 否
答案:
DHCP (Dynamic Host Configuration Protocol) is used in most enterprises as well as homes to facilitate the server-client model where the DHCP server is the server and all the devices on the network are the clients. The DHCP server sends a lease to the clients that they can use the IP address for a certain amount of time. After the lease expires, it gets a new IP address from the DHCP server. The client device can request a new IP address from the DHCP server when it has exceeded its lease. The DHCP server has a pool of IP addresses from which it allocates to the clients.
DHCP(动态主机配置协议)在大多数企业和家庭中使用,以促进服务器-客户端模型,其中DHCP服务器是服务器,网络上的所有设备都是客户端。DHCP服务器向客户端发送一个租约,允许它们使用IP地址一段时间。租约到期后,它会从DHCP服务器获取新的IP地址。客户端设备在超过租约后可以向DHCP服务器请求新的IP地址。DHCP服务器有一个IP地址池,从中分配给客户端。
346. What is Firewall?
什么是防火墙?
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b3058d557c902badbc0 | 官方: 否 | 付费: 否
答案:
When the firewall is enabled, it restricts the traffic between the private network and the public network. It also monitors the traffic to detect any malicious activity. A firewall can be software or hardware-based. It is widely used in offices, schools, and other organizations. It is a very important security system because it protects the data from hackers. It helps prevent cyber-attacks.
防火墙启用时,它限制私有网络和公共网络之间的流量。它还监控流量以检测任何恶意活动。防火墙可以是基于软件或硬件的。它广泛用于办公室、学校和其他组织。它是一个非常重要的安全系统,因为它保护数据免受黑客攻击。它有助于防止网络攻击。
347. What is the Deadlock condition in OS?
什么是操作系统中的死锁条件?
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b3058d557c902badbc3 | 官方: 否 | 付费: 否
答案:
Deadlock is the problem that arises in the operating system while executing the processes. To understand this problem better, let’s see an example of two people, who are working on a construction site. Both are responsible for a certain task and they have to work simultaneously. But their tasks are not independent of each other. One person has to lift a heavy object and place it on a truck and the second person has to take the same object from the truck and place it on the floor. Both of these processes are dependent on each other. If one person stops lifting the object and the other person stops taking the object, then both get stuck without completing their tasks. Now let’s see the same example in a program. In a program, one process has to read a record from a database and place it in a certain table and the second process has to take the same record from the table and place it in another table. Both these tasks are not independent of each other. If one process stops reading a record from the database and the second process stops placing the record in another table, then both get stuck without completing their tasks. This is the deadlock condition.
死锁是操作系统在执行进程时出现的问题。为了更好地理解这个问题,让我们看一个在建筑工地上工作的两个人的例子。两人各自负责某项任务,必须同时工作。但他们的任务不是相互独立的。一个人必须抬起重物并将其放在卡车上,第二个人必须从卡车取出同一物体并放在地板上。这两个进程相互依赖。如果一个人停止抬起物体,另一个人停止取出物体,那么两人都会卡住而无法完成任务。现在让我们在程序中看同样的例子。在程序中,一个进程必须从数据库读取记录并放入特定表中,第二个进程必须从该表取出同一记录并放入另一个表中。这两个任务不是相互独立的。如果一个进程停止从数据库读取记录,第二个进程停止将记录放入另一个表中,那么两者都会卡住而无法完成任务。这就是死锁条件。
348. What is Object-Based Programming?
什么是基于对象的编程?
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: HashedIn
- id: 69b37b3058d557c902badbcc | 官方: 否 | 付费: 否
答案:
Unlike object-oriented programming, which defines the relationships between different types of code, object-based programming deals with the specific implementation of those codes. In other words, object-based programming is the process of writing code that’s been defined in advance as a particular type of object. This is a concept that’s been around since the invention of programming, but it’s been given a name in more recent years as OBP. OBP is an approach to software development that focuses on the creation of specific objects and how they work together. The goal of OBP is not just to create reusable code, but also to create a system of code that’s easy to maintain and extend in the future. The difference between OOP and OBP is found in their approach. While OOP is mostly concerned with creating reusable code, OBP is more concerned with creating a codebase that’s easy to maintain.
与定义不同类型代码之间关系的面向对象编程不同,基于对象的编程处理这些代码的具体实现。换句话说,基于对象的编程是编写预先定义为特定类型对象的代码的过程。这个概念自编程发明以来就存在,但在近年来被命名为OBP。OBP是一种软件开发方法,专注于特定对象的创建以及它们如何协同工作。OBP的目标不仅是创建可重用的代码,还在于创建一个易于维护和未来扩展的代码系统。OOP和OBP的区别在于它们的方法。OOP主要关注创建可重用代码,而OBP更关注创建易于维护的代码库。
349. Differences Between Data Abstraction and Data Hiding.
数据抽象和数据隐藏之间的区别。
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b3058d557c902badbd2 | 官方: 否 | 付费: 否
答案:
Although data abstraction and data hiding are both important concepts in computer programming, they are different in a number of ways. Data abstraction is used to make certain implementation details irrelevant, while data hiding is used to make them inaccessible. Data abstraction is used to make code easier to maintain by keeping the code simple and only exposing what is necessary for it to work. Data hiding is used to make code easier to use by wrapping lower-level functionality in a way that is easier to work with. Data abstraction is used to make changes to code easier by not requiring users to know how something works, while data hiding is used to make changes easier by making it impossible for other parts of the code to access certain variables. Finally, data hiding is a great way to ensure that certain variables remain private and cannot be changed by other parts of the code, while data abstraction is a great way to make implementation details irrelevant so that users only need to see what they need to use the functionality.
尽管数据抽象和数据隐藏都是计算机编程中的重要概念,但它们在多个方面有所不同。数据抽象用于使某些实现细节无关紧要,而数据隐藏用于使其不可访问。数据抽象通过保持代码简洁并仅暴露运作所必需的内容,使代码更易于维护。数据隐藏通过以更易于操作的方式封装较低级别的功能,使代码更易于使用。数据抽象通过不要求用户了解工作原理,使代码更易修改;而数据隐藏通过使代码其他部分无法访问某些变量,使修改更易进行。最后,数据隐藏是确保某些变量保持私有且不被代码其他部分更改的极佳方式,而数据抽象是使实现细节无关紧要、让用户只需看到使用功能所需内容的极佳方式。
Hashedin Interview Preparation
350. Is Deloitte and HashedIn the same?
Deloitte和HashedIn是同一家公司吗?
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b3058d557c902badbf5 | 官方: 否 | 付费: 否
答案:
HasedIn follows the working environment like Deloitte because HashedIn is acquired by Deloitte. But both the firms work differently. HashedIn builds products for other enterprises and startups. HashedIn basically provides Product Engineering Services (PES).
HashedIn遵循类似Deloitte的工作环境,因为HashedIn被Deloitte收购。但两家公司的运作方式不同。HashedIn为其他企业和初创公司构建产品。HashedIn主要提供产品工程服务(PES)。
351. How to apply for Hashedin by Deloitte?
如何申请Deloitte旗下的HashedIn?
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b3058d557c902badbf8 | 官方: 否 | 付费: 否
答案:
HashedIn recruits the fresher candidates from On-Campus, Off-Campus, and also by Employee Referrals. There is another way to apply for HashedIn that is common for both freshers and experienced. That is from the HashedIn career portal .
HashedIn通过校招、社招以及员工推荐招募应届候选人。还有一种适用于应届生和有经验人士的申请方式,即通过HashedIn职业门户网站。
352. Is HashedIn interview difficult?
HashedIn面试难吗?
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b3058d557c902badbfb | 官方: 否 | 付费: 否
答案:
In general, HashedIn Interview is not very difficult to clear. The interviewer's expectation for Software Engineers is better problem solvers. And if you are good at DSA-based problem solving, then you can crack it easily.
总的来说,HashedIn面试不难通过。面试官对软件工程师的期望是更好的问题解决者。如果你擅长基于DSA的问题解决,就能轻松通过。
353. What is the salary of Hashedin by Deloitte?
Deloitte旗下HashedIn的薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b3058d557c902badbfe | 官方: 否 | 付费: 否
答案:
HashedIn offers 8.1 LPA CTC for freshers selected as Software Development Engineer - I. For an experienced person, selected as Software Development Engineer - II, HasedIn offers the CTC on average between 12 - 14 LPA .
HashedIn为被选为软件开发工程师-I的应届生提供8.1 LPA CTC。对于被选为软件开发工程师-II的有经验人士,HashedIn提供的CTC平均在12-14 LPA之间。
354. Is HashedIn good for freshers?
HashedIn适合应届生吗?
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b3058d557c902badc04 | 官方: 否 | 付费: 否
答案:
The HashedIn work environment is great as described by the working professionals of HashedIn. Freshers have to graduate from HashedIn university during their Training. In this, freshers learn various new technologies and experience to write effective production-level code.
根据HashedIn在职专业人士的描述,HashedIn的工作环境很棒。应届生必须在其培训期间毕业于HashedIn大学。在此期间,应届生学习各种新技术,并体验编写高效的生产级代码。
355. How long is the Hashedin by Deloitte Interview?
Deloitte旗下HashedIn面试持续多长时间?
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b3058d557c902badc07 | 官方: 否 | 付费: 否
答案:
In each round of HashedIn Interview for Software engineers, The interview generally lasts for the duration of 1 - 1.5 hrs . And the HashedIn Fitment/HR round generally lasts for 0.5 hrs . After each round, you will get to know about your result whether you are selected for the round or not. The time HashedIn HR takes to respond is mostly between 24 - 72 hours. After the final result, you have to wait for at least 24 hours till you get the letter of intent for confirmation of your joining. Then within a week, your final offer letter will be released.
在HashedIn软件工程师面试的每一轮中,面试通常持续1-1.5小时。HashedIn的Fitment/HR轮通常持续0.5小时。每轮之后,你会知道是否被选中进入下一轮。HashedIn HR回应的时间大多在24-72小时之间。最终结果出来后,你需要等待至少24小时,直到收到确认入职的意向书。然后一周内,你的最终录用通知书会发布。
356. What is the Eligibility Criteria at Hashedin by Deloitte?
Deloitte旗下HashedIn的资格标准是什么?
- 知识点: 其他/未分类 (标签: interviewbit, hashedin, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HashedIn
- id: 69b37b3058d557c902badc0a | 官方: 否 | 付费: 否
答案:
The basic eligibility criteria for Software Engineers in HashedIn by Deloitte are - - Qualification - B.E/B.Tech/M.E/M.Tech/MCA/M.Sc
Deloitte旗下HashedIn软件工程师的基本资格标准是:- 学历 - B.E/B.Tech/M.E/M.Tech/MCA/M.Sc
- Percentage - 60% or 6.0 GPA above
- Backlog - No active backlogs
357. What is the difference between compiler, interpreter, and assembler?
编译器、解释器和汇编器之间有什么区别?
- 知识点: 其他/未分类 (标签: interviewbit, hcl, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HCL Technologies
- id: 69b37b3658d557c902badf5f | 官方: 否 | 付费: 否
答案:
One of the key differences between a compiler, an interpreter, and an assembler is this - The compiler converts the whole high-level language program to machine language at a time. On the other hand, an interpreter converts high-level language programs to machine language line by line. An assembler converts assembly language programs to machine language.
编译器、解释器和汇编器之间的一个关键区别是:编译器一次性将整个高级语言程序转换为机器语言;而解释器逐行将高级语言程序转换为机器语言;汇编器将汇编语言程序转换为机器语言。
Useful Preparation Resources:
有用的备考资源:
Coding Practice
编码练习
Java Interview
Java面试
C Interview
C语言面试
.Net Interview
.Net面试
Automation Testing Interview
自动化测试面试
Networking Interview
网络面试
358. What is the use of the pointer in C?
在C语言中,指针的用途是什么?
- 知识点: 其他/未分类 (标签: interviewbit, hcl, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HCL Technologies
- id: 69b37b3658d557c902badf7a | 官方: 否 | 付费: 否
答案:
The following are some of the important uses of pointers in C: - To access array elements: Pointers are used in traversing through an array of integers and strings. The string is an array of characters that is terminated by a null character '\0'.
以下是指针在C语言中的一些重要用途:- 访问数组元素:指针用于遍历整数和字符串数组。字符串是以空字符'\0'结尾的字符数组。
- For dynamic memory allocation: Pointers are used in the allocation and deallocation of memory while the program is being executed.
- Call by Reference: The pointers are used to pass the reference of a variable to another function.
- Data Structures like a graph, tree, linked list, etc.: The pointers are used to construct a number of data structures like graph, tree, linked list, and so on.
359. What is the major difference between structured English and Pseudo Code?
结构化英语和伪代码之间的主要区别是什么?
- 知识点: 其他/未分类 (标签: interviewbit, hcl, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HCL Technologies
- id: 69b37b3658d557c902badf7d | 官方: 否 | 付费: 否
答案:
Structured English is used to write the structure of a program module. It is a native English language. It uses the keywords of programming language. On the other hand, Pseudo Code is more like a programming language without the syntax of any specific language.
结构化英语用于编写程序模块的结构。它是一种自然英语。它使用编程语言的关键字。另一方面,伪代码更像是没有特定语言语法的一种编程语言。
360. Name some software analysis & design tools?
列举一些软件分析和设计工具?
- 知识点: 其他/未分类 (标签: interviewbit, hcl, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HCL Technologies
- id: 69b37b3658d557c902badf80 | 官方: 否 | 付费: 否
答案:
Some of the most important software analysis and designing tools are: - Data Flow Diagrams
一些最重要的软件分析和设计工具是:- 数据流图
- Structured Charts
- Structured English
- Data Dictionary
- Hierarchical Input Process Output diagrams
- Entity Relationship Diagrams and Decision tables
361. What do you mean by nested classes?
嵌套类是什么意思?
- 知识点: 其他/未分类 (标签: interviewbit, hcl, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HCL Technologies
- id: 69b37b3658d557c902badf8a | 官方: 否 | 付费: 否
答案:
Nested classes mean that we can define a class inside another class in an Object-oriented programming language (OOP). The enclosed class is called a nested class. A nested class has the same access rights as other members of the class and is like another member of the outer class.
嵌套类意味着在面向对象编程语言(OOP)中,我们可以在一个类内部定义另一个类。被包围的类称为嵌套类。嵌套类具有与其他类成员相同的访问权限,并且类似于外部类的另一个成员。
For example:
例如:
class Outer_class{
class Outer_class{
//code
//代码
class Inner_class{
class Inner_class{
//code
//代码
}
}
In the above example, the Inner class is nested within the Outer class. The inner class will have the same access rights as the outer class. Nested classes help to group classes in one group.
在上述示例中,内部类嵌套在外部类中。内部类将具有与外部类相同的访问权限。嵌套类有助于将类分组到一个组中。
362. What is the difference between a constant variable and a global variable?
常量变量和全局变量之间的区别是什么?
- 知识点: 其他/未分类 (标签: interviewbit, hcl, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HCL Technologies
- id: 69b37b3658d557c902badf8d | 官方: 否 | 付费: 否
答案:
Constant variables have a fixed value that cannot be modified throughout the program. Global variables can be changed and are accessible by all the functions in a program.
常量变量具有固定的值,在整个程序中不能被修改。全局变量可以被更改,并且可由程序中的所有函数访问。
For example:
例如:
include<stdio.h>
int m = 20, n = 40; //global variable
int m = 20, n = 40; //全局变量
int a = 50, b = 80;//global variable
int a = 50, b = 80;//全局变量
int main()
int main()
{
printf("These are variables are accessed from main function");
printf("这些变量是从主函数中访问的");
a=24;
a=24;
void sample()
void sample()
{
int t=20; // Local variable
int t=20; // 局部变量
}
}
363. How to Prepare for HCL Interview?
如何准备HCL面试?
- 知识点: 其他/未分类 (标签: interviewbit, hcl, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HCL Technologies
- id: 69b37b3658d557c902badf99 | 官方: 否 | 付费: 否
答案:
While applying for any job and preparing for an interview, you should keep these things in mind to make it easier for you to crack the interview: - Thoroughly go through the Job Description in order to understand the requirements of the company better. Optimize your Resume accordingly, covering all points that you have accomplished and learned.
在申请任何工作并准备面试时,你应该牢记以下几点,以便更容易通过面试:- 仔细阅读职位描述,以更好地了解公司需求。相应地优化你的简历,涵盖你已完成和学到的所有要点。
- Practice for the Aptitude test beforehand. Take a few tests online to get used to the types of questions expected from you.
- For the Group Discussion round, be confident while it's your turn to speak. Have proper knowledge on the latest happening and in the tech space, as some topics of discussion are around these.
- It’s good to practice communication skills before the interview.
- For the technical round, go through the topics that are commonly asked and prepare your answers.
- Try different problem-solving methods to improve your skills.
- Prepare from your previous interview experiences.
364. What is the salary for freshers in HCL?
HCL中应届生的薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, hcl, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HCL Technologies
- id: 69b37b3658d557c902badf9c | 官方: 否 | 付费: 否
答案:
The average salary of freshers at HCL Technologies ranges between ₹ 1.6 Lakhs to ₹ 4 Lakhs PA in India.
HCL Technologies中应届生的平均薪资在印度为每年16万卢比到40万卢比之间。
365. How do you get placed in HCL?
你如何进入HCL工作?
- 知识点: 其他/未分类 (标签: interviewbit, hcl, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HCL Technologies
- id: 69b37b3658d557c902badf9f | 官方: 否 | 付费: 否
答案:
HCL Technologies conducts campus recruitment drives to recruit fresh graduates from colleges across India for various job roles in their company. There are also off-campus drives. They typically have 4 rounds to get selected - Aptitude, GD, Technical and HR. With proper preparation in these rounds , you can get placed in HCL.
HCL Technologies会举办校园招聘活动,从印度各地的大学招募应届毕业生担任公司内各种职位。此外还有校外招聘活动。他们通常有4轮选拔:能力测试、小组讨论、技术面试和人力资源面试。只要在这些环节做好充分准备,你就能成功进入HCL。
366. Why do you want to join HCL?
你为什么想加入HCL?
- 知识点: 其他/未分类 (标签: interviewbit, hcl, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HCL Technologies
- id: 69b37b3658d557c902badfa2 | 官方: 否 | 付费: 否
答案:
HCL is a company where innovation and culture are at the core. As an individual, I would like to expand my horizons along with contribute to the growth of the company. Moreover, the concept of ‘Ideapreneurship’ that the company believes in, truly inspires me. Having an opportunity to present ideas to achieve the company goals interests me.
HCL是一家以创新和文化为核心的公司。作为个人,我希望拓展自己的视野,同时为公司的成长做出贡献。此外,公司信奉的“创客精神”理念真正激励了我。有机会提出想法来实现公司目标让我很感兴趣。
367. Is HCL interview easy?
HCL面试容易吗?
- 知识点: 其他/未分类 (标签: interviewbit, hcl, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: HCL Technologies
- id: 69b37b3658d557c902badfa5 | 官方: 否 | 付费: 否
答案:
The HCL Interview process is easy if you’re well prepared. The whole process for hiring in HCL takes about a week generally; however, sometimes the process may go on for longer. The first round is an aptitude test which is easy. The shortlisted candidates are then selected for a group discussion round. If you have proper knowledge about general happenings and are confident, then this part of the interview is easy too. For the interview and technical questions round, be well prepared as it is slightly different from other companies.
HCL的面试流程如果你准备充分的话是容易的。HCL的整个招聘流程通常大约需要一周时间;然而,有时流程可能会更长。第一轮是能力倾向测试,这比较容易。入围的候选人接下来会被选中参加小组讨论环节。如果你对时事有适当了解并且自信,那么面试的这一部分也容易。对于面试和技术问题环节,要好好准备,因为它与其他公司略有不同。
Coding Problems
0/4
Easy Problems
简单问题
Linked Lists
链表
Math
数学
Bit Manipulation
位操作
Remove Nth Node from List End
从列表末尾移除第N个节点
Easy
简单
27.38 Mins
27.38分钟
Solve
解答
Palindrome Integer
回文整数
Easy
简单
17.28 Mins
17.28分钟
Solve
解答
Reverse integer
反转整数
Easy
简单
28.36 Mins
28.36分钟
Solve
解答
Swap Bits
交换位
Easy
简单
30.31 Mins
30.31分钟
Solve
解答
0/2
Intermediate Problems
中级问题
Bit Manipulation
位操作
Backtracking
回溯法
Reverse Bits
反转位
Medium
中等
23.50 Mins
23.50分钟
Solve
解答
Grid Word
网格单词
Medium
中等
42.0 Mins
42.0分钟
Solve
解答
368. Explain WYSIWYG.
解释WYSIWYG。
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3758d557c902badfef | 官方: 否 | 付费: 否
答案:
The acronym WYSIWYG stands for What You See Is What You Get. It is a software system in which content can be edited in a manner that mimics/resembles the appearance of a final product, such as a web page, a printed document, or a slide presentation. The software can visualize how every type of content will look without requiring any additional setup or coding on the users' part. The WYSIWYG editor allows users to focus on design instead of learning complex formatting codes.
缩写WYSIWYG代表“所见即所得”。它是一种软件系统,在这种系统中,内容可以以模仿或类似于最终产品外观的方式进行编辑,例如网页、打印文档或幻灯片演示。该软件可以可视化每种类型内容的外观,而无需用户进行任何额外设置或编码。WYSIWYG编辑器允许用户专注于设计,而不是学习复杂的格式代码。
369. Write a function to print the Fibonacci series.
编写一个函数来打印斐波那契数列。
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3758d557c902badff2 | 官方: 否 | 付费: 否
答案:
Fibonacci series: It is essentially a series of numbers, each of which is the sum of its two previous or preceding numbers. Fibonacci's series begins with the numbers 0 and 1.
斐波那契数列:它本质上是一个数字序列,其中每个数字都是其前两个或之前两个数字之和。斐波那契数列以数字0和1开始。
Example: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, etc.
示例:0、1、1、2、3、5、8、13、21、34等。
Code:
代码:
//Java program to print Fibonacci Series using recursion.
//使用递归打印斐波那契数列的Java程序。
public class Main
public class Main
{
static int n1=0,n2=1,n3=0;
static int n1=0,n2=1,n3=0;
static void printFibonacci(int count)
static void printFibonacci(int count)
{
if(count>0)
if(count>0)
{
n3 = n1 + n2;
n3 = n1 + n2;
n1 = n2;
n1 = n2;
n2 = n3;
n2 = n3;
System.out.print(" "+n3);
System.out.print(" "+n3);
printFibonacci(count-1);
printFibonacci(count-1);
}
}
public static void main(String args[])
public static void main(String args[])
{
int count=15;
int count=15;
//printing 0 and 1
//打印 0 和 1
System.out.print("Fibonacci Series: " + n1+" "+n2);
System.out.print("斐波那契数列: " + n1+" "+n2);
//n-2 because 0 and 1 number are already printed
//n-2 因为 0 和 1 已经打印过了
printFibonacci(count-2);
printFibonacci(count-2);
}
}
Output:
输出:
Fibonacci Series: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377
斐波那契数列:0 1 1 2 3 5 8 13 21 34 55 89 144 233 377
Useful Interview Preparation Resources
有用的面试准备资源
- Java Interview Questions
- Technical Interview Questions
- Coding Interview Questions
- Free Mock Interview
- Interview Guide
370. Write a program to reverse a number and reverse a string.
编写程序来反转一个数字和反转一个字符串。
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3758d557c902badff5 | 官方: 否 | 付费: 否
答案:
Program to Reverse a String:
反转字符串的程序:
Let's consider a string "InterviewBit, so after reversing the string, we'll get “tiBweivretnI”.
我们考虑一个字符串“InterviewBit”,所以反转该字符串后,我们将得到“tiBweivretnI”。
Example:
示例:
//Java program to reverse a string
//反转字符串的Java程序
public class Main
public class Main
{
public static void main(String[] args) {
public static void main(String[] args) {
String stringExample = "InterviewBit";
String stringExample = "InterviewBit";
System.out.println("Original string: "+stringExample);
System.out.println("原始字符串: "+stringExample);
//Declaring a StringBuilder
//声明一个StringBuilder
//and converting string to StringBuilder
//并将字符串转换为StringBuilder
StringBuilder reverseString = new StringBuilder(stringExample);
StringBuilder reverseString = new StringBuilder(stringExample);
//Reversing the StringBuilder
//反转StringBuilder
reverseString.reverse();
reverseString.reverse();
//Converting StringBuilder to String
//将StringBuilder转换为String
String result = reverseString.toString();
String result = reverseString.toString();
// Printing the reversed String
//打印反转后的String
System.out.println("Reversed string: "+result);
System.out.println("Reversed string: "+result);
}
}
Output:
输出:
Original string: InterviewBit
原始字符串:InterviewBit
Reversed string: tiBweivretnI
反转后的字符串:tiBweivretnI
Program to Reverse a Number:
反转数字的程序:
Let's consider the number "45695832, so after reversing the number, we'll get “23859654”.
让我们考虑数字“45695832”,在反转数字后,我们将得到“23859654”。
Example:
示例:
//Java program to Reverse a number
//用于反转数字的Java程序
public class Main
public class Main
{
public static void main(String[] args)
public static void main(String[] args)
{
int n= 45695832, reversed = 0;
int n= 45695832, reversed = 0;
System.out.println("Original Number: " + n);
System.out.println("原始数字:" + n);
//Run the loop until n is equal to 0
//运行循环直到n等于0
while(n != 0)
当(n != 0)时
{
//get last digit from n
//从n中获取最后一位数字
int digit = n % 10;
int digit = n % 10;
reversed = reversed * 10 + digit;
reversed = reversed * 10 + digit;
//remove the last digit from num
//从num中移除最后一位数字
n /= 10;
n /= 10;
}
System.out.println("Reversed Number: " + reversed);
System.out.println("反转后的数字: " + reversed);
}
}
Output:
输出:
Original Number: 45695832
原始数字:45695832
Reversed Number: 23859654
反转后的数字:23859654
371. When would you use the char type versus the varchar type?
您何时会使用char类型而非varchar类型?
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3758d557c902badffb | 官方: 否 | 付费: 否
答案:
Variable-length fields are represented by VARCHAR, while fixed-length fields are represented by CHAR. - Varchar: Use varchar when storing strings that are variable in length, like names, and addresses. The programmers use them when the data length varies and they need more than one data type.
变长字段由VARCHAR表示,而定长字段由CHAR表示。- Varchar:在存储长度可变的字符串时使用varchar,如姓名和地址。当数据长度变化且需要多种数据类型时,程序员会使用它们。
- Char: Use char when the length is always the same since it is more space-efficient, as well as slightly faster. Programmers use them only when they know the length of the data storage.
372. How are this() and super() methods used with a constructor?
this() 和 super() 方法如何与构造函数一起使用?
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3758d557c902bae004 | 官方: 否 | 付费: 否
答案:
Both this() and super() are used to call constructors.
this() 和 super() 都用于调用构造函数。
this(): It calls the constructor of the current class. The this() must be used only inside the constructor, not even in a static context or inside methods, and it should be the first statement in the constructor.
this():它调用当前类的构造函数。this() 只能用在构造函数内部,甚至不能在静态上下文或方法内部使用,并且它必须是构造函数中的第一条语句。
Example:
示例:
class Scaler()
class Scaler()
{
Scaler()
Scaler()
{
this();
this();
...
}
public static void main(String[] args)
public static void main(String[] args)
{
....
}
}
super(): It calls the constructor of the base class (i.e., the Parent's class). Specifically, the super() is used as the very first statement within the constructor of a subclass.
super():它调用基类(即父类)的构造函数。具体来说,super() 用作子类构造函数中的第一条语句。
Example:
示例:
class Parent
class Parent
{
Parent()
Parent()
{
....
}
}
class SubClass extends Parent
class SubClass extends Parent
{
SubClass()
SubClass()
{
super();
super();
.....
}
public static void main(String[] args)
public static void main(String[] args)
{
....
}
}
373. Is it possible to make a constructor private?
是否可以将构造函数设为私有的?
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3758d557c902bae007 | 官方: 否 | 付费: 否
答案:
Yes, it is possible to declare constructors as private in Java. A constructor can be declared private using the private access specifier. We are unable to create an object outside the class if the constructor is declared private. However, we can use this private constructor within a Singleton Design Pattern instead. To prevent objects from being created outside the scope of a class, a private constructor is used. We can instead create multiple objects in the Singleton class.
是的,在Java中可以将构造函数声明为私有的。使用私有访问修饰符可以声明私有构造函数。如果构造函数被声明为私有的,我们就无法在类外部创建对象。然而,我们可以在单例设计模式中使用这个私有构造函数。为了防止在类作用域之外创建对象,可以使用私有构造函数。我们反而可以在单例类中创建多个对象。
374. State difference between union and anonymous union.
说明联合体和匿名联合体之间的区别。
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3758d557c902bae00a | 官方: 否 | 付费: 否
答案:
Union: In computing, a union is a type that is user-defined and consists of all members sharing the same memory address/location. Additionally, it means that no matter how many members a union has, its memory is limited to storing only the largest member.
联合体:在计算中,联合体是一种用户定义的类型,其所有成员共享相同的内存地址/位置。此外,这意味着无论联合体有多少成员,其内存仅限于存储最大的成员。
Example:
示例:
//Union Example
//联合体示例
union Scaler
union Scaler
{
char ch;
char ch;
int i;
int i;
};
Anonymous Union: Unions without names are known as anonymous unions or unnamed unions. Because they do not have names, direct objects (or variables) of them are not created, but they are used in nested unions. Member names of an anonymous union must differ from those of other members within the scope of the union. In addition, the anonymous union is unable to have protected or private members, or any member functions.
匿名联合体:没有名称的联合体被称为匿名联合体或未命名联合体。由于它们没有名称,不会为它们创建直接对象(或变量),但它们用于嵌套联合体中。匿名联合体的成员名称必须与联合体作用域内其他成员的名称不同。此外,匿名联合体不能有受保护的或私有的成员,也不能有任何成员函数。
Example:
示例:
// Anonymous union example
// 匿名联合体示例
union
union
{
char ch;
char ch;
int i;
int i;
};
375. What do you mean by Trigger? And can we invoke them on-demand?
触发器是什么意思?我们可以按需调用它们吗?
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3758d557c902bae00d | 官方: 否 | 付费: 否
答案:
Triggers are special types of stored procedures (SQL Statements) that are automatically executed when operations are performed on a table within the database. It is not possible to invoke triggers on-demand. The triggers are more like event handlers since they are executed on a specific occasion. A trigger is triggered only whenever an action (INSERT, UPDATE, or DELETE) is performed on the table on which it is defined. - Triggers help to maintain the integrity of data by updating a database in a systematic manner.
触发器是特殊的存储过程(SQL语句)类型,当对数据库中的表执行操作时会自动执行。无法按需调用触发器。触发器更像是事件处理器,因为它们在特定场合被执行。只有当对其定义所在的表执行操作(INSERT、UPDATE或DELETE)时,触发器才会被触发。- 触发器通过以系统化的方式更新数据库,有助于维护数据的完整性。
- A trigger can adjust the entire database when there is a change in the table. For instance, when a new entry (representing a new employee) is added to the employee's table, a new record should also be created in the vacation, tax, and salary tables.
- Additionally, triggers can be used to track historical data, such as employee salaries.
376. Can you explain Abstract class?
你能解释一下抽象类吗?
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3758d557c902bae010 | 官方: 否 | 付费: 否
答案:
Abstract classes are restricted classes that cannot be used as a basis for creating objects, i.e. cannot be instantiated. The abstract keyword is used to declare an abstract class. The concept of abstract classes can be found in all object-oriented programming (OOP) languages, including Java, C#, C++, and VB.NET.
抽象类是受限类,不能用作创建对象的基础,即不能被实例化。抽象关键字用于声明抽象类。抽象类的概念可以在所有面向对象编程(OOP)语言中找到,包括Java、C#、C++和VB.NET。
// Create a class abstract
// 创建一个类的抽象
abstract class InterviewBit
abstract class InterviewBit
{
// fields and methods
// 字段和方法
}
...
//try creating an object
//尝试创建一个对象
//an error is thrown
//抛出错误
InterviewBit scaler = new InterviewBit();
InterviewBit scaler = new InterviewBit();
Abstract classes can have both abstract methods and regular methods (which are not abstract). For example:
抽象类可以有抽象方法和常规方法(即非抽象方法)。例如:
abstract class InterviewBit
abstract class InterviewBit
{
// abstract method
// 抽象方法
abstract void method1();
abstract void method1();
// regular method (non-abstract)
// 常规方法(非抽象)
void method2()
void method2()
{
System.out.println("This is a non-abstract method");
System.out.println("This is a non-abstract method");
}
}
377. State difference between Package and Interface.
解释包和接口之间的区别。
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3758d557c902bae013 | 官方: 否 | 付费: 否
答案:
In Object-Oriented Programming-based languages like Java, packages and interfaces are the main concepts.
在基于面向对象编程的语言(如 Java)中,包和接口是主要概念。
| Package 包 | Interface 接口 |
|---|---|
| A package consists of classes and interfaces. 包由类和接口组成。 | An interface consists of fields and abstract methods. 接口由字段和抽象方法组成。 |
| You can use an import statement to access a package. 你可以使用 import 语句来访问包。 | In order to extend an interface, you can use another interface or implement it with a class. 为了扩展接口,你可以使用另一个接口或用类实现它。 |
| Packages improve maintainability by organizing classes and interfaces. 包通过组织类和接口来提高可维护性。 | Interfaces allow for abstraction and multiple inheritances. 接口允许抽象和多继承。 |
| Syntax: package package_name; public class class_name{ . (body of class) . } 语法:package package_name; public class class_name{ . (类的主体) . } | Syntax: interface interface_name{ variable declaration; method declaration; } 语法:interface interface_name{ 变量声明;方法声明;} |
378. Explain Inheritance.
解释继承。
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3758d557c902bae01a | 官方: 否 | 付费: 否
答案:
Inheritance refers to the process by which a class obtains properties from another class. This is an essential part of OOPs (Object Oriented Programming). Generally, a class inheriting properties from another class is considered a subclass (child or derived class), and the class from which the properties are inherited is considered the superclass (parent class or base class). In Java, inheritance is accomplished using the extends keyword.
继承是指一个类从另一个类获取属性的过程。这是面向对象编程(OOPs)的重要组成部分。通常,继承另一个类属性的类被视为子类(或派生类、子类型),而提供属性的类被视为超类(父类或基类)。在 Java 中,继承通过 extends 关键字实现。
Example:
示例:
class InterviewBit {
class InterviewBit {
// methods and attributes of InterviewBit
// InterviewBit 的方法和属性
}
// Inheritance with the extends keyword
// 使用 extends 关键字进行继承
class Scaler extends InterviewBit {
class Scaler extends InterviewBit {
// methods and attributes of InterviewBit
// InterviewBit 的方法和属性
// methods and attributes of Scaler
// Scaler 的方法和属性
}
In this case, InterviewBit is the Parent class, while Scaler is the Child class. As shown above, the Scaler class is created by inheriting methods and attributes from the InterviewBit class.
在这种情况下,InterviewBit 是父类,而 Scaler 是子类。如上所示,Scaler 类是通过继承 InterviewBit 类的方法和属性创建的。
379. What types of instance variables are there?
实例变量有哪些类型?
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3758d557c902bae01d | 官方: 否 | 付费: 否
答案:
Variables in Java can be categorized into three types: Java local variables, Java instance variables, and Java static variables. As the name implies, a Java instance variable is a variable declared within a class but outside the scope of any method. Instance variables are initialized either when a class is loaded or whenever an object of that class is created. There are several access modifiers available in Java that can be used to declare instance variables, including default, public, private, and protected. Instance variables can be of different data types such as Boolean, byte, short, int, double, float, char, object, long, etc.
Java 中的变量可以分为三种类型:Java 局部变量、Java 实例变量和 Java 静态变量。顾名思义,Java 实例变量是在类内部但在任何方法作用域之外声明的变量。实例变量在类加载时或每当创建该类的对象时初始化。Java 中有多个访问修饰符可用于声明实例变量,包括默认、public、private 和 protected。实例变量可以是不同的数据类型,如 Boolean、byte、short、int、double、float、char、object、long 等。
380. What do near, far, and huge pointers mean?
near、far 和 huge 指针是什么意思?
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3758d557c902bae020 | 官方: 否 | 付费: 否
答案:
- Near Pointer: Using a near pointer, you can store up to 16 bits of the address. This point is generally used to store the address, which has a maximum size of 16 bits (we can only access 64 kb at a time). We can, however, store any smaller addresses that remain within 16 bits.Syntax:
near
<数据类型> 近 <指针定义>
- Far Pointer: A Far pointer is typically considered to be a pointer with a 32-bit size. The compiler allocates two segment registers in this case. One register to store the segment address and the other to store the offset within the current segment.Syntax:
far
<数据类型> 远 <指针定义>
- Huge Pointer: Huge pointers also have the same size as 32 bits, but they can also access bits stored outside a segment. Unlike far pointers, where segments are fixed and cannot be changed, Huge segments can be modified because they have the elasticity to allow it.
381. Explain Pointers?
解释指针?
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3758d557c902bae023 | 官方: 否 | 付费: 否
答案:
Pointers are objects/variables in many programming languages that store memory addresses. Pointers point to locations in memory, and getting the value stored at those locations is called dereferencing the pointer. When traversing iterable data structures (such as lookup tables, control tables, strings, and tree structures), using pointers significantly improves performance.
指针是许多编程语言中的对象/变量,用于存储内存地址。指针指向内存中的位置,获取这些位置存储的值称为解引用指针。在遍历可迭代数据结构(如查找表、控制表、字符串和树结构)时,使用指针能显著提升性能。
Syntax:
语法:
datatype *var_name;
数据类型 *变量名;
int *ptr;
int *ptr;
//variable ptr points to an address that contains int data
//变量 ptr 指向包含 int 数据的地址
Example:
示例:
include <stdio.h>
int main()
int main()
{
int a = 10;
int a = 10;
int p; // declare pointer variable p
int p; // 声明指针变量 p
//data type of p and a must be same
// p 和 a 的数据类型必须相同
p= &a; // assign the address of variable 'a' to pointer 'p'.
p= &a; // 将变量 'a' 的地址赋给指针 'p'。
printf("Value at p = %p \n",p);
printf("p 处的值 = %p \n",p);
printf("Value at a = %d \n",a);
printf("a 处的值 = %d \n",a);
//getting the value of variable 'a' pointed by pointer p
// 获取指针 p 所指向的变量 'a' 的值
printf("Value at p = %d \n", p);
printf("Value at p = %d \n", p);
}
Output:
输出:
Value at p = 0x7ffda8d3102c
位于 p 的值 = 0x7ffda8d3102c
Value at a = 10
位于 a 的值 = 10
Value at *p = 10
位于 *p 的值 = 10
382. State difference between C and C++.
说明 C 和 C++ 之间的区别。
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3758d557c902bae02a | 官方: 否 | 付费: 否
答案:
C and C++ are two programming languages commonly used in application development. Among C and C++, the major differences center around the fact that C is a procedural programming language and also doesn't support classes and objects, whereas C++ is an extension of C which also supports object-oriented programming (OOP) along with procedural programming language. The following list highlights some of the differences between C and C++ .
C 和 C++ 是两种常用于应用程序开发的编程语言。在 C 和 C++ 之间,主要区别集中在 C 是一种过程式编程语言,且不支持类和对象,而 C++ 是 C 的扩展,除了过程式编程语言外,还支持面向对象编程(OOP)。以下列表突出显示了 C 和 C++ 之间的一些差异。
| C | C++ |
|---|---|
| C is a procedural/structural programming language. It doesn't support classes and objects. C 是一种过程式/结构化编程语言。它不支持类和对象。 | C++ supports both OOP and procedural programming languages. It does support classes and objects. C++ 同时支持 OOP 和过程式编程语言。它确实支持类和对象。 |
| C does not support OOPs, therefore polymorphism, encapsulation, and inheritance are not available. C 不支持面向对象编程(OOPs),因此多态性、封装和继承不可用。 | As an object-oriented programming language, C++ supports polymorphism, inheritance, and encapsulation. 作为一种面向对象的编程语言,C++ 支持多态性、继承和封装。 |
| Neither namespaces nor reference variables are supported; neither are function and operator overloading. 既不支持命名空间,也不支持引用变量;函数和运算符重载也不受支持。 | As for C++, it supports both function and operator overloading, as well as namespaces and reference variables. 至于 C++,它同时支持函数和运算符重载,以及命名空间和引用变量。 |
| Basically, it's a subset of C++ and cannot execute C++ code. 基本上,它是 C++ 的子集,无法执行 C++ 代码。 | C++ is a superset of C and can execute 99% of C code. C++ 是 C 的超集,可以执行 C 代码的 99%。 |
| The scanf() and printf() functions are used primarily for input/output operations in C. 在 C 中,scanf() 和 printf() 函数主要用于输入输出操作。 | The input and output operations in C++ are performed primarily through stream cin and cout. 在 C++ 中,输入输出操作主要通过流 cin 和 cout 执行。 |
Hexaware Interview Preparation
383. What is the Eligibility Criteria at Hexaware?
Hexaware 的资格标准是什么?
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3858d557c902bae048 | 官方: 否 | 付费: 否
答案:
Eligibility criteria for all programs in the Hexaware Recruitment Process are as follows:
Hexaware 招聘流程中所有项目的资格标准如下:
| Eligibility Criteria 资格标准 | Details 详情 |
|---|---|
| Graduation 毕业 | Eligible: BE/B.Tech/MCA. Not Eligible: ME/MTech. 符合条件:BE/B.Tech/MCA。不符合条件:ME/MTech。 |
| Streams 专业 | Eligible: CSE/IT/ECE/EEE/ETC/EIE/ICE. Not Eligible: Mechanical/ Civil allied branches. 符合条件:CSE/IT/ECE/EEE/ETC/EIE/ICE。不符合条件:机械/土木相关分支。 |
| Academic and Graduation Criteria 学术和毕业标准 | 60% or 6.0 CGPA throughout 10th, 12th, and UG/PG. 10 年级、12 年级和本科/研究生阶段均达到 60% 或 6.0 CGPA。 |
| Backlogs 未清项目 | No active Backlogs. 无活动中的未清项目。 |
| Educational Gap 教育间隔 | Education gap of 1 year is considered. 1 年的教育间隔被考虑。 |
384. How long is the Interview Process at Hexaware?
Hexaware 的面试流程需要多长时间?
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3858d557c902bae04b | 官方: 否 | 付费: 否
答案:
Hexaware usually takes between three and four weeks to complete the interview process. Hexaware, like any other MNC, can take from three to twelve weeks to provide you with an offer letter.
Hexaware 通常需要三到四周的时间来完成面试流程。与任何其他跨国公司一样,Hexaware 可能需要三到十二周的时间来向你提供录用通知书。
385. Which programming language is used in Hexaware?
Hexaware 使用哪种编程语言?
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3858d557c902bae04e | 官方: 否 | 付费: 否
答案:
In preparation for the interview, it would be beneficial if you could learn the following (or at least get familiar with some of them): - C/C++
在准备面试时,如果你能学习以下内容(或至少熟悉其中一些)将会很有帮助:- C/C++
- Object-Oriented Programming (learn Java if you can)
- Python
- HTML, CSS & JavaScript
- RDBMS & SQL
386. Is there a coding round in Hexaware?
Hexaware 有编码测试环节吗?
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3858d557c902bae051 | 官方: 否 | 付费: 否
答案:
Yes, if you apply for a technical position, you will almost certainly have to go through a coding round. Coding skills are often a deciding factor in any technical interview. Solving coding challenges is the best way to sharpen your coding skills. It will help you improve your problem-solving skills, gain insight into a programming language, prepare for interviews, learn new algorithms, etc.
是的,如果你申请的是技术职位,几乎肯定需要参加编码测试。在任何技术面试中,编码能力往往是决定性因素。解决编码挑战是提升编码技能的最佳方式,这有助于提高问题解决能力、深入了解编程语言、为面试做准备、学习新算法等。
387. Is the Hexaware interview easy?
Hexaware 面试容易吗?
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3858d557c902bae054 | 官方: 否 | 付费: 否
答案:
Hexaware's interview may not seem difficult if you are well prepared. You will find every interview to be equally challenging unless you are well prepared. Preparation is paramount to a successful job interview. Preparation will make you more confident, and you will appear cool, calm, and collected to your potential employer - qualities employers always look for in the perfect candidate.
如果你准备充分,Hexaware 的面试可能看起来并不难。除非你准备充分,否则你会发现每次面试都同样具有挑战性。准备充分是成功求职面试的关键。准备能让你更加自信,你会在潜在雇主面前显得从容冷静、沉着稳重——这是雇主一直在完美候选人身上寻找的品质。
388. What is the salary for freshers in Hexaware?
Hexaware 新员工的薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3858d557c902bae057 | 官方: 否 | 付费: 否
答案:
Graduate Engineer Trainee salaries at Hexaware Technologies in India range from ₹ 3.5 Lakhs to ₹ 5 Lakhs, with an average of ₹ 3.8 Lakhs for less than one year of experience.
印度 Hexaware Technologies 的 Graduate Engineer Trainee 薪资范围在 35 万卢比到 50 万卢比之间,平均为 38 万卢比(对于工作经验少于一年的人员)。
389. Why Hexaware?
为什么选择 Hexaware?
- 知识点: 其他/未分类 (标签: interviewbit, hexaware, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Hexaware Technologies
- id: 69b37b3858d557c902bae05a | 官方: 否 | 付费: 否
答案:
Hexaware, one of the most rapidly growing organizations today, offers outstanding career opportunities, excellent growth potential, the opportunity to work with skilled people, a diverse client base, and a favorable work-life balance. Hexaware fosters an environment of respect and care that nurtures a Happy Culture. Their flexible working hours, optional holidays, and employee assistance programs enable a diverse, global workforce to lead a fulfilling and dynamic life.
Hexaware 是当今增长最快的组织之一,提供出色的职业机会、优异的成长潜力、与技能娴熟同事合作的机会、多元化的客户群以及良好的工作与生活平衡。Hexaware 营造尊重和关怀的环境,培育快乐文化。其灵活的工作时间、可选假期和员工援助计划,使多元化的全球员工能够过上充实而充满活力的生活。
390. If you were reviewing a piece of code, what key things would you look for?
如果你在审查一段代码,你会寻找哪些关键要点?
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb02a6 | 官方: 否 | 付费: 否
答案:
In order to make sure that you're building robust, maintainable tools, code reviews are integral to the development process. Code reviews enhance the visibility of a project, facilitate knowledge sharing among team members, improve maintainability, as well as help detect bugs. Whenever a developer submits their code for review, they hope for constructive feedback. The emphasis of a code review should not be on style, line spacing, or naming, but rather on giving constructive suggestions that will improve readability, maintainability, and bug-free code. Here are some of the points to keep an eye out for during every code review. - Check if the code is working as intended by the developer.
为了确保构建出健壮、可维护的工具,代码审查是开发过程中不可或缺的一环。代码审查能提升项目的可见性,促进团队成员间的知识共享,改善可维护性,并有助于发现缺陷。每当开发者提交代码以供审查时,他们期望获得建设性的反馈。代码审查的重点不应放在风格、行距或命名上,而应放在能提高可读性、可维护性和无缺陷代码的建设性建议上。以下是在每次代码审查中应留意的一些要点。- 检查代码是否按开发者的意图正常工作。
- Look for repeated codes, if any.
- Does the code have an error handling method?
Consider the run-time of algorithms
Is there any operation that is unnecessary? Remove unnecessary operations. Is the algorithm performing repeated work? To prevent running the same computation more than once, can we use memoization to cache the data? Look for nested loops. Can the operation be simplified without using them? How much does it cost to access data? Does there exist a data structure that can reduce it? - Which design patterns are employed in the new code?是否存在任何不必要的操作?删除不必要的操作。算法是否在执行重复工作?为防止同一计算执行多次,能否使用记忆化来缓存数据?查找嵌套循环。操作能否在不使用嵌套循环的情况下简化?数据访问的成本是多少?是否存在能降低该成本的数据结构?- 新代码中采用了哪些设计模式?
Is the new code compatible with the overall architecture? Is the code compliant with SOLID principles, Domain-Driven Design, and/or any other design paradigms being used by the team? - Does this code conform to regulatory requirements?
新代码是否与整体架构兼容?代码是否符合SOLID原则、领域驱动设计以及/或团队正在使用的其他设计范式?- 此代码是否符合监管要求?
391. Write a program to find the GCD for two numbers.
编写一个程序来求两个数的最大公约数(GCD)。
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb02b0 | 官方: 否 | 付费: 否
答案:
Suppose we are given two integers n1 and n2. Specifically, we will calculate the GCD of two numbers (whether they are positive or negative). The GCD of two integers is the greatest integer that divides both numbers exactly without a remainder.
假设我们给定两个整数n1和n2。具体来说,我们将计算两个数字(无论它们是正数还是负数)的最大公约数。两个整数的最大公约数是能同时整除这两个数且无余数的最大整数。
Example: Here is a program that uses a while loop and an if-else statement to calculate GCD. This is a better approach. This approach involves subtracting the smaller integer from the larger integer and storing the result in the variable containing the larger integer. This is performed repeatedly until n1 and n2 are equal.
示例:下面是一个使用while循环和if-else语句来计算GCD的程序。这是一种更好的方法。此方法涉及从较大的整数中减去较小的整数,并将结果存储到包含较大整数的变量中,重复执行此操作直到n1和n2相等。
Code:
代码:
include <stdio.h>
int main()
int main()
{
int num1, num2;
int num1, num2;
printf("Enter two integers: ");
printf("输入两个整数: ");
scanf("%d %d",&num1,&num2);
scanf("%d %d",&num1,&num2);
// When a negative number is entered, its sign is turned into a positive
// 当输入负数时,其符号转为正号
num1 = ( num1 > 0) ? num1 : -num1;
num1 = ( num1 > 0) ? num1 : -num1;
num2 = ( num2 > 0) ? num2 : -num2;
num2 = ( num2 > 0) ? num2 : -num2;
while(num1!=num2)
while(num1!=num2)
{
if(num1 > num2)
如果(num1 > num2)
num1 -= num2;
num1 -= num2;
else
else
num2 -= num1;
num2 -= num1;
}
printf("GCD = %d", num1);
打印("GCD = %d", num1);
return 0;
return 0;
}
Output:
输出:
Enter two integers: 27
输入两个整数:27
-34
GCD = 1
GCD = 1
392. What makes a char array preferable to a string for storing passwords?
为什么用字符数组存储密码比用字符串更可取?
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb02b3 | 官方: 否 | 付费: 否
答案:
As Strings are immutable, it is not possible to change their elements/contents since any change would create a new String. On the other hand, if you use a char[, you still have the option of setting all elements to zero/blank. Thus, storing passwords in a character array clearly reduces the possibility of passwords being stolen or hacked.
由于字符串是不可变的,无法更改其元素/内容,因为任何更改都会创建新的字符串。另一方面,如果使用字符数组,你仍然可以选择将所有元素设置为零/空白。因此,将密码存储在字符数组中明显降低了密码被盗或被黑客攻击的可能性。
393. Explain what "Scope" means in JavaScript.
解释一下JavaScript中“作用域”是什么意思。
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb02b6 | 官方: 否 | 付费: 否
答案:
A scope is a JavaScript concept used to manage access to functions, objects, and variables, from different parts of the program. In JavaScript, there are 3 types of scopes: function scope, global scope, and block scope. - Global scope: Global variables are variables declared outside of all functions and are in the global scope. These variables can be accessed anywhere in the program.
作用域是JavaScript中的一个概念,用于管理程序中不同部分对函数、对象和变量的访问。在JavaScript中,有3种类型的作用域:函数作用域、全局作用域和块作用域。- 全局作用域:全局变量是声明在所有函数之外的变量,位于全局作用域中。这些变量可以在程序中的任何位置访问。
- Function scope: Local variables are variables declared inside a function and are in the function scope. They may be accessed anywhere in the function in which they were declared.
- Block scope: Variables contained within blocks {} can't be accessed outside of those blocks. Creating an object is necessary to access the variables of that specific block.
394. Give a sorted array and a number, write a program to find the pair whose sum is close to n.
给定一个排序数组和一个数字,编写一个程序,找到其和最接近 n 的那一对数。
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb02b9 | 官方: 否 | 付费: 否
答案:
Let arr[] and n be a sorted array and a number, respectively. Now, we must determine which pair of values in the array has a sum close to n.
设 arr[] 和 n 分别是一个排序数组和一个数字。现在,我们必须确定数组中哪一对值的和最接近 n。
Code:
代码:
import java.io.*;
import java.io.*;
import java.util.*;
import java.util.*;
import java.lang.Math;
import java.lang.Math;
class Main
class Main
{
// Returns the pair with a sum close to n
// 返回和接近 n 的那一对数
static void closestSum(int arr[], int l, int n)
static void closestSum(int arr[], int l, int n)
{
//Used to store result pair indexes
// 用于存储结果对的索引
int resleft=0, resright=0;
int resleft=0, resright=0;
int leftin = 0, rightin = l-1, diff = Integer.MAX_VALUE;
int leftin = 0, rightin = l-1, diff = Integer.MAX_VALUE;
while (rightin > leftin)
while (rightin > leftin)
{
if (Math.abs(arr[leftin] + arr[rightin] - n) < diff)
if (Math.abs(arr[leftin] + arr[rightin] - n) < diff)
{
resleft = leftin;
resleft = leftin;
resright = rightin;
resright = rightin;
diff = Math.abs(arr[leftin] + arr[rightin] - n);
diff = Math.abs(arr[leftin] + arr[rightin] - n);
}
if (arr[leftin] + arr[rightin] > n)
if (arr[leftin] + arr[rightin] > n)
rightin--;
rightin--;
else
else
leftin++;
leftin++;
}
System.out.println("\nThe closest pair is "+arr[resleft]+" and "+ arr[resright] + ".");
System.out.println("\nClosest pair is "+arr[resleft]+" and "+ arr[resright] + ".");
}
// Driver Code
// 驱动代码
public static void main(String[] args)
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
Scanner sc=new Scanner(System.in);
System.out.println("Enter number of elements in the sorted array: ");
System.out.println("Enter number of elements in the sorted array: ");
int l= sc.nextInt();
int l= sc.nextInt();
System.out.println("\nEnter elements of the array: ");
System.out.println("\n输入数组的元素: ");
int[] arr = new int[5];
int[] arr = new int[5];
for (int i = 0 ; i < l; i++ )
for (int i = 0 ; i < l; i++ )
{
arr[i]= sc.nextInt();
arr[i]= sc.nextInt();
}
System.out.println("\nEnter the element for which you want to find the closest sum of pairs: ");
System.out.println("\n输入您想要查找最接近对之和的元素:");
int n = sc.nextInt();
int n = sc.nextInt();
closestSum(arr, l, n);
closestSum(arr, l, n);
}
}
Output:
输出:
Enter number of elements in the sorted array:
输入已排序数组中的元素数量:
5
Enter elements of the array:
输入数组的元素:
12
24
31
29
16
Enter the element for which you want to find the closest sum of pairs:
输入您想要查找最接近对之和的元素:
60
The closest pair is 31 and 16.
最接近的对是31和16。
395. How would you approach a challenging situation?
您会如何处理一个具有挑战性的情况?
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb02bc | 官方: 否 | 付费: 否
答案:
For assessment purposes, employers ask candidates to describe difficult situations they have handled in the past. Depending on the response a candidate provides, an employer can determine whether or not they are a good fit for the organization. Answers provide a window into a candidate's integrity, communication skills, leadership capabilities, initiative, and ability to react to unexpected situations.
为了评估目的,雇主会要求候选人描述他们过去处理过的困难情况。根据候选人提供的回答,雇主可以判断他们是否适合该组织。回答能揭示候选人的诚信、沟通技巧、领导能力、主动性和应对意外情况的能力。
Tips: - Give a brief description of the "situation" you dealt with.
提示:- 简要描述您处理过的“情况”。
- Describe your role in the situation. Tell the actions you took to overcome the challenge.
- Describe how you arrived at the choices you made, being as specific as possible.
- Explain your results. You may conclude your answer by explaining what you learned and how you intend to apply it in the future.
396. Why do browsers not support JSX?
为什么浏览器不支持JSX?
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb02bf | 官方: 否 | 付费: 否
答案:
In React, we use JSX to embed JavaScript objects within HTML elements. As JSX is embedded in HTML elements, it is not considered valid JavaScript. Because JSX combines HTML and JavaScript, it is not supported by browsers. As there is no inherent implementation for browser engines to read and understand JSX, browsers are unable to read it. However, JSX was not designed to be implemented or used by browsers; instead, it is meant to be used by Babel transpilers to convert the JSX into valid JavaScript code. Because of this, if any file contains JSX files, the Babel transpiler converts these files into JavaScript objects and becomes valid JavaScript code. This allows browsers to understand and execute the code.
在React中,我们使用JSX将JavaScript对象嵌入到HTML元素中。由于JSX嵌入在HTML元素中,它不被视为有效的JavaScript。因为JSX结合了HTML和JavaScript,所以浏览器不支持它。由于没有固有的实现让浏览器引擎读取和理解JSX,浏览器无法读取它。然而,JSX并非设计用于浏览器实现或使用;相反,它旨在由Babel编译器使用,将JSX转换为有效的JavaScript代码。因此,如果任何文件包含JSX文件,Babel编译器会将这些文件转换为JavaScript对象,并成为有效的JavaScript代码。这使浏览器能够理解和执行代码。
397. Write a program to find a number of subarrays whose sum equals the given number x.
编写一个程序,找出和等于给定数字x的子数组数量。
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb02c5 | 官方: 否 | 付费: 否
答案:
Consider an unsorted array arr[] of n integers. Our task is to find the number of subarrays whose sum is exactly the same as the given number x.
考虑一个由n个整数组成的未排序数组arr[]。我们的任务是找出和恰好等于给定数字x的子数组数量。
Code:
代码:
import java.util.*;
import java.util.*;
class Main
class Main
{
public static void main(String[] args)
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
Scanner sc=new Scanner(System.in);
System.out.println("Enter number of elements in the unsorted array: ");
System.out.println("输入未排序数组中的元素个数:");
int n= sc.nextInt();
int n= sc.nextInt();
System.out.println("\nEnter elements of the array: ");
System.out.println("\n输入数组的元素: ");
int[] arr = new int[5];
int[] arr = new int[5];
for (int i = 0 ; i < n; i++ )
for (int i = 0 ; i < n; i++ )
{
arr[i]= sc.nextInt();
arr[i]= sc.nextInt();
}
System.out.println("\nEnter value x for which you intend to find subarrays whose sum is exactly the same as x: ");
System.out.println("\n输入值x,您打算找到其和恰好等于x的子数组:");
int x = sc.nextInt();
int x = sc.nextInt();
int res = 0;
int res = 0;
// calculate all subarrays
// 计算所有子数组
for (int i = 0; i < n; i++)
for (int i = 0; i < n; i++)
{
int sum = 0;
int sum = 0;
for (int j = i; j < n; j++)
for (int j = i; j < n; j++)
{
// Calculate the required sum
// 计算所需的总和
sum += arr[j];
sum += arr[j];
// Check if sum equals required sum
// 检查总和是否等于所需的总和
if (sum == x)
if (sum == x)
res++;
res++;
}
}
System.out.println("\nTotal number of subarrays whose sum is equals to " + x + "= " + res);
System.out.println("\n总和等于 " + x + " 的子数组总数为 " + res);
}
}
Output:
输出:
Enter number of elements in the unsorted array:
输入未排序数组中的元素个数:
5
Enter elements of the array:
输入数组的元素:
8
2
9
1
3
Enter value x for which you intend to find subarrays whose sum is exactly the same as x:
输入x的值,用于查找总和恰好等于x的子数组:
10
Total number of subarrays whose sum is equals to 10= 2
总和等于10的子数组总数为 2
398. What SDLC models have you worked with before?
你之前使用过哪些SDLC模型?
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb02c8 | 官方: 否 | 付费: 否
答案:
A software engineer is well acquainted with the SDLC (Software Development Life Cycle). This question enables the interviewer to discover what models you have developed in the past. - While there is no correct or incorrect answer to this question, you should show your ability to work with different SDLC models by citing your past experiences.
软件工程师对SDLC(软件开发生命周期)非常熟悉。这个问题让面试官了解你过去开发中使用过哪些模型。- 虽然这个问题没有正确或错误的答案,但你应该通过引用过去的经验来展示你使用不同SDLC模型的能力。
- Show that you possess knowledge of various models, such as the iterative model, or waterfall model
- Also, you can use this question to find out more about Intuit by asking what SDLC model they utilize.
399. Write a program that calculates the median from a data stream.
编写一个程序,用于计算数据流中的中位数。
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb02cb | 官方: 否 | 付费: 否
答案:
Given an array a[] of integers n. Determine the median of the elements read so far.
给定一个整数数组a[]。确定到目前为止读取元素的中位数。
Code:
代码:
import java.util.*;
import java.util.*;
class Main
class Main
{
//l=low and h=high
//l=low(低)和 h=high(高)
static int binarySearch(int a[], int item, int l, int h)
静态 int binarySearch(int a[], int item, int l, int h)
{
if (l >= h)
如果 (l >= h)
{
return (item > a[l]) ? (l+ 1) : l;
返回 (item > a[l]) ? (l+ 1) : l;
}
int mid = (l + h) / 2;
int mid = (l + h) / 2;
if (item == a[mid])
如果 (item == a[mid])
return mid + 1;
返回 mid + 1;
if (item > a[mid])
如果 (item > a[mid])
return binarySearch(a, item, mid + 1, h);
返回 binarySearch(a, item, mid + 1, h);
return binarySearch(a, item, l, mid - 1);
返回 binarySearch(a, item, l, mid - 1);
}
// Print the median of an array of integers
// 打印整数数组的中位数
static void Median(int a[], int n)
静态 void Median(int a[], int n)
{
int i, j, position, num;
int i, j, position, num;
int count = 1;
int count = 1;
System.out.println("\nAs of reading element 1, the median is " + a[0]);
System.out.println("\n读取元素1时,中位数是 " + a[0]);
for (i = 1; i < n; i++)
for (i = 1; i < n; i++)
{
float median;
float median;
j = i - 1;
j = i - 1;
num = a[i];
num = a[i];
position = binarySearch(a, num, 0, j);
position = binarySearch(a, num, 0, j);
while (j >= position)
while (j >= position)
{
a[j + 1] = a[j];
a[j + 1] = a[j];
j--;
j--;
}
a[j + 1] = num;
a[j + 1] = num;
count++;
count++;
if (count % 2 != 0)
if (count % 2 != 0)
{
median = a[count / 2];
median = a[count / 2];
}
else
else
{
median = (a[(count / 2) - 1] + a[count / 2]) / 2;
median = (a[(count / 2) - 1] + a[count / 2]) / 2;
}
System.out.println("As of reading element " + (i + 1) + ", the median is " + (int)median);
System.out.println("读取元素 " + (i + 1) + " 时,中位数为 " + (int)median);
}
}
// Driver code
// 驱动代码
public static void main (String[] args)
public static void main (String[] args)
{
Scanner sc=new Scanner(System.in);
Scanner sc=new Scanner(System.in);
System.out.println("Enter number of elements in the array: ");
System.out.println("输入数组中元素的数量: ");
int n= sc.nextInt();
int n= sc.nextInt();
System.out.println("\nEnter elements of the array: ");
System.out.println("\n输入数组的元素: ");
int[] a = new int[5];
int[] a = new int[5];
for (int i = 0 ; i < n; i++ )
for (int i = 0 ; i < n; i++ )
{
a[i]= sc.nextInt();
a[i]= sc.nextInt();
}
Median(a, n);
Median(a, n);
}
}
Output:
输出:
Enter number of elements in the array:
输入数组中元素的数量:
5
Enter elements of the array:
输入数组的元素:
5
10
3
8
12
As of reading element 1, the median is 5
读取元素 1 时,中位数为 5
As of reading element 2, the median is 7
读取元素 2 时,中位数为 7
As of reading element 3, the median is 5
截至读取元素3时,中位数为5
As of reading element 4, the median is 6
截至读取元素4时,中位数为6
As of reading element 5, the median is 8
截至读取元素5时,中位数为8
400. Explain distributed transactions
解释分布式事务
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: system-design
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb02d0 | 官方: 否 | 付费: 否
答案:
Distributed transactions involve a set of operations on data that occur across multiple data repositories (especially databases). The process is most often coordinated across a network of nodes, but it can also span multiple databases on one server. If you need to update related data that is distributed across several databases quickly, you will need distributed transactions.
分布式事务涉及跨多个数据存储库(尤其是数据库)发生的一组数据操作。该过程通常通过网络中的节点进行协调,但也可以跨一台服务器上的多个数据库进行。如果需要快速更新分布在多个数据库中的相关数据,将需要分布式事务。
401. Write a program to check if two strings are anagrams.
编写一个程序来检查两个字符串是否为变位词。
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb02e2 | 官方: 否 | 付费: 否
答案:
An anagram of a string is an equivalent string containing the same characters, but in a different order. An anagram is formed by arranging the characters of another string to form a new string. For example, Secure and Rescue. The characters in Secure can be arranged to form the word Rescue.
字符串的变位词是包含相同字符但顺序不同的等价字符串。变位词通过排列另一个字符串的字符来形成新字符串。例如,Secure和Rescue。Secure中的字符可以排列成单词Rescue。
Code:
代码:
import java.util.*;
import java.util.*;
class Main
class Main
{
public static void main(String[] args)
public static void main(String[] args)
{
String s1 = "Secure";
String s1 = "Secure";
String s2 = "Rescue";
String s2 = "Rescue";
s1 = s1.toLowerCase();
s1 = s1.toLowerCase();
s2 = s2.toLowerCase();
s2 = s2.toLowerCase();
// Check if lengths are the same
// 检查长度是否相同
if(s1.length() == s2.length()) {
如果(s1.length() == s2.length()){
// convert strings to char array
// 将字符串转换为字符数组
char[] arr1 = s1.toCharArray();
字符数组 arr1 = s1.toCharArray();
char[] arr2 = s2.toCharArray();
字符数组 arr2 = s2.toCharArray();
// sort the array
// 对数组进行排序
Arrays.sort(arr1);
Arrays.sort(arr1);
Arrays.sort(arr2);
Arrays.sort(arr2);
// If two sorted char arrays are alike, the string is anagram
// 如果两个排序后的字符数组相同,则该字符串是变位词
boolean result = Arrays.equals(arr1, arr2);
布尔结果 = Arrays.equals(arr1, arr2);
if(result)
如果(结果)
{
System.out.println(s1 + " and " + s2 + " are anagram of each other.");
System.out.println(s1 + " 和 " + s2 + " 互为变位词。");
}
else {
否则 {
System.out.println(s1 + " and " + s2 + " are not anagram of each other.");
System.out.println(s1 + " 和 " + s2 + " 不互为变位词。");
}
}
else {
否则 {
System.out.println(s1 + " and " + s2 + " are not anagram of each other.");
System.out.println(s1 + " 和 " + s2 + " 不互为变位词。");
}
}
}
Output:
输出:
secure and rescue are anagram of each other
secure 和 rescue 互为字母重排词
402. Explain Asymptotic Notation.
解释渐近符号。
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb02e5 | 官方: 否 | 付费: 否
答案:
Asymptotic notations are used to analyze and calculate the running time of a given algorithm. Engineers use asymptotic notation to evaluate the efficiency of their algorithms. Asymptotic notations fall into three main categories: - Big-oh notation: This notation represents upper bound values.
渐近符号用于分析和计算给定算法的运行时间。工程师使用渐近符号来评估其算法的效率。渐近符号主要分为三类: - 大O符号:此符号表示上界值。
- Theta notation: This notation represents average bound values.
Big-Omega notation: This notation represents lower bound values.
Useful Resources - Python Interview Questions有用资源 - Python 面试问题
- Java Interview Questions
- Data Engineer Interview Questions
- Software Engineering Interview Questions
- Technical Interview Questions
- Coding Interview Questions
- Interview Resources
- DSA- Programming
Mock Interview
Intuit Interview Preparation
403. What is the eligibility criteria at Intuit?
Intuit 的资格标准是什么?
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb030a | 官方: 否 | 付费: 否
答案:
Intuit Eligibility Criteria for Software Engineers
Intuit 软件工程师资格标准
| Eligibility Criteria 资格标准 | Details 详细信息 |
|---|---|
| Graduation 学历 | Eligible: BE/B.Tech/ME/MTech 符合条件:BE/B.Tech/ME/MTech |
| Backlogs 挂科 | No active Backlogs 无活跃挂科 |
404. How long does it take to hear back from Intuit?
Intuit 多久会回复?
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb030d | 官方: 否 | 付费: 否
答案:
Intuit's hiring process is dynamic and fast-paced. Upon completing the interview process, you can expect to hear back from the Inuit within one to six business days.
Intuit 的招聘流程动态且节奏较快。完成面试流程后,您预计会在一到六个工作日内收到 Intuit 的回复。
405. How long is the Interview Process at Intuit?
Intuit 的面试流程有多长?
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb0310 | 官方: 否 | 付费: 否
答案:
Intuit's interview process is fairly straightforward, with three-five rounds in general. Intuit may take up to three-four weeks to complete a job interview, depending on its complexity.
Intuit 的面试流程相当直接,通常有三到五轮。根据面试的复杂程度,Intuit 可能需要三到四周的时间来完成整个面试。
406. What is the salary for freshers in Intuit?
Intuit 对应届生的薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb0315 | 官方: 否 | 付费: 否
答案:
SDE1 salaries at Intuit range from ₹ 15 Lakhs to ₹ 35 Lakhs with an average of ₹ 21.2 Lakhs for less than 1 year of experience in India. Salary estimates are based on salaries received from various Intuit employees.
在印度,SDE1 在 Intuit 的薪资范围从 15 万卢比到 35 万卢比,平均为 21.2 万卢比(对于工作经验不足一年者)。薪资估算基于多位 Intuit 员工提供的薪资数据。
407. Why do you want to work at Intuit?
为什么你想在 Intuit 工作?
- 知识点: 其他/未分类 (标签: interviewbit, intuit, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Intuit
- id: 69b37b6b58d557c902bb0318 | 官方: 否 | 付费: 否
答案:
Answering this question reveals how committed you are to the company and how carefully you have researched it. This is your chance to demonstrate your true devotion to the organization. - Show the recruiter that you are familiar with the company's mission and vision and that you are eager to contribute to its success.
回答这个问题可以展现你对公司的承诺程度以及你对其研究得有多深入。这是你展示对组织真实热忱的机会。 - 向招聘人员表明你熟悉公司的使命和愿景,并且渴望为其成功做出贡献。
- Mention what you like about the company's work culture or the employee development programs. You can also mention its safe learning environment, different opportunities to learn, the flexibility with the work hours, and the support you're provided with are unparalleled.
You might mention that Intuit has been ranked 11th on Fortune's list of 100 best companies to work for.
Coding Problems
0/1
Intermediate Problems
中级问题
Strings
字符串
Compare Version Numbers
比较版本号
Medium
中等
67.12 Mins
67.12 分钟
Solve
解答
408. Define Bus Topology.
定义总线拓扑。
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7c58d557c902bb10c0 | 官方: 否 | 付费: 否
答案:
Bus topology is an arrangement of devices in which all the computers or devices are connected to a single data line. Data is transmitted from one point to another (One-way flow).
总线拓扑是一种设备排列方式,其中所有计算机或设备都连接到单一数据线上。数据从一点传输到另一点(单向流动)。
Useful Resources
有用资源
- Python Interview Questions
- Java Interview Questions
- Selenium Interview Questions
- Automation Testing Interview Questions
- Software Engineering Interview Questions
- Full Stack Developer Interview Questions
- Front End Developer Interview Questions
- Technical Interview Questions
- Coding Interview Questions
- Interview Resources
409. How UNION is different from UNION all?
UNION 与 UNION ALL 有何不同?
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7c58d557c902bb10c3 | 官方: 否 | 付费: 否
答案:
Union is an SQL command and it is used to join two or more sets into a single set. Two queries can be combined easily into a single result set using the select statements.
UNION 是一种 SQL 命令,用于将两个或多个集合合并为一个集合。两条查询可以通过 SELECT 语句轻松合并为单一结果集。
Syntax:
语法:
Query1 UNION Query2
查询1 UNION 查询2
Example:
示例:
Consider that we have two tables:
假设我们有两个表:
Organization1
组织1
| Employee_Name 员工姓名 | Employee_ID 员工ID |
|---|---|
| Rahul | 7 |
| Amit | 11 |
| Sumit | 18 |
Organization2
组织2
| Employee_ Name | Employee_ID |
|---|---|
| Anita | 14 |
| Priyesh | 24 |
| Harshit | 25 |
| Employee_ Name | Employee_ID |
|---|---|
| Anita | 14 |
| Priyesh | 24 |
| Harshit | 25 |
SELECT Employee_Name from Organization1 UNION SELECT Employee_Name FROM Organization2
SELECT Employee_Name from Organization1 UNION SELECT Employee_Name FROM Organization2
Result:
结果:
| Employee_Name |
|---|
| Rahul |
| Amit |
| Sumit |
| Anita |
| Priyesh |
| Harshit |
| Employee_Name |
|---|
| Rahul |
| Amit |
| Sumit |
| Anita |
| Priyesh |
| Harshit |
Here, we have used two different tables for extraction of rows but the column specified for extraction is the same for both. Like UNION, we will get an error if different columns are used. It is important to note that the data type specified also must be the same for both queries. Note that the result of UNION contains distinct values only.
这里,我们使用了两个不同的表来提取行,但指定提取的列对两者是相同的。像 UNION 一样,如果使用不同的列,我们将收到错误。值得注意的是,两条查询指定的数据类型也必须相同。请注意,UNION 的结果仅包含不同的值。
Union ALL is also an SQL command and it is also used to join two or more sets into a single set (like UNION). The only difference between UNION and UNION ALL is that UNION marks distinct entries only, whereas the result of UNION ALL may contain duplicate values as well.
UNION ALL 也是一种 SQL 命令,它也用于将两个或多个集合合并为一个集合(类似于 UNION)。UNION 和 UNION ALL 之间的唯一区别在于,UNION 仅包含不同的条目,而 UNION ALL 的结果可能包含重复值。
Example:
示例:
Consider that we have two tables:
假设我们有两个表:
Organization1
组织1
| Employee_Name 员工姓名 | Employee_ID 员工ID |
|---|---|
| Rahul | 7 |
| Amit | 11 |
| Sumit | 18 |
Organization2
组织2
| Employee_ Name 员工姓名 | Employee_ID 员工ID |
|---|---|
| Anita | 14 |
| Sumit | 11 |
| Harshit | 25 |
SELECT Employee_Name from Organization1 UNION ALL SELECT Employee_Name FROM Organization2
SELECT Employee_Name from Organization1 UNION ALL SELECT Employee_Name FROM Organization2
Result:
结果:
| Employee_ Name 员工姓名 |
|---|
| Rahul |
| Amit |
| Sumit |
| Anita |
| Sumit |
| Harshit |
Here, we have used two different tables for the extraction of rows but the column specified for extraction is the same for both. Like UNION, We will get an error if different columns are used. It is important to note that the data type specified also must be the same for both queries. Note that the result of UNION ALL can contain duplicate values as well.
这里,我们使用了两个不同的表来提取行,但两表中用于提取的列是相同的。和UNION一样,如果使用不同的列,我们会得到错误。需要注意,两个查询中指定的数据类型也必须相同。还要注意,UNION ALL的结果可以包含重复值。
410. Differentiate between super key and primary key?
区分超键和主键?
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7c58d557c902bb10c6 | 官方: 否 | 付费: 否
答案:
| Super Key 超键 | Primary Key 主键 |
|---|---|
| Super key is an attribute (or set of attributes) that uniquely identifies all attributes in a relation. 超键是一个属性(或一组属性),能够唯一标识关系中的所有属性。 | Primary Key is a minimum set of an attribute (or set of attributes) that has the capability to uniquely identify all attributes in a relation. 主键是一组最小的属性(或一组属性),具有唯一标识关系中所有属性的能力。 |
| For relation, the number of super keys is more than the number of primary keys. 对于关系,超键的数量多于主键的数量。 | For relation, the number of primary keys is less than the number of super keys. 对于关系,主键的数量少于超键的数量。 |
| Super key attributes can contain NULL values. 超键属性可以包含NULL值。 | Primary key attributes cannot contain NULL values. 主键属性不能包含NULL值。 |
- Data Science
- All Events
- My Events
411. Problem statement: You are given an array nums having n integers colored red, white, or blue, sort them in place so that objects of the same color are adjacent, with the colors in the order red, white, and blue.
问题描述:给定一个数组nums,包含n个整数,颜色分别为红、白或蓝,请将其原地排序,使得相同颜色的对象相邻,并按红、白、蓝的顺序排列。
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7c58d557c902bb10cc | 官方: 否 | 付费: 否
答案:
Here 0, 1, and 2 represent the colors red, white, and blue, respectively.
这里,0、1和2分别代表红、白和蓝颜色。
Input Format:
输入格式:
You are required to complete void sortColors(vector &nums) function.
你需要完成 void sortColors(vector &nums) 函数。
Output:
输出:
You are not required to return anything (Just sort the array)
你不需要返回任何内容(只需对数组进行排序)
Constraints:
约束:
1 nums[i] can be 0, 1 and 2 only for i in the range 0 Time Limit: 1 sec
1 对于范围 0 内的 i,nums[i] 只能为 0、1 和 2 时间限制:1 秒
Sample Input 1:
样本输入 1:
Sample Output 1:
样本输出 1:
Sample Input 2:
样本输入 2:
Sample Output 2:
样本输出 2:
Approaches
方法
- Sort the array using the merge sort algorithm:
- We can simply sort the array using the merge sort algorithm.
- Time Complexity: O(N Log N) where N is the number of elements in the array.
- Space Complexity: O(1)
- Using three variables:
- We can create three variables zero, one and two. All are initialized as 0. Now we will iterate over the nums and increment zero by once if the current element is 0 or increment one by once if the current element is 1 otherwise we will increment two by once.
- Then, we will iterate through the nums again and start assigning 0 at positions and decrementing the value zero unless and until zero becomes equal to 0, then we will continue the same thing for one and then for two.
- Time Complexity: O(N) Where N is the number of elements in the array.
- Space Complexity: O(1)
- Dutch National Flag algorithm: Though, the second approach mentioned above takes O(N) time. But sometimes the interviewer puts forward the constraint to solve the problem in a single pass only.
- Let’s initialise three-pointers low, mid and high as 0, 0 and N - 1 respectively.
- We will iterate over nums till mid is less than equal to high.
- If at any step the value of nums at the index mid is equal to 0 then we will swap elements at the positions low and mid. Also, we will increment both low and mid by one.
- Else if the value at the index mid is equal to 2, we will swap the values at positions mid and high. Also, we will decrement the value of high by one.
- Otherwise, we will increment the value of mid by one.
In this way, we will be able to sort the given array in a single pass only.
通过这种方式,我们可以在单次遍历中完成对给定数组的排序。
Source Code:
源代码:
class Solution {
class Solution {
public:
public:
void sortColors(vector& nums) {
void sortColors(vector& nums) {
/*
0 ... low - 1 : 0
0 ... 低 - 1 : 0
low ... mid - 1 : 1
低 ... 中 - 1 : 1
mid ... n - 1 : 2
中 ... n - 1 : 2
*/
// Get the size of the given vector
// 获取给定向量的大小
int n = nums.size();
int n = nums.size();
// Initialize three variables
// 初始化三个变量
int low = 0, mid = 0, high = n - 1;
int low = 0, mid = 0, high = n - 1;
// Iterate till mid is less than or equal to high
// 循环直到中大于高
while(mid <= high)
while(mid <= high)
{
/*
If the value stored at
如果存储在
mid is zero
中的值
then swap value stored at mid
为零
with the value store at low
那么交换存储在中
increment low and mid by one
与存储在低的值
*/
if(nums[mid] == 0)
if(nums[mid] == 0)
{
swap(nums[mid], nums[low]);
交换(中, 低);
mid++;
mid++;
low++;
low++;
}
/*
Else if the value stored at
否则,如果存储在
mid is 2
mid 处的值为 2
then swap value stored at mid
为零
with the value store at high and
与 high 处存储的值,并
decrement the high variable by one
将 high 变量减一
*/
else if(nums[mid] == 2)
else if(nums[mid] == 2)
{
swap(nums[high], nums[mid]);
swap(nums[high], nums[mid]);
high--;
high--;
}
/*
Else increment mid by one
否则,将 mid 增加一
*/
else
else
mid++;
mid++;
}
// At the end nums will become sorted
// 最后,nums 将变为有序
}
};
412. Differentiate between String and StringBuffer?
区分 String 和 StringBuffer 的不同之处?
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7c58d557c902bb10d1 | 官方: 否 | 付费: 否
答案:
| String | StringBuffer |
|---|---|
| It is a non-mutable class. 它是不可变类。 | It is a mutable class. 它是可变类。 |
| It is slow and consumes more memory space. 它速度慢且占用更多内存空间。 | It is fast and takes less memory space. 它速度快且占用更少内存空间。 |
| The string class uses a string pool area. String 类使用字符串池区域。 | StringBuffer uses heap memory. StringBuffer 使用堆内存。 |
| String class overrides the equals() method of an object class. So using the equals() method you can compare two strings easily. String 类重写了对象类的 equals() 方法。因此,使用 equals() 方法可以轻松比较两个字符串。 | StringBuffer class doesn't override the equals() method of an object class. StringBuffer 类没有重写对象类的 equals() 方法。 |
413. What is a singleton class?
什么是单例类?
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7c58d557c902bb10d5 | 官方: 否 | 付费: 否
答案:
Singleton class is a class that can have only one object at a time. After this, if you further try to create an object of the Singleton class, then the new variable also points to the first object that you had created initially. So whatever changes you do to any variable inside the class through any object, it affects the variable of the single instance created.
单例类是一种在任何时候只能有一个对象的类。之后,如果你进一步尝试创建该单例类的对象,新的变量也会指向你最初创建的第一个对象。因此,无论你通过任何对象对类内的任何变量做了何种更改,它都会影响所创建的单一实例的变量。
414. What is inheritance? Also, discuss various types of inheritance?
什么是继承?同时,讨论各种类型的继承?
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7c58d557c902bb10e4 | 官方: 否 | 付费: 否
答案:
In the context of a class, inheritance is the capability of a class to inherit the properties and characteristics of another class. Inheritance is considered one of the most important concepts of Object-Oriented Programming (OOPS).
在类的上下文中,继承是类继承另一个类的属性和特征的能力。继承被认为是面向对象编程(OOPS)中最重要的概念之一。
In this process, new classes are created from the existing class. The new class created is known as the derived class and the existing class is known as the parent class or base class.
在这个过程中,从现有类创建新类。创建的新类称为派生类,而现有类称为父类或基类。
Types of Inheritance:
继承类型:
Single inheritance: In this type of inheritance only one class is allowed to inherit from one class. In other words, we can say that one derived class is inherited from the base class. 2. Multiple inheritances: In multiple inheritances, a class is allowed to inherit from more than one base class. Some languages, like C++, support multiple inheritances but other languages like Java don’t. Though, in Java, we can achieve multiple inheritances through an interface. 3. Multilevel inheritance: In multilevel inheritance, a derived class inherits another derived class. 4. Hierarchical inheritance: In this type of inheritance, more than one derived class are inherited from a common base class. 5. Hybrid inheritance: Hybrid inheritance is also known as virtual inheritance. It is a combination of more than one inheritance. For example, we can combine hierarchical inheritance and multiple inheritances.
- 单继承:在这种类型的继承中,只允许一个类从一个类继承。换句话说,我们可以说一个派生类是从基类继承的。 2. 多重继承:在多重继承中,允许一个类从多个基类继承。某些语言(如 C++)支持多重继承,但其他语言(如 Java)不支持。不过,在 Java 中,我们可以通过接口实现多重继承。 3. 多级继承:在多级继承中,派生类继承另一个派生类。 4. 层次继承:在这种类型的继承中,多个派生类从一个共同的基类继承。 5. 混合继承:混合继承也称为虚拟继承。它是多种继承的组合。例如,我们可以组合层次继承和多重继承。
415. How is a method is different from a constructor?
方法与构造函数有何不同?
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7c58d557c902bb10ee | 官方: 否 | 付费: 否
答案:
| Method 方法 | Constructor 构造器 |
|---|---|
| Method is used to depict the functionality of an object. 方法用于描述对象的功能。 | A constructor is used to initialize an object. 构造器用于初始化对象。 |
| Methods are invoked explicitly. 方法被显式调用。 | Constructors are invoked implicitly. 构造器被隐式调用。 |
| The method must contain a return type. 方法必须包含返回类型。 | Constructors don’t contain any return type. 构造器不包含任何返回类型。 |
| If a method is not specified by the user, no default method is provided. 如果用户未指定方法,则不会提供默认方法。 | If a constructor is not specified by the user then in that case default constructor is provided by the compiler. 如果用户未指定构造器,则编译器会提供默认构造器。 |
416. What is a deadlock and discuss the necessary conditions for deadlock?
什么是死锁,并讨论死锁的必要条件?
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7c58d557c902bb10f1 | 官方: 否 | 付费: 否
答案:
Deadlock is a situation in which two or more processes wait for each other to get complete but none of them can ever complete (More specifically, they wait for the resources being held by the other).
死锁是一种两个或多个进程相互等待对方完成,但没有任何一个进程能够完成的情况(更具体地说,它们等待由其他进程持有的资源)。
Let us consider a scenario in which there are three different resources Resource1, Resource2, and Resource3, and three different processes Process1, Process2, and Process3. Resource1 is allocated to Process1, Resource2 is allocated to Process2, and Resource3 is allocated to Process3. After some time, Process1 asks for Resource1 that is being used by Process2. Process1 stops or halts its execution as it cannot be completed without Resource2. Process2 also demands Resource3 which is being used by Process3. Likewise, Process1 and Process2 also halt their execution because they cannot continue without Resource3. Process3 also asks for Resource1 which is used by Process1. Eventually, Process3 also halts its execution.
让我们考虑一个场景,其中有三个不同的资源Resource1、Resource2和Resource3,以及三个不同的进程Process1、Process2和Process3。Resource1被分配给Process1,Resource2被分配给Process2,Resource3被分配给Process3。一段时间后,Process1请求已被Process2使用的Resource1。Process1停止或暂停其执行,因为没有Resource2无法完成。Process2也要求已被Process3使用的Resource3。同样,Process1和Process2也因为缺少Resource3而暂停执行。Process3也请求已被Process1使用的Resource1。最终,Process3也暂停其执行。
The four necessary conditions for deadlock are listed below:
死锁的四个必要条件如下所列:
Mutual Exclusion: It states that a resource can be used in a mutually exclusive manner. It means that two or more two processes cannot share a resource at the same time. 2. Hold and Wait: A process holds for a resource (that is being held by another process) while holding another resource. 3. No preemption: A process cannot release a resource until it gets completed. 4. Circular wait: It is a logical extension of hold and wait. It states that all the processes are arranged in a cyclic manner. Each process in the circular list waits for the resource being held by the next immediate process.
- 互斥条件:它指出资源可以以互斥的方式使用。这意味着两个或更多进程不能同时共享一个资源。 2. 持有并等待:一个进程在持有另一个资源的同时,等待另一个资源(该资源正被其他进程持有)。 3. 不可剥夺:一个进程在完成之前不能释放资源。 4. 循环等待:它是持有并等待的逻辑扩展。它指出所有进程以循环方式排列。循环列表中的每个进程等待紧邻的下一个进程持有的资源。
For example, if P[i] is the process and there are N number of processes in total, then the P[i] process waits for the resource allocated to the P[i] % (N + 1) process.
例如,如果P[i]是进程,总共有N个进程,则P[i]进程等待分配给P[i] % (N + 1)进程的资源。
417. Do interns get paid at JP Morgan?
在摩根大通,实习生有薪酬吗?
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7d58d557c902bb1127 | 官方: 否 | 付费: 否
答案:
Yes, JP Morgan pays well to their interns. The average stipend is around Rs. 6,48,053 per year.
是的,摩根大通给实习生的薪酬很优厚。平均津贴约为每年648,053卢比。
418. What is the eligibility criteria at JP Morgan’s?
摩根大通的资格标准是什么?
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7d58d557c902bb112a | 官方: 否 | 付费: 否
答案:
The eligibility criteria for software developer roles are given below: - BS/BA degree or equivalent experience.
软件开发人员角色的资格标准如下:- 学士学位或同等经验。
- Proficiency in one or more modern programming languages.
- Advanced knowledge of application, data, and infrastructure architecture disciplines.
- Understanding of software skills such as business analysis, development, maintenance, and software improvement.
- Understanding of architecture and design across all systems Working proficiency in developmental toolsets Knowledge of industry-wide technology trends and best practices.
419. What is your biggest failure in your life and how did you handle it?
你一生中最大的失败是什么,你是如何处理的?
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7d58d557c902bb112d | 官方: 否 | 付费: 否
答案:
This is the most frequently asked question in a HR interview. Such types of questions are asked in an interview to assess the honesty and attitude of the candidate. You have to be careful while sharing the incident you choose to explain. The mistakes that resulted in huge losses must be avoided. After sharing the incident, also share the lesson you learnt from it.
这是人力资源面试中最常被问到的问题。这类问题在面试中被提出,用于评估候选人的诚实度和态度。在分享你选择解释的事件时需要小心。那些导致巨大损失的错误必须避免。分享事件之后,还要分享你从中吸取的教训。
For example,
例如,
“I was managing a project and the senior authority wanted me to complete the project within two weeks. Since I was quite excited about the project so I decided to take up the project. But the project took more than two weeks time.
“我正在管理一个项目,高级管理层希望我在两周内完成项目。因为我对项目感到非常兴奋,所以我决定接下这个项目。但项目花了超过两周的时间。
After this incident, I always analyze the project first and if I think I need more time for the project to be done, I simply ask them to impart me more time.”
这件事之后,我总是先分析项目,如果我觉得我需要更多时间来完成项目,我就会直接请求他们给我更多时间。”
420. What is a HireVue interview?
什么是 HireVue 面试?
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7d58d557c902bb1130 | 官方: 否 | 付费: 否
答案:
After clearing the online assessment round, candidates are required to go through a HireVue interview. HireVue is a kind of software that assesses the candidate on the basis of the traits like body language, eye movement, and more. If you are applying for a software engineer role then you should prepare JP Morgan interview questions to clear this round.
通过在线评估环节后,候选人需要参加 HireVue 面试。HireVue 是一种根据身体语言、眼球运动等特征评估候选人的软件。如果您申请的是软件工程师职位,则应准备摩根大通面试问题以通过此轮。
421. How much time does JP Morgan take to declare the result?
摩根大通需要多长时间公布结果?
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7d58d557c902bb1133 | 官方: 否 | 付费: 否
答案:
JP Morgan takes around 3 weeks to declare the final result.
摩根大通大约需要 3 周时间公布最终结果。
422. How long is the JP Morgan interview process?
摩根大通的面试流程有多长?
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7d58d557c902bb1136 | 官方: 否 | 付费: 否
答案:
It is a fairly long process. Generally, it consists of three rounds but this process can take up to 2 months .
这是一个相当长的流程。通常,它包括三轮,但此流程可能需要长达 2 个月的时间。
423. Is it hard to get into JP Morgan?
进入摩根大通难吗?
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7d58d557c902bb1139 | 官方: 否 | 付费: 否
答案:
One needs a proper preparation strategy and then anyone can make it to J.P. Morgan easily. To crack interviews you must prepare the following topics thoroughly:
需要制定适当的准备策略,然后任何人都能轻松进入摩根大通。为了通过面试,您必须彻底准备以下主题:
To ace Online assessment and technical interview rounds:
为了通过在线评估和技术面试轮:
Data Structures and Algorithms: - Linked lists
数据结构和算法:- 链表
- Recursion
- Dynamic Programming
Sorting algorithms.
DBMS: - This is the most asked topic after data structure and algorithms.数据库管理系统:- 这是继数据结构和算法之后最常被问到的主题。
Generally, keys and normalization concepts are asked from this subject.
Operating System: - You must have a good knowledge of how the CPU schedules different tasks in our system.操作系统:- 您必须对 CPU 如何在系统中调度不同任务有良好的了解。
- Generally, questions from deadlock are asked in the interview.
424. Why do you want to join JP Morgan?
为什么您想加入摩根大通?
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7d58d557c902bb113c | 官方: 否 | 付费: 否
答案:
While answering these types of questions, mention the company's work culture that inspires you to join the company. Also, tell them about your goals to learn new things while working at the company.
回答此类问题时,请提及激励您加入公司的企业文化。同时,告诉他们您在公司工作期间学习新事物的目标。
For example,
例如,
You can say, “I am a determined person and want to work for an organization where I would get the opportunity to work on challenging problems. JP Morgan has a set of principles that are quite impressive. The principles will help me to improve and grow at the same time.”
您可以说:“我是一个坚定的人,想在一个能有机会解决挑战性问题的组织工作。摩根大通有一系列令人印象深刻的准则。这些准则将帮助我在提升自我的同时实现成长。”
425. What makes you a good fit for the job?
你为什么适合这个职位?
- 知识点: 其他/未分类 (标签: interviewbit, jp-morgan, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: 摩根大通
- id: 69b37b7d58d557c902bb113f | 官方: 否 | 付费: 否
答案:
To answer such questions, you must highlight what makes you stand out and why the interviewer should be excited to have you on their team. Speak aloud about what you are good at, and the things you have done in the past that demonstrate your strength and abilities.
回答这类问题时,你必须突出自己的独特之处,以及为什么面试官应该为有你加入团队而感到兴奋。大声说出你擅长的方面,以及你过去做过的事情,来证明你的优势和能力。
Coding Problems
0/2
Easy Problems
简单问题
Arrays
数组
Spiral Order Matrix I
螺旋顺序矩阵 I
Easy
简单
68.0 Mins
68.0 分钟
Solve
解答
Spiral Order Matrix II
螺旋矩阵 II
Easy
简单
48.40 Mins
48.40 分钟
Solve
解答
426. With an example, explain the syntax for the 'foreach' loop.
用一个例子解释'foreach'循环的语法。
- 知识点: 其他/未分类 (标签: interviewbit, justdial, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Justdial
- id: 69b37b8158d557c902bb13cc | 官方: 否 | 付费: 否
答案:
To loop through arrays, use the foreach expression. The current array element's value is assigned to the $value in each pass, the array pointer is moved by one, and the next element is processed in the following pass.
要遍历数组,请使用foreach表达式。在每次迭代中,当前数组元素的值被赋给$value,数组指针移动一位,并在下一次迭代中处理下一个元素。
Syntax-
语法-
foreach (array as value)
foreach (array as value)
{
code to be executed;
要执行的代码;
}
427. What's the difference between '==' and '===' operators?
'=='和'==='运算符有什么区别?
- 知识点: 其他/未分类 (标签: interviewbit, justdial, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Justdial
- id: 69b37b8158d557c902bb13ed | 官方: 否 | 付费: 否
答案:
Both of these operators are comparison operators. The distinction between the two operators is that the "==" compares values, whereas the " === " compares both values and types.
这两个运算符都是比较运算符。两者的区别在于,"=="比较值,而"==="比较值和类型。
The main difference between the "==" and "===" operators is that the former compares variables by making type corrections, for example, if you compare a number with a string with a numeric literal, == allows it, but === does not, because it not only checks the value but also the type of two variables; if two variables are not of the same type, "===" returns false, while "==" returns true.
"=="和"==="运算符的主要区别在于,前者通过进行类型修正来比较变量,例如,如果你将一个数字与一个包含数字字面量的字符串进行比较,==允许这样做,但===不允许,因为它不仅检查值,还检查两个变量的类型;如果两个变量类型不同,"==="返回false,而"=="返回true。
428. What do you mean when you say "class" and "object"?
当你说“类”和“对象”时,你指的是什么?
- 知识点: 其他/未分类 (标签: interviewbit, justdial, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Justdial
- id: 69b37b8158d557c902bb13f9 | 官方: 否 | 付费: 否
答案:
- An object's blueprint or template is called a class. It's a data type that's been specified by the user. Variables, constants, member functions, and other functionality are defined within a class. At runtime, it does not use any memory. It's worth noting that classes aren't considered data structures. It's a logical thing.
- A real-world entity with attributes, behaviour, and properties is called an object. An instance of the class is what it's called. It includes member functions and variables defined in the class. It takes up room in the mind. Objects have a variety of states, properties, and behaviours.
429. What are the different stages of the Software Development Lifecycle(SDLC)? Name a few well-known SDLC models.
软件开发生命周期(SDLC)的不同阶段有哪些?列举几个知名的SDLC模型。
- 知识点: 其他/未分类 (标签: interviewbit, justdial, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Justdial
- id: 69b37b8158d557c902bb13fc | 官方: 否 | 付费: 否
答案:
The Software Development Life Cycle (SDLC) is a framework for defining the steps involved in software development at each stage. It includes a step-by-step guide to creating, deploying, and managing software. Following the SDLC process ensures that software is developed in a methodical and disciplined manner.
软件开发生命周期(SDLC)是一个框架,用于定义每个阶段软件开发中涉及的步骤。它包括创建、部署和管理软件的逐步指南。遵循SDLC流程可确保软件以有条理和规范的方式进行开发。
Requirement gathering, design, coding, testing, deployment, and maintenance are the phases of the SDLC. To supply the Product in a structured way, it is critical to stick to the phases:
需求收集、设计、编码、测试、部署和维护是SDLC的阶段。为了以结构化的方式提供产品,坚持这些阶段至关重要:
- Requirement gathering: During this phase, all relevant customer information is gathered in order to create a product that fits their requirements. During this step, any differences must be resolved.
After gathering requirements, an analysis is conducted to determine the viability of developing a product. In the event of any ambiguity, a conference call is scheduled for additional discussion. The SRS (Software Requirement Specification) document is prepared once the requirement has been well understood. The developers should properly understand this document, and the customer should examine it for future reference.
收集需求后,会进行分析以确定开发产品的可行性。如果存在任何模糊之处,将安排电话会议进行进一步讨论。一旦充分理解了需求,就准备SRS(软件需求规格说明)文档。开发人员应正确理解该文档,客户应检查该文档以备将来参考。
- Design: In this phase, the requirements gathered in the SRS document are used as input, and the software architecture for system development is derived.
- Coding or Implementation: The implementation/coding phase begins once the developer receives the Design document. The software design is used to generate source code. All of the software's components are implemented during this phase.
- Testing: Testing begins once the coding is complete and the modules are ready to be tested. During this phase, the resulting software is rigorously tested, and any faults detected are assigned to developers to be fixed.
Retesting, also known as regression testing, is done until the program fulfils the requirements of the customer. The SRS document is used by testers to confirm that the program meets the needs of the customer.
重新测试,也称为回归测试,将持续进行,直到程序满足客户的需求。测试人员使用SRS文档来确认程序是否满足客户的需求。
- Deployment: The product is either placed into production or first submitted to UAT (User Acceptance Testing), depending on the customer's expectations.
In UAT, a replica of the production environment is built, and the client performs the testing in partnership with the developers. The customer must sign off on the application before it can go live if he or she is satisfied with it.
在UAT中,会构建一个生产环境的副本,并由客户与开发人员合作进行测试。如果客户对应用程序满意,则必须签署通过后才能上线。
- Maintenance: Following the deployment of a product in a production environment, the developers are responsible for product maintenance, which includes resolving any issues that arise and making any necessary enhancements.
The following are some of the most prevalent SDLC models : Waterfall, Iterative, Spiral, V-shaped model and Agile.
以下是一些最常见的SDLC模型:瀑布模型、迭代模型、螺旋模型、V型模型和敏捷模型。
430. What is the difference between functional and non-functional requirements (NFRs)?
功能需求和非功能需求(NFR)之间的区别是什么?
- 知识点: 其他/未分类 (标签: interviewbit, justdial, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Justdial
- id: 69b37b8158d557c902bb13ff | 官方: 否 | 付费: 否
答案:
- Functional requirements define what a software system should be able to achieve. These describe what consumers can expect as a result of a particular input. Reports, interactive features, and other features are examples of functional needs.
- Non-functional requirements (NFRs) are concerned with the performance of a software system. Performance, scalability, reliability, availability, security, and maintainability are just a few of the requirements. To provide long-term value, a software system must meet both functional and non-functional needs.
431. Explain Modularization.
解释模块化。
- 知识点: 其他/未分类 (标签: interviewbit, justdial, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Justdial
- id: 69b37b8158d557c902bb1402 | 官方: 否 | 付费: 否
答案:
Modularization is the process of breaking down a program's functionality into separate, interchangeable modules, each of which contains only the information needed to carry out one part of the desired capability.
模块化是将程序的功能分解为独立、可互换的模块的过程,每个模块只包含执行所需能力某一部分所需的信息。
We can quickly add separate and smaller modules to a program using modularization without being hampered by the intricacy of the program's other functionalities. In a nutshell, it's about being adaptable and quick when it comes to introducing new software functionalities to a programme. We could simply work individually on each module in a software engineering team without disrupting the work of others.
使用模块化,我们可以快速将单独且较小的模块添加到程序中,而不会受到程序其他功能的复杂性的阻碍。简而言之,这关乎为程序引入新软件功能时的适应性和速度。我们可以在软件工程团队中独立处理每个模块,而不会干扰他人的工作。
Modularization has the following benefits: - It is easier to handle a program that is divided down into smaller sub-programs. It's easier to test, implement, and develop distinct modules. Individual modules can then be combined to create the entire program.
模块化具有以下好处:- 处理被划分为更小子程序的程序更容易。测试、实现和开发不同模块更简单。随后可将各个模块组合起来创建整个程序。
- The program can be separated into functional sections, and the required level of abstraction can be added.
- A program module can be reused in another program, reducing the development of redundant code. Reusing a module is also more convenient than writing a program from scratch. It also necessitates the writing of very little code.
- Modularisation reduces the chances of programming errors and makes it easier to notice them if they occur. This is because the mistakes can be pinpointed to a specific function or sub-program.
- Modular programming divides development by breaking down a program into smaller programs that can perform a range of functions. This allows developers to work on multiple projects at the same time, reducing development time.
432. What are the main features of OOPs?
面向对象编程(OOPs)的主要特性有哪些?
- 知识点: 其他/未分类 (标签: interviewbit, justdial, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Justdial
- id: 69b37b8158d557c902bb1408 | 官方: 否 | 付费: 否
答案:
The main features of OOPs are: - Inheritance: OOPs have a feature called inheritance, which allows classes to inherit common properties from other classes. For example, if there is a class called vehicle, other classes such as 'car,' 'bike,' and so on can inherit common properties from it. This attribute aids in the removal of unnecessary code, resulting in a reduction in the total size of the code.
OOPs的主要特性是:- 继承:OOPs有一个称为继承的特性,允许类从其他类继承公共属性。例如,如果有一个名为“vehicle”的类,其他类如“car”、“bike”等可以从它继承公共属性。这一属性有助于消除不必要的代码,从而减少代码的总大小。
- Polymorphism: The ability to exist in various forms is referred to as polymorphism. A single interface might have several definitions. It is a concept in computer science that you can access objects of various types through the same interface. This interface can be implemented in a variety of ways by each type.
- Encapsulation: Encapsulation is the process of combining data and the code that manipulates it into a single entity. Encapsulation can also refer to a mechanism that prevents users from directly accessing specific components of an object, such as state values for all of the object's variables. Data members as well as data functions or methods linked with an instantiated class or object can be hidden via encapsulation.
- Data abstraction: Data abstraction is a crucial element of OOPs that allows only the most necessary information to be displayed while the implementation details are hidden. For example, while riding a bike, you know that increasing the accelerator would increase your speed, but you have no idea how that happens. Because the implementation specifics are hidden from the rider, this is data abstraction.
433. Define exception handling.
定义异常处理。
- 知识点: 其他/未分类 (标签: interviewbit, justdial, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Justdial
- id: 69b37b8158d557c902bb1417 | 官方: 否 | 付费: 否
答案:
Exception handling is a crucial notion in Object-Oriented Programming for dealing with errors. Errors can be thrown and caught, and an exception handler implements a centralized mechanism to resolve them. As a result, exception handling is the method for identifying the program's unwanted states and expressing the desired outcomes of those states.
异常处理是面向对象编程中处理错误的关键概念。错误可以被抛出和捕获,异常处理器实现了一种集中式机制来解决它们。因此,异常处理是识别程序不需要的状态并表达这些状态预期结果的方法。
Exceptions are handled with a try/catch block. The try block is used to define a series of statements that could result in an error. Essentially, the catch block catches the exception.
异常通过try/catch块来处理。try块用于定义一组可能导致错误的语句。本质上,catch块捕获异常。
434. Define Hypertext Preprocessor.
定义超文本预处理器。
- 知识点: 其他/未分类 (标签: interviewbit, justdial, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Justdial
- id: 69b37b8158d557c902bb141a | 官方: 否 | 付费: 否
答案:
PHP (Hypertext Preprocessor) is a popular open-source server-side scripting language that's ideal for building dynamic websites and mobile APIs.
PHP(超文本预处理器)是一种流行的开源服务器端脚本语言,非常适合构建动态网站和移动API。
Many databases are supported by PHP, including MySQL, Solid, PostgreSQL, Oracle, Sybase, and generic ODBC. HTML contains PHP code integrated within it.
PHP支持许多数据库,包括MySQL、Solid、PostgreSQL、Oracle、Sybase以及通用ODBC。HTML中包含集成在内的PHP代码。
435. What does PEAR stand for?
PEAR代表什么?
- 知识点: 其他/未分类 (标签: interviewbit, justdial, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Justdial
- id: 69b37b8158d557c902bb1421 | 官方: 否 | 付费: 否
答案:
PEAR stands for "PHP Extension and Application Repository" PEAR's mission is to provide: - For PHP users, a well-organised library of open-source code.
PEAR代表“PHP扩展与应用仓库”。PEAR的使命是提供:- 为PHP用户,提供一个组织良好的开源代码库。
- A mechanism for distributing code and maintaining packages.
- a uniform style for code written in PHP
PHP Extension Community Library (PECL).
The PHP/PEAR community is supported via a website, email groups, and download mirrors.PHP/PEAR社区通过网站、邮件组和下载镜像获得支持。
PEAR is a reusable PHP component framework and distribution mechanism. For web developers, PEAR enables a higher level of programming. It's jam-packed with PHP code snippets and libraries. It also has a command-line interface for installing packages automatically.
PEAR是一个可重用的PHP组件框架和分发机制。对于Web开发者,PEAR实现了更高层次的编程。它充满了PHP代码片段和库。它还具有命令行界面,用于自动安装包。
436. What exactly is JSX?
什么是JSX?
- 知识点: 其他/未分类 (标签: interviewbit, justdial, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Justdial
- id: 69b37b8158d557c902bb1424 | 官方: 否 | 付费: 否
答案:
JSX is a JavaScript syntax extension. It's a term that's used in React to describe how the user interface should look. We can write HTML structures in the same file as JavaScript code by utilising JSX.
JSX是JavaScript语法扩展。这是React中用于描述用户界面外观的术语。通过利用JSX,我们可以在与JavaScript代码相同的文件中编写HTML结构。
437. What is a path traversal attack?
什么是路径遍历攻击?
- 知识点: 其他/未分类 (标签: interviewbit, justdial, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Justdial
- id: 69b37b8158d557c902bb142d | 官方: 否 | 付费: 否
答案:
The goal of a path traversal attack (also known as directory traversal) is to gain access to files and directories stored outside of the web root folder. It may be possible to access arbitrary files and directories stored on the file system, including application source code or configuration, by manipulating variables that reference files with "dot-dot-slash (../)" sequences and variations, or by using absolute file paths. It should be remembered that system operational access control restricts file access (such as in the case of locked or in-use files on the Microsoft Windows operating system).
路径遍历攻击(也称为目录遍历)的目标是访问存储在Web根文件夹之外的文件和目录。通过操纵引用带有“点-点-斜杠(../)”序列及其变体的文件的变量,或使用绝对文件路径,可能访问文件系统上存储的任意文件和目录,包括应用程序源代码或配置。应记住,系统操作访问控制限制文件访问(例如,在Microsoft Windows操作系统上锁定或正在使用的文件的情况下)。
The "dot-dot-slash" attack is also known as "directory traversal," "directory climbing," and "backtracking."
“点-点-斜杠”攻击也被称为“目录遍历”、“目录爬升”和“回溯”。
JustDial Interview Preparation
438. Why are you interested in working at JustDial?
你为什么对在JustDial工作感兴趣?
- 知识点: 其他/未分类 (标签: interviewbit, justdial, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Justdial
- id: 69b37b8158d557c902bb1455 | 官方: 否 | 付费: 否
答案:
This is where your research will be useful. You may declare that you wish to work for a firm that for example may be a market leader or an innovator, providing a vital service, whatever it may be. Try to connect the company's principles and mission statement to your own goals and career aspirations.
这是你的研究能发挥作用的地方。你可以声明,你希望为一家例如可能是市场领导者或创新者的公司工作,提供关键服务,无论是什么。尝试将公司的原则和使命宣言与你的个人目标和职业抱负联系起来。
“Just Dial Limited is India's No. 1 Local Search Engine, providing local search-related services to consumers across the country via a variety of platforms. Justdial has extensive competence across the country, due to a robust and widespread sales team, years of experience, and in-depth local market knowledge. Just dial staff are given various opportunities and challenging assignments, which encourage them to learn and improve.”
“Just Dial Limited是印度第一的本地搜索引擎,通过多种平台为全国消费者提供本地搜索相关服务。由于强大而广泛的销售团队、多年的经验和深入的本地市场知识,Justdial在全国拥有广泛的能力。Just dial员工获得各种机会和挑战性任务,这鼓励他们学习和进步。”
439. What is the salary for freshers in Justdial?
Justdial新人的薪水是多少?
- 知识点: 其他/未分类 (标签: interviewbit, justdial, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Justdial
- id: 69b37b8158d557c902bb1458 | 官方: 否 | 付费: 否
答案:
As per Payscale, the average salary for freshers ranges between 5 to 6 lakhs per annum.
根据Payscale数据,新人的平均薪水介于每年5到6万卢比之间。
440. How long is the Interview Process at Justdial?
Justdial的面试流程有多长?
- 知识点: 其他/未分类 (标签: interviewbit, justdial, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Justdial
- id: 69b37b8158d557c902bb145b | 官方: 否 | 付费: 否
答案:
The whole process generally takes more than 1 week . The interview should last approximately an hour and a half, with the test being roughly 30-90 minutes. Telephonic interviews, technical interviews, and HR interviews are just a few types of interviews you could encounter. As a result, the length of your interview will most likely be determined by the format and where you are in the process.
整个过程通常需要超过一周时间。面试大约持续一个半小时,测试大约为30至90分钟。电话面试、技术面试和人力资源面试只是你可能遇到的几种面试类型。因此,你面试的时长很可能取决于面试的形式以及你在流程中所处的阶段。
441. What is the Eligibility Criteria at JustDial for Software engineers?
JustDial软件工程师的资格标准是什么?
- 知识点: 其他/未分类 (标签: interviewbit, justdial, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Justdial
- id: 69b37b8158d557c902bb145e | 官方: 否 | 付费: 否
答案:
The candidate must have a BE/B. Tech in CSE, IT, or ECE with a 60 per cent or 6.5 GPA or higher throughout without any running backlogs.
候选人必须拥有CSE、IT或ECE专业的BE/B.Tech学位,且整个学习期间成绩达到60%或GPA 6.5以上,不得有任何未通过的课程。
442. What do you know about RDBMS? What are the advantages and disadvantages of using RDBMS?
你对RDBMS了解多少?使用RDBMS的优点和缺点是什么?
- 知识点: 其他/未分类 (标签: interviewbit, lti, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: LTIMindtree
- id: 69b37b8b58d557c902bb1cfa | 官方: 否 | 付费: 否
答案:
RDBMS is an acronym for Relational DataBase Management Systems . It's an application that lets us build, remove, and update relational databases. A relational database is a database system that stores and retrieves data in the form of rows and columns in a tabular format. It is a minor subset of DBMS that was created in the 1970s by E.F Codd. The major DBMS, such as SQL, My-SQL, and ORACLE, are all based on relational DBMS concepts.
RDBMS是关系数据库管理系统的缩写。它是一个让我们能够构建、删除和更新关系数据库的应用程序。关系数据库是一种以表格形式存储和检索数据的数据库系统,其中数据以行列形式组织。它是DBMS的一个小子集,由E.F.科德于20世纪70年代创建。主要的DBMS,如SQL、My-SQL和ORACLE,都基于关系数据库管理系统的概念。
The following features are simulated by Relational Database Management Systems to maintain data integrity: - Entity Integrity: No two records of a database table can be completely duplicated.
关系数据库管理系统模拟以下功能以维护数据完整性:- 实体完整性:数据库表中不能有两条记录完全重复。
- Referential Integrity: Only those rows of those tables that are not used by other tables can be erased. Otherwise, data discrepancy may result.
- User-defined Integrity: Rules based on confidentiality and access that are established by the users.
Domain integrity: The database tables' columns are contained inside certain specified limits based on default values, data types, or ranges.
The following are the advantages of an RDMS: - Simple to manage: Each table can be modified independently without impacting the others. It offers logical database independence i.e. data can be viewed in different ways by the different users.RDBMS的优点如下:- 易于管理:每个表可以独立修改,不影响其他表。它提供逻辑数据库独立性,即不同用户可以以不同方式查看数据。
- Secured: It is more secure since it has numerous levels of security. Access to shared data might be restricted.
- Flexible: Data may be updated at a single location without having to make changes to many files. It limits redundancy and replication of the data. Databases can be simply expanded to accommodate additional records, increasing scalability. It also makes it easier to use SQL queries.
- Users: RDBMS can store many users in a client-side architecture.
- Allows enormous amounts of data to be stored and retrieved with ease.
- Simple Data Handling: The relational architecture allows for faster data retrieval. Due to keys, indexes, and normalisation principles, data redundancy or duplication is avoided. Because RDBMS is built on ACID principles for data transactions, data consistency is ensured (Atomicity Consistency Isolation Durability).
Tolerance for Failures: Database replication allows for simultaneous access and aids in system recovery in the event of disasters such as power outages or unexpected shutdowns.
The following are the disadvantages of an RDMS: - High Cost and Extensive Hardware and Software Support: To make these systems work, huge budgets and setups are necessary.RDBMS的缺点如下:- 高成本以及广泛的硬件和软件支持:要使这些系统运行,需要巨大的预算和设置。
- Scalability: As more data is added, more servers, as well as more power and memory, are necessary.
- Complexity: Large amounts of data complicate understanding of relationships and may reduce performance.
- Structured Limits: A relational database system's fields or columns are surrounded by various limits, which can lead to data loss. It is difficult to recover the lost data.
443. What is the difference between functions and procedures in the context of computer programming?
在计算机编程中,函数和过程有什么区别?
- 知识点: 其他/未分类 (标签: interviewbit, lti, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: LTIMindtree
- id: 69b37b8b58d557c902bb1d06 | 官方: 否 | 付费: 否
答案:
- Function: One of the most fundamental concepts in computer programming is function. It's used to compute anything based on a set of inputs. User-defined or pre-defined functions are also possible. A block of code in the function program performs certain duties or functions.
- Procedure: A procedure is a set of instructions or commands used in computer programming. It is referred to as a procedure, subroutine, function, or subprogram depending on the programming language. For example, in SQL both function and procedures are distinct concepts.
The following table lists the differences between functions and procedures:
下表列出了函数和过程之间的区别:
| Function 函数 | Procedure 过程 |
|---|---|
| A function is a type of equation that is used to calculate anything from a set of inputs. As a result, it got its name from Mathematics. 函数是一种类型的方程,用于从一组输入中计算任何内容。因此,它的名称来源于数学。 | A procedure is a collection of commands that are executed in a specific order. 过程是一组按特定顺序执行的命令的集合。 |
| In SQL, a procedure can invoke a function. 在SQL中,过程可以调用函数。 | A function, on the other hand, cannot invoke a procedure in SQL. 另一方面,函数在SQL中不能调用过程。 |
| We can't use DML (Data manipulation language) commands like Insert, Delete, or Update inside a SQL function. 我们不能在SQL函数中使用像Insert、Delete或Update这样的DML(数据操作语言)命令。 | DML instructions can be used inside the procedure in SQL. DML指令可以在SQL中的过程内部使用。 |
| SQL queries can call functions. SQL查询可以调用函数。 | Procedures, however, cannot be accessed via a SQL query. 然而,过程不能通过SQL查询访问。 |
| When functions are called, they are compiled each time. 函数被调用时,每次都会被编译。 | Procedures, on the other hand, are only compiled once and can be called as many times as needed without having to be compiled each time. 另一方面,过程只编译一次,可以按需多次调用,而无需每次重新编译。 |
| A function's return statement returns the control and result value to the calling code. 函数的return语句将控制和结果值返回给调用代码。 | The procedure's return statement returns control to the calling code, it cannot return the result value. 过程的return语句将控制权返回给调用代码,但不能返回结果值。 |
| Explicit transaction handles are not supported by the function. 函数不支持显式事务句柄。 | Explicit transaction handles are supported by the procedure. 过程支持显式事务句柄。 |
| The SELECT statement can be used to work on functions. 可以使用SELECT语句来处理函数。 | It is not possible to use it in a SELECT statement. 在SELECT语句中不能使用它。 |
444. What is the LTI Eligibility Criteria?
LTI的资格标准是什么?
- 知识点: 其他/未分类 (标签: interviewbit, lti, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: LTIMindtree
- id: 69b37b8c58d557c902bb1d3e | 官方: 否 | 付费: 否
答案:
The eligibility criteria for LTI fresher recruitment generally includes the following: - The candidate must be enrolled in the Bachelors Of Engineering (BE) or Bachelors Of Technology (Btech) degree curriculum.
LTI应届生招聘的资格标准通常包括以下内容:- 候选人必须就读于工程学士(BE)或技术学士(Btech)学位课程。
- There must not be any active backlogs.
- The candidate must have an average of 60% or more in his/her academic performance or an equivalent CGPA.
- All the final semester subjects must be cleared in the first attempt and there must not be any arrears in the final semester.
445. How do you introduce yourself in an interview?
在面试中你如何自我介绍?
- 知识点: 其他/未分类 (标签: interviewbit, lti, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: LTIMindtree
- id: 69b37b8c58d557c902bb1d41 | 官方: 否 | 付费: 否
答案:
You will need to introduce yourself in every interview. This lets the interviewer know a brief about you. Interviewers also assess you while you speak. So, you must be confident while you introduce yourself. The introduction should include your name, the place where you are residing currently, the college you are in and the degree you are pursuing, what have been your interests throughout your college years and lastly you can also include what are your hobbies. Make sure that you do not elongate your introduction unnecessarily. The introduction should be short, crisp and to the point.
你需要在每次面试中介绍自己。这能让面试官简要了解你。面试官也会在你说话时评估你。所以,你在自我介绍时必须自信。介绍应包括你的姓名、目前居住地、就读的大学和攻读的学位、大学期间的兴趣爱好,最后也可以包括你的业余爱好。确保不要不必要地拉长介绍。介绍应简短、精炼且切中要点。
A sample introduction could be as “Hi. My name is XYZ. I am from Kolkata, West Bengal. I am currently an Xth year undergraduate pursuing Bachelors Of Engineering in Information Technology from Jadavpur University. Throughout my college years, I have been passionate about competitive programming and web development. I have been actively participating in competitive programming contests. I have also done some technical internships in the past.. That's a brief about me. I would like to know about you as well.”
一个示例介绍可以是:“你好。我叫XYZ。我来自西孟加拉邦的加尔各答。我目前是本科生,大X,在贾达普大学攻读信息技术工程学士。在整个大学期间,我一直热衷于竞争性编程和网页开发。我积极参加竞争性编程比赛。过去我也做过一些技术实习。这是关于我的简要介绍。我也想了解一下你。”
446. Why do you want to join LTI?
你为什么想加入LTI?
- 知识点: 其他/未分类 (标签: interviewbit, lti, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: LTIMindtree
- id: 69b37b8c58d557c902bb1d44 | 官方: 否 | 付费: 否
答案:
This is a behavioural-based question. Here the interviewer wants to assess your interests and your motive to join the company. You should clearly state what motivates you to join this particular company. This could include the work culture of the company, the technologies on which the company works and so on.
这是一个基于行为的问题。在这里,面试官想评估你的兴趣和加入公司的动机。你应该清楚说明是什么促使你加入这家特定公司。这可能包括公司的企业文化、公司所涉及的技术等等。
A sample answer to this could be: “LTI is one of the leading private organisations that is contributing to India’s development. I have heard from my seniors that LTI uses a vast variety of advanced technologies in their work. I strongly believe that joining LTI as a software engineer will help me to upskill myself and I would experience a steep learning curve if I got this opportunity.”
一个示例回答可以是:“LTI是印度领先的私营组织之一,为印度的发展做出了贡献。我从学长那里听说LTI在工作中使用了大量先进技术。我坚信,作为一名软件工程师加入LTI将帮助我提升技能,如果我有这个机会,我将经历陡峭的学习曲线。”
447. How many rounds in LTI are for the experienced?
LTI面试对于有经验者有几轮?
- 知识点: 其他/未分类 (标签: interviewbit, lti, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: LTIMindtree
- id: 69b37b8c58d557c902bb1d47 | 官方: 否 | 付费: 否
答案:
There are generally three rounds of assessments for the job role of a software engineer at LTI. These assessments include the following:
对于LTI的软件工程师职位,通常有三轮评估。这些评估包括以下内容:
Online Assessment. 2. Technical Interview Round. 3. HR Interview Round.
- 在线评估。 2. 技术面试轮。 3. HR面试轮。
448. Is LTI technical interview easy?
LTI的技术面试容易吗?
- 知识点: 其他/未分类 (标签: interviewbit, lti, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: LTIMindtree
- id: 69b37b8c58d557c902bb1d4a | 官方: 否 | 付费: 否
答案:
Technical Interviews at LTI are relatively easy as compared to other companies. Generally, candidates are required to undergo only 1 round of technical interviews which is generally not the case with other companies. That being said, one should not take an interview at LTI lightly. Only when you have the right preparation and guidance you will be able to crack the interviews.
与其他公司相比,LTI的技术面试相对容易。通常,候选人只需进行一轮技术面试,而其他公司通常不止一轮。话虽如此,也不能轻视LTI的面试。只有当你有了正确的准备和指导,你才能通过面试。
Coding Problems
0/2
Easy Problems
简单问题
Time Complexity
时间复杂度
Strings
字符串
Extracting Numbers
提取数字
Very Easy
非常简单
27.37 Mins
27.37 分钟
Solve
解答
Palindromic Words
回文单词
Very Easy
非常简单
21.30 Mins
21.30 分钟
Solve
解答
0/2
Intermediate Problems
中级问题
Two Pointers
双指针
Dynamic Programming
动态规划
Palindrome Numbers
回文数字
Medium
中等
33.4 Mins
33.4分钟
Solve
解答
Palindromic Substrings
回文子串
Medium
中等
26.31 Mins
26.31分钟
Solve
解答
449. Partition a string s in such a way that each of its substrings is a palindrome. Return the minimal cuts required to split s into palindromes.
以这样的方式分割字符串s,使得其每个子串都是回文。返回将s分割成回文所需的最小切割次数。
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc758d557c902bb453c | 官方: 否 | 付费: 否
答案:
Example 1: - Input: s = "aab"
示例1: - 输入:s = "aab"
- Output: 1
Explanation: The palindrome partitioning ["aa","b"] could be produced using 1 cut.
Example 2: - Input: s = "a"示例 2:- 输入:s = "a"
Output: 0
Example 3: - Input: s = "ab"示例 3:- 输入:s = "ab"
Output: 1
Solution: A palindrome is any substring that shares the same centre as a palindrome. If s is a palindrome and letter c serves as the centre, then s[c-k,..,c,...,c+k] must also be a palindrome. Finding every palindrome with the last character I and calculating the new minimum number partition at I is all that is necessary to determine the minimum number partition at I if we know the minimum number of partition for s[0,...,i-1].解法:回文是任何与回文共享相同中心的子串。如果 s 是回文且字母 c 作为中心,那么 s[c-k,..,c,...,c+k] 也必须是回文。如果已知 s[0,...,i-1] 的最小分割数,则找到所有以最后一个字符 I 结尾的回文并计算在 I 处的新最小分割数就足以确定 I 处的最小分割数。
class Solution {
class Solution {
public:
public:
int minCut(string s) {
int minCut(string s) {
// if there is only one character in string, then it is already a palindrome, so, return 0
// 如果字符串中只有一个字符,那么它已经是回文,所以返回 0
if(s.length()==1)return 0;
if(s.length()==1)return 0;
//now, we need to check different sub-strings whether they are pallindrome or not, so, it will be better if we store it somewhere for all substrings and that too in optimized way
// 现在,我们需要检查不同的子串是否为回文,所以最好将所有子串的结果以优化方式存储在某处
// let row number will represent starting index of that particular substring
// 让行号表示该特定子串的起始索引
// & column number will represent ending index of that particular substring
// 列号表示该特定子串的结束索引
int *isPallindrome[s.length()];
int *isPallindrome[s.length()];
for(int i=0;i<s.length();i++)isPallindrome[i]=new int[s.length()];
for(int i=0;i<s.length();i++)isPallindrome[i]=new int[s.length()];
// now, substring with same starting and ending index i.e. only one character in it, will be a pallindrome for sure
// 现在,起始索引和结束索引相同的子串(即只包含一个字符)必定是回文
for(int i=0;i<s.length();i++)isPallindromei=true;
for(int i=0;i<s.length();i++)isPallindromei=true;
// and substrings with two elements will be pallindrome if both starting and ending element of that substring are same
// 而包含两个元素的子串,如果该子串的起始元素和结束元素相同,则它是回文
for(int i=0;i<s.length()-1;i++)isPallindromei=(s[i]==s[i+1]);
for(int i=0;i<s.length()-1;i++)isPallindromei=(s[i]==s[i+1]);
// now, one thing comes to mind, why we are filling diagonally?
// 现在,有一点浮现在脑海中,为什么我们要按对角线填充?
// it is because we can minimise our number of operations to check whether a substring is pallindrome or not if we have answer for it subparts already
// 这是因为如果我们已经有了子问题的答案,就可以最小化检查子字符串是否为回文所需的操作次数
for(int gap=2;gap<s.length();gap++){
for(int gap=2;gap<s.length();gap++){
for(int i=0;i<(s.length()-gap);i++){
for(int i=0;i<(s.length()-gap);i++){
int j=gap+i;
int j=gap+i;
// in this way, we only need to check if starting and ending index elements are equal or not
// 这样,我们只需要检查起始和结束索引的元素是否相等
//& if they are equal, we can check if the remaining substring (other than starting and ending index chars) is pallindrome or not in O(1) because we have already computed for that
// 如果它们相等,我们可以检查剩余子字符串(除去起始和结束索引字符)是否为回文,这可以在O(1)时间内完成,因为我们已经计算过了
// that's why we are traversing diagonally
// 这就是我们按对角线遍历的原因
if(s[i]==s[j] && isPallindromei+1)isPallindromei=true;
if(s[i]==s[j] && isPallindromei+1)isPallindromei=true;
else isPallindromei=false;
else isPallindromei=false;
}
}
// now, we will come to the part of calculating minimum number of cuts required
// 现在,我们将进入计算所需最小切割次数的部分
// here dp[i] will store minimum number of cuts required if only chars from 0 to i are present
// 这里dp[i]将存储当只有从0到i的字符存在时所需的最小切割次数
int *dp=new int[s.length()];
int *dp=new int[s.length()];
// if only one char is there, then minimum number of cuts required will be 0
// 如果只有一个字符,那么所需的最小切割次数将是0
dp[0]=0;
dp[0]=0;
// now we are going to calculate for i and we have answers for 0 to i-1 already
// 现在我们计算 i,并且已经有 0 到 i-1 的答案
//so, we will be using that information
// 所以,我们将利用这些信息
for(int i=1;i<s.length();i++){
for(int i=1;i<s.length();i++){
// if chars from 0 to i makes a pallindrome, then no cut is required for that i
// 如果从 0 到 i 的字符构成回文,那么对于 i 不需要切割
if(isPallindrome0)dp[i]=0;
if(isPallindrome0)dp[i]=0;
else{
否则{
//otherwise, let minimum cuts required is mcr=INT_MAX
// 否则,令最小切割次数所需为 mcr=INT_MAX
int mcr=INT_MAX;
int mcr=INT_MAX;
//now we will try making cut before all elements in our current substring
// 现在我们尝试在当前子串中所有元素之前进行切割
//and since we already have answer for left portion of cut(that we can get from dp[]
// 既然我们已经有了切割左部分的答案(可以从 dp[] 得到)
//so, we just need to consider the case when right portion is pallindrome(that we can check from isPallindrome[][])
// 所以,我们只需要考虑右部分是回文的情况(可以从 isPallindrome[][] 检查)
for(int cutBefore=i;cutBefore>0;cutBefore--){
for(int cutBefore=i;cutBefore>0;cutBefore--){
//cutBefore is starting index of right portion and i is ending index of right portion
// cutBefore 是右部分的起始索引,i 是右部分的结束索引
if(isPallindromecutBefore)mcr=min(mcr,dp[cutBefore-1]);
if(isPallindromecutBefore)mcr=min(mcr,dp[cutBefore-1]);
}
// till now, mcr will e storing minimum cuts required for left portion
// 到目前为止,mcr 将存储左部分所需的最小切割次数
// and right portion is considered pallindrome as discussed
// 并且右部分被认为是回文,如前面讨论的
//therefore, our answer will be mcr+1 because that on cut is required to make that left and right portion
//因此,我们的答案将是mcr+1,因为需要那次切割来形成左右两部分
dp[i]=mcr+1;
dp[i]=mcr+1;
}
}
return dp[s.length()-1];
return dp[s.length()-1];
}
};
Useful Interview Resources
有用的面试资源
- HR Interview Questions
- Free Mock Coding Interview
- Coding Interview Questions for Practice
- Technical Interview Questions for Practice
- Interview Preparation
450. You are given an integer array digits as shown, where each digit of the integers represented by an integer value. The digits are from most significant to least significant in left-to-right order.
给定一个整数数组digits,其中每个整数的数字由一个整数值表示。数字在从左到右的顺序中从最高有效位到最低有效位排列。
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc758d557c902bb453f | 官方: 否 | 付费: 否
答案:
There are no leading 0's in the large integer. Increment it by one and return the array of digits.
大整数中没有前导0。将其加1并返回数字数组。
Example 1: - Input: digits = [1,2,3]
示例1:- 输入:digits = [1,2,3]
- Output: [1,2,4]
Explanation:
The array represents the integer 123.该数组表示整数123。
Incrementing by one gives 123 + 1 = 124.
加1得到123 + 1 = 124。
Thus, the result should be [1,2,4].
因此,结果应为[1,2,4]。
Example 2: - Input: digits = [4,3,2,1]
示例2:- 输入:digits = [4,3,2,1]
- Output: [4,3,2,2]
Explanation:
The array represents the integer 4321.该数组表示整数4321。
Incrementing by one gives 4321 + 1 = 4322.
加1得到4321 + 1 = 4322。
Thus, the result should be [4,3,2,2].
因此,结果应为[4,3,2,2]。
Example 3: - Input: digits = [9]
示例3:- 输入:digits = [9]
- Output: [1,0]
Explanation:
The array represents the integer 9.该数组表示整数9。
Incrementing by one gives 9 + 1 = 10.
每次加一得到 9 + 1 = 10。
Thus, the result should be [1,0].
因此,结果应为 [1,0]。
Solution
解决方案
To increase the value of the last index by one, we need to reverse the string and then deal with the carry separately. To reverse the string, we can simply reverse the string. In this case, we can simply make the first index 0 and check the next index. If the next index is also 9, we add one to it until we come across an index with a value other than 9. Increase that value by one. In the case where there are no more than nine indices, we have dealt with it by pushing 1 at the end. Reverse the string again.
要将最后一个索引的值加一,我们需要反转字符串,然后单独处理进位。要反转字符串,我们可以直接反转字符串。在这种情况下,我们可以简单地将第一个索引设为 0,然后检查下一个索引。如果下一个索引也是 9,则在遇到值不为 9 的索引之前,一直对其加一。将该值增加一。在索引不超过九个的情况下,我们通过在末尾推入 1 来处理。再次反转字符串。
class Solution {
class Solution {
public:
public:
vectorplusOne(vector & digits) {
vectorplusOne(vector & digits) {
int n=digits.size();
int n=digits.size();
if(digits[n-1]!=9)digits[n-1]+=1; //Case when last index not 9
if(digits[n-1]!=9)digits[n-1]+=1; //当最后一个索引不是 9 时的情况
else{ //Case when last index is 9
else{ //当最后一个索引是 9 时的情况
reverse(digits.begin(),digits.end());
反转(digits.begin(),digits.end());
int i=0;
int i=0;
while(i<=n){
while(i<=n){
if(i==n){digits.push_back(1); //Case when no index has value other than 9.
if(i==n){digits.push_back(1); //当没有索引值不是 9 时的情况。
break;
break;
}
if(digits[i]==9)digits[i]=0,i++;
if(digits[i]==9)digits[i]=0,i++;
else{
否则{
digits[i]++; //Case when some index has value other than 9.
digits[i]++; // 当某个索引处的值不为9时的情况。
break;
break;
}
}
reverse(digits.begin(),digits.end());
反转(digits.begin(),digits.end());
return digits;
返回digits;
}
return digits;
返回digits;
}
};
451. Determine how much water a given set of n non-negative integers representing an elevation map, where each bar's width is 1, can hold after a rainstorm.
确定给定的一组n个非负整数(代表海拔地图,每个柱子的宽度为1)在暴雨后能蓄积多少水。
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc758d557c902bb4551 | 官方: 否 | 付费: 否
答案:
Example 1:
示例1:
- Input: height = [0,1,0,2,1,0,1,3,2,1,2,1]
- Output: 6
- Explanation: The above elevation map (black section) is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain water (blue section) are being trapped.
Example 2:
示例2:
- Input: height = [4,2,0,3,2,5]
- Output: 9
Solution:
解决方案:
The basic goal is to calculate the total volume of water held above each structure. To perform se, we must identify the buildings on either side of a structure with the maximum height. as in [3, 0, 0, 2, 4] In this instance, the heights of the building with height 3 (the tallest structure to the left of building 2) and building with height 4 determine how much water is present above building with height 2. (i.e the heightest building to the right of 2). Maintaining two arrays to hold the maximum heights of the right and left components is the basic principle. The purpose is served by the arrays with the names maxl and maxr in the solution. Now, to get the volume of water on top of a building, we must first determine the minimum height difference between the structures on the left and right, then deduct that value from the height of the present structure. The quantity of water held beyond 2 is (3 - 2 = 1) since in the instance of 2, the minimum value between 3 and 4 is 3. This result may be saved in another array, and the total of all the items can then be returned.
基本目标是计算每个结构上方蓄积水的总体积。为此,我们必须识别每个结构两侧高度最大的建筑物。如[3, 0, 0, 2, 4]在此实例中,高度为3的建筑(高度为2的建筑左侧最高的结构)和高度为4的建筑决定了高度为2的建筑上方蓄积的水量。(即2右侧最高的建筑)。维护两个数组来保存左侧和右侧组成部分的最大高度是基本原则。解决方案中名为maxl和maxr的数组就起到了这个作用。现在,要获取建筑物顶部的水的体积,我们必须首先确定左右两侧结构之间的最小高度差,然后从当前结构的高度中扣除该值。在2的实例中,3和4之间的最小值为3,因此2上方蓄积的水量为(3 - 2 = 1)。这个结果可以保存在另一个数组中,然后可以返回所有项的总和。
class Solution {
class Solution {
public:
public:
int trap(vector& height) {
int trap(vector& height) {
int trappedWater = 0; // Initialize trappedWater with "0"
int trappedWater = 0; // 将trappedWater初始化为“0”
int leftMaxHeight = 0, rightMaxHeight = 0; // Initialize leftMaxHeight and rightMaxHeight with "0"
int leftMaxHeight = 0, rightMaxHeight = 0; // 将leftMaxHeight和rightMaxHeight初始化为“0”
int left = 0, right = height.size() - 1; // Initialize left with "0" and right with "size of height array".
int left = 0, right = height.size() - 1; // 用“0”初始化left,用“height数组的大小”初始化right。
// Loop until Left <= right
// 循环直到left <= right
while (left <= right)
while (left <= right)
{
// If the height[left] < height[right] then update LeftMaxHeight/TrappedWater from Left side
// 如果height[left] < height[right],则从左侧更新leftMaxHeight/困水
if (height[left] < height[right])
if (height[left] < height[right])
{
if (height[left] > leftMaxHeight)
if (height[left] > leftMaxHeight)
leftMaxHeight = height[left];
leftMaxHeight = height[left];
else
else
trappedWater += leftMaxHeight - height[left];
trappedWater += leftMaxHeight - height[left];
left += 1;
left += 1;
}
else // If height[right] > height[left] then will update rightMaxHeight and trappedWater
else // 如果height[right] > height[left],则更新rightMaxHeight和困水
{
if (height[right] > rightMaxHeight)
if (height[right] > rightMaxHeight)
rightMaxHeight = height[right];
rightMaxHeight = height[right];
else
else
trappedWater += rightMaxHeight - height[right];
trappedWater += rightMaxHeight - height[right];
right -= 1;
right -= 1;
}
}
return trappedWater; // return Trapped Water
返回 trappedWater; // 返回收集的雨水
}
};
452. An array of prices is provided to you, where prices[i] represents the price of a certain stock on the ith day. Determine the highest profit you can make. You can only execute two transactions at once.
给你一个价格数组,其中 prices[i] 表示第 i 天某只股票的价格。确定你能获得的最高利润。你一次只能执行两笔交易。
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc758d557c902bb4557 | 官方: 否 | 付费: 否
答案:
Note: You may not do more than one transaction at once (i.e., you must sell the stock before you buy again).
注意:你不能同时进行多笔交易(即,你必须先卖出股票才能再次买入)。
Example 1: - Input: prices = [3,3,5,0,0,3,1,4]
示例 1: - 输入:prices = [3,3,5,0,0,3,1,4]
- Output: 6
Explanation: Buy on day 4 (price = 0) and sell on day 6 (price = 3), profit = 3-0 = 3.Then buy on day 7 (price = 1) and sell on day 8 (price = 4), profit = 4-1 = 3.
Example 2: - Input: prices = [1,2,3,4,5]示例 2: - 输入:prices = [1,2,3,4,5]
- Output: 4
Explanation: Buy on day 1 (price = 1) and sell on day 5 (price = 5), profit = 5-1 = 4.Note that you cannot buy on day 1, buy on day 2 and sell them later, as you are engaging multiple transactions at the same time. You must sell before buying again.
Example 3: - Input: prices = [7,6,4,3,1]示例 3: - 输入:prices = [7,6,4,3,1]
- Output: 0
Explanation: In this case, no transaction is done, i.e. max profit = 0.
Solution:解决方案:
In the future, we want to determine the highest profit if we have 1, 2, 3, and 2. (buy then sell). Additionally, we're looking for the best moving-back profit (sell then buy). A forward array and a reverse array are the results. - Future maximum profit range: 0. 1 2 2 4.
在未来,我们要确定如果我们有 1、2、3 和 2 时的最高利润(买入然后卖出)。此外,我们还在寻找最佳的回移利润(卖出然后买入)。前向数组和后向数组就是结果。- 未来最大利润范围:0. 1 2 2 4.
Maximum profit array in reverse: 4 3 3 3 0.
Recall that each array represents the maximum profit cumulatively. You can only benefit from the backwards array after locking in the profit from the front array since you can only purchase after you've sold.回想一下,每个数组代表累积的最大利润。你只有在锁定前向数组的利润之后,才能从后向数组中获益,因为你只有卖出后才能买入。
In other words, the maximum of forwardArray[i - 1] + backWardsArray[i] will be your maximum profit; This means that in the case above, our maximum possible profit array is 3 4 5 2, and our maximum profit in that array is 5.
换句话说,forwardArray[i - 1] + backWardsArray[i] 的最大值就是你的最大利润;这意味着在上述情况下,我们的最大可能利润数组是 3 4 5 2,而该数组中的最大利润是 5。
The formulas ForwardArray[0] + BackwardsArray[1], and ForwardArray[1] + BackwardsArray[2] were used to generate this array.
公式 ForwardArray[0] + BackwardsArray[1] 和 ForwardArray[1] + BackwardsArray[2] 被用来生成此数组。
Additionally, there is a rare circumstance in which the profit on the forward array is significantly greater than on the backwards array. Consider the following two arrays, which are oriented forward and backward. - In the future: 0 1 2 20 1
此外,还有一种罕见情况,即前向数组的利润显著大于后向数组。考虑下面两个分别朝前和朝后的数组。- 在未来:0 1 2 20 1
In reverse: 0 0 5 0 0 0
In this instance, there is no benefit to doing F[i-1] + B[i] since the profit point of the forward array (20 > 7) outweighs that of any possible forward and backward combination. So, we merely make a single purchase and sale, earning $20.在这种实例中,执行 F[i-1] + B[i] 没有好处,因为前向数组的利润点(20 > 7)超过了任何可能的前向和后向组合的利润。所以,我们只需进行一次买卖,赚取 20 美元。
int maxProfit(vector
int maxProfit(vector& prices) {
if (prices.size() == 1) return 0;
if (prices.size() == 1) return 0;
int n = prices.size();
int n = prices.size();
vectorfirst_buy_and_sell(prices.size(), 0);
vectorfirst_buy_and_sell(prices.size(), 0);
int min_price_so_far = numeric_limits
int min_price_so_far = numeric_limits::max();
int first_buy_profit{};
int first_buy_profit{};
for (int i{}; i < n; i++) {
for (int i{}; i < n; i++) {
min_price_so_far = min(min_price_so_far, prices[i]);
min_price_so_far = min(min_price_so_far, prices[i]);
first_buy_profit = max(first_buy_profit, prices[i] - min_price_so_far);
first_buy_profit = max(first_buy_profit, prices[i] - min_price_so_far);
first_buy_and_sell[i] = first_buy_profit;
first_buy_and_sell[i] = first_buy_profit;
} // Find the maximum profit going forward, and keep a copy of it
} // 向前寻找最大利润,并保存其副本
int max_price_so_far = numeric_limits
int max_price_so_far = numeric_limits::min();
int max_profit{};
int max_profit{};
for (int i = n - 1; i > 0; i--) {
for (int i = n - 1; i > 0; i--) {
max_price_so_far = max(prices[i], max_price_so_far);
max_price_so_far = max(prices[i], max_price_so_far);
max_profit = max(first_buy_and_sell[i],max(max_profit, max_price_so_far - prices[i] + first_buy_and_sell[i - 1]));
max_profit = max(first_buy_and_sell[i],max(max_profit, max_price_so_far - prices[i] + first_buy_and_sell[i - 1]));
} // We use two max functions above to account for the edge case detailed above.
} // 我们使用两个max函数来处理上述的边界情况。
return max_profit;
return max_profit;
}
Successful Tech Career for FREE!
免费开启成功的科技职业生涯!
Successful Tech Career!
成功的技术职业生涯!
Interview Process
面试流程
CTC & Designation
CTC与职位级别
Projects on the Job
工作项目
Referral System
推荐系统
Try It Out
试试看
2 Lakh+ Roadmaps Created
已生成20万+职业规划
453. What are the advantages of multi-programming, and what is it?
多道程序设计的优点是什么,它是什么?
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: MAQ Software
- id: 69b37bc758d557c902bb455a | 官方: 否 | 付费: 否
答案:
An operating system that allows multiple programmes to run on one CPU is known as a multiprogramming operating system. You can discuss key differences between a multiprogramming OS and other systems by highlighting key differences in terms of operation. When you describe a scenario in which you used multi-programming to benefit from its advantages, you can show your understanding of a system that might be important to the interviewer.
允许多个程序在一个CPU上运行的操作系统被称为多道程序设计操作系统。你可以通过强调操作上的关键差异,来讨论多道程序设计操作系统与其他系统的主要区别。当你描述一个你利用多程序设计优势的场景时,你可以展示对系统理解,这可能对面试官很重要。
454. Rotate the array by k steps to the right, considering the array as non-negative.
将数组向右旋转k步,并将数组视为非负数。
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc758d557c902bb4560 | 官方: 否 | 付费: 否
答案:
Example 1: - Input: nums = [1,2,3,4,5,6,7], k = 3
示例1:- 输入:nums = [1,2,3,4,5,6,7],k = 3
Output: [5,6,7,1,2,3,4]
Explanation:说明:
rotate 1 steps to the right: [7,1,2,3,4,5,6] rotate 2 steps to the right: [6,7,1,2,3,4,5] rotate 3 steps to the right: [5,6,7,1,2,3,4]
向右旋转1步:[7,1,2,3,4,5,6] 向右旋转2步:[6,7,1,2,3,4,5] 向右旋转3步:[5,6,7,1,2,3,4]
Example 2: - Input: nums = [-1,-100,3,99], k = 2
示例2: - 输入:nums = [-1,-100,3,99],k = 2
Output: [3,99,-1,-100]
Explanation:说明:
rotate 1 steps to the right: [99,-1,-100,3] rotate 2 steps to the right: [3,99,-1,-100]
向右旋转1步:[99,-1,-100,3] 向右旋转2步:[3,99,-1,-100]
Solution:
解决方案:
In the beginning, start with zero and place it in its correct position, then place the original element at x in its correct position. This process will naturally end at the place you started. We must create a sequential order for all the elements. We may obviously put all the elements into a line until we reach the number n.
一开始,从零开始并将其放到正确的位置,然后将x处的原始元素放到其正确的位置。这个过程会自然地在您开始的地方结束。我们必须为所有元素创建一个顺序。显然,我们可以将所有元素排列成一行,直到达到数字n。
public void rotate(int[] a, int k) {
public void rotate(int[] a, int k) {
int n = a.length, count = 0;
int n = a.length, count = 0;
for(int i=0; count < n; i++){
for(int i=0; count < n; i++){
int j = i, tmp = a[j];
int j = i, tmp = a[j];
do{
do{
int hold = a[ (j+k) % n];
int hold = a[ (j+k) % n];
a[ (j+k) % n] = tmp;
a[ (j+k) % n] = tmp;
++count;
++count;
tmp = hold;
tmp = hold;
j = (j+k) % n;
j = (j+k) % n;
}while(j != i);
} while(j != i);
}
}
455. We want to sort the arrays nums in-place so that objects of the same colour are adjacent, with the colours in order red, white, and blue.
我们希望原地对数组 nums 进行排序,使相同颜色的对象相邻,且按红、白、蓝的顺序排列。
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc758d557c902bb4566 | 官方: 否 | 付费: 否
答案:
To solve this problem, you must use the integers 0, 1, and 2 to represent the colours red, white, and blue, respectively.
要解决此问题,你必须分别使用整数 0、1 和 2 来表示红、白、蓝三种颜色。
Example 1: - Input: nums = [2,0,2,1,1,0]
示例 1: - 输入:nums = [2,0,2,1,1,0]
Output: [0,0,1,1,2,2]
Example 2: - Input: nums = [2,0,1]示例 2: - 输入:nums = [2,0,1]
Output: [0,1,2]
Solution:解决方案:
Consider three-pointers low = 0, mid = 0, high = nums.size() - 1. The algorithm ensures that at any point, every element before low is 0, every element after high is 2, and every element in between are either 0, 1 or 2. That is, unprocessed. We will use mid to traverse and check the array elements in order that nums[mid] == 0 when nums[low] != 0 and nums[mid] != 1 and nums[mid]++ when mid++.
考虑三个指针:low = 0,mid = 0,high = nums.size() - 1。该算法确保在任何时刻,low 之前的每个元素都是 0,high 之后的每个元素都是 2,而两者之间的每个元素要么是 0、1 或 2,即未处理的。我们将使用 mid 来遍历并依次检查数组元素,当 nums[mid] == 0 且 nums[low] != 0 且 nums[mid] != 1 时,处理交换;当 mid++ 时。
class Solution {
class Solution {
public void sortColors(int[] nums)
public void sortColors(int[] nums)
{
int low=0,mid =0,high = nums.length-1;
int low=0,mid =0,high = nums.length-1;
int temp;
int temp;
while(mid<=high){
while(mid<=high){
if(nums[mid]==0)
if(nums[mid]==0)
{
temp=nums[low];
temp=nums[low];
nums[low]=nums[mid];
nums[low]=nums[mid];
nums[mid]=temp;
nums[mid]=temp;
low++;
low++;
mid++;
mid++;
}
else if(nums[mid]==1)
否则如果(nums[mid]==1)
{
mid++;
mid++;
}
else if(nums[mid]==2)
否则如果(nums[mid]==2)
{
temp=nums[mid];
临时变量=nums[mid];
nums[mid]=nums[high];
nums[mid]=nums[high];
nums[high]=temp;
nums[high]=临时变量;
high--;
high--;
}
}
}
}
456. What is BST? Give a real-life example.
什么是BST?给出一个现实生活中的例子。
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc758d557c902bb456c | 官方: 否 | 付费: 否
答案:
A self-balancing BST (like the AVL and Red-Black-Trees) keeps its height constant by balancing itself. These self-balancing BSTs maintain their heights as Log(n), which is O(log n). Other operations that become Log(n) include searching, inserting, deleting, flooring, Ceiling, Greater, and Lesser, among others. BST also allows data traversal in O(n) time.
自平衡二叉搜索树(如AVL树和红黑树)通过自我平衡保持其高度恒定。这些自平衡BST将其高度维持在Log(n),即O(log n)。其他变为Log(n)的操作包括搜索、插入、删除、向下取整、向上取整、较大值和较小值等。BST还允许以O(n)时间进行数据遍历。
A binary search tree is employed to maintain sorted streams of data. For example, we want to maintain the live data in sorted order of prices if we're getting online orders. We would like to know how many items were purchased at a certain cost at any given time. We would also like to know the maximum cost we are approaching. Using a self-balancing binary search tree, we can implement a priority queue with extractMin() or extractMax(). If we also support both extractMin() and extractMax(), we use a Self-Balancing Binary Search Tree to do both operations O(Log n). A list of the smallest elements on the right, the Smallest Greater Element on the right, and so on are all examples of problems where a self-balancing BST is suitable.
二叉搜索树用于维护有序的数据流。例如,如果我们收到在线订单,我们想按价格排序维护实时数据。我们想知道在任何给定时间以一定成本购买了多少商品。我们也想知道我们接近的最大成本。使用自平衡二叉搜索树,我们可以实现一个带有extractMin()或extractMax()的优先队列。如果我们还同时支持extractMin()和extractMax(),我们使用自平衡二叉搜索树以O(Log n)时间进行这两个操作。右侧最小元素列表、右侧最小更大的元素等,都是适合使用自平衡BST的问题示例。
457. What is Inheritance and what is its purpose of it?
什么是继承,它的目的是什么?
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc758d557c902bb4573 | 官方: 否 | 付费: 否
答案:
An object that can take on a set of characteristics from other classes of objects is called inheritance in object-oriented programming. These characteristics are commonly instance variables or member functions. A subclass is one that inherits these characteristics from its ancestor. A superclass is one that it inherited. It may also be the case that inheritance is implemented using code language features, but Simula was the first language to do so. Inheritance is used to consolidate and re-utilize code. For example, if the objects 'car,' 'truck,' and 'motorcycle' are subclasses of vehicle code can be consolidated into a vehicle superclass. The subclasses receive this code and any future modifications, automatically.
在面向对象编程中,一个对象能够从其他类对象中获取一组特性称为继承。这些特性通常是实例变量或成员函数。子类是从其祖先继承这些特性的类。超类是被继承的类。也可以使用代码语言特性来实现继承,但Simula是第一个这样做的语言。继承用于整合和重用代码。例如,如果对象“汽车”、“卡车”和“摩托车”是车辆的子类,代码可以整合到车辆超类中。子类自动接收此代码及任何未来的修改。
458. You have k eggs and n floors and you know that a floor f is low for 0 = f = n in which any egg dropped at a floor above f will break or one in which an egg dropped at or below f will not break.
你有k个鸡蛋和n层楼,并且你知道楼层f满足0 = f = n,在这个楼层之上掉落的鸡蛋会破碎,而在这个楼层或以下掉落的鸡蛋不会破碎。
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc758d557c902bb457f | 官方: 否 | 付费: 否
答案:
You may drop an unbroken egg from any floor (1 = x = n) whether it breaks or not. If it does, you cannot use it again. If it doesn't, you can reuse it in the future. Determine with certainty what floor f is by considering all its possible values of it.
你可以从任意楼层(1 = x = n)掉落一个未破碎的鸡蛋,无论它是否破碎。如果破碎了,你就不能再使用它。如果没有破碎,你可以将来重新使用它。通过考虑所有可能的值来确定楼层f的确切值。
Example 1: - Input: k = 1, n = 2
示例1:- 输入:k = 1, n = 2
Output: 2
Explanation:说明:
Drop the egg from floor 1. If it breaks, we know that f = 0.
从第1层扔鸡蛋。如果它碎了,我们知道 f = 0。
Otherwise, drop the egg from floor 2. If it breaks, we know that f = 1.
否则,从第2层扔鸡蛋。如果它碎了,我们知道 f = 1。
If it does not break, then we know f = 2.
如果它没有碎,则我们知道 f = 2。
Hence, we need at minimum 2 moves to determine with certainty what the value of f is.
因此,我们至少需要2次移动才能确定f的确切值。
Example 2: - Input: k = 2, n = 6
示例2:- 输入:k = 2, n = 6
Output: 3
Example 3: - Input: k = 3, n = 14示例3:- 输入:k = 3, n = 14
Output: 4
Solution-解决方案-
To efficiently solve the problem of dividing a large job into smaller jobs, we must first determine how to partition the job into smaller jobs. For example, a binary search may be used to determine the optimal floor location. However, an easier way to determine the optimal floor location is to recognise that eggs are less likely to be broken in the higher floors, thus the floor location should be chosen to achieve this balance. This is a common procedure to determine the cut point for binary search. You should choose a floor location that minimises the number of moving steps for the higher floors (and maximises the number of moving steps for the lower floors) to provide a stable floor.
为了高效解决将大任务拆分为较小任务的问题,我们必须首先确定如何将任务划分为较小任务。例如,可以使用二分搜索来确定最优楼层位置。然而,一种更简单的确定最优楼层位置的方法,是认识到鸡蛋在较高楼层更不容易碎,因此应选择楼层位置以实现这种平衡。这是确定二分搜索切点的常见过程。您应选择一个楼层位置,使较高楼层的移动次数最小化(并使较低楼层的移动次数最大化),以提供一个稳定的楼层。
class Solution {
class Solution {
private:
private:
vector<vector> moveNum;
vector<vector> moveNum;
public:
public:
int superEggDrop(int K, int N) {
int superEggDrop(int K, int N) {
moveNum.assign(K+1, vector(N+1, -1));
moveNum.assign(K+1, vector(N+1, -1));
for(int i = 1; i <= K; i++){
for(int i = 1; i <= K; i++){
moveNumi = 0;
moveNumi = 0;
moveNumi = 1;
moveNumi = 1;
moveNumi = 2;
moveNumi = 2;
}
for(int i = 1; i <= N; i++ ) {
for(int i = 1; i <= N; i++ ) {
moveNum1 = i;
moveNum1 = i;
}
return help(K, N);
return help(K, N);
}
int help(int K, int N){
int help(int K, int N){
if(moveNumK != -1)
if(moveNumK != -1)
return moveNumK;
return moveNumK;
// the most important thing is to find the cut point
// 最重要的是找到切分点
int end = (1 + N) / 2;
int end = (1 + N) / 2;
int begin = 1;
int begin = 1;
int cut = (begin + end) / 2;
int cut = (begin + end) / 2;
int diff = help(K-1, cut-1) - help(K, N-cut);
int diff = help(K-1, cut-1) - help(K, N-cut);
while(diff != 0 && end - begin > 1) {
while(diff != 0 && end - begin > 1) {
if(diff > 0){
如果(diff > 0){
end = cut;
结束 = 切割点;
cut = (begin + end) / 2;
切割点 = (开始 + 结束) / 2;
diff = help(K-1, cut-1) - help(K, N-cut);
diff = help(K-1, 切割点-1) - help(K, N-切割点);
}
else{
否则{
begin = cut;
开始 = 切割点;
cut = (begin + end) / 2;
切割点 = (开始 + 结束) / 2;
diff = help(K-1, cut-1) - help(K, N-cut);
diff = help(K-1, 切割点-1) - help(K, N-切割点);
}
}
int move1 = 1 + max(help(K-1, begin-1), help(K, N-begin));
int move1 = 1 + max(help(K-1, 开始-1), help(K, N-开始));
int move2 = 1 + max(help(K-1, end-1), help(K, N-end));
int move2 = 1 + max(help(K-1, 结束-1), help(K, N-结束));
int move3 = 1 + max(help(K-1, cut-1), help(K, N-cut));
int move3 = 1 + max(help(K-1, 切割点-1), help(K, N-切割点));
moveNumK = min(move1, min(move2, move3));
moveNumK = min(move1, min(move2, move3));
return moveNumK;
return moveNumK;
}
};
459. Given a string s, find the first non-repeating character and return its index. If one is found, return the index. Otherwise, return -1.
给定一个字符串 s,找到第一个不重复的字符并返回其索引。如果找到了一个,返回该索引。否则,返回 -1。
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc758d557c902bb4582 | 官方: 否 | 付费: 否
答案:
Example 1: - Input: s = "scaler"
示例 1:- 输入:s = "scaler"
Output: 0
Example 2: - Input: s = "interviewbit"示例 2:- 输入:s = "interviewbit"
Output: 1
Example 3: - Input: s = "aabb"示例 3:- 输入:s = "aabb"
Output: -1
Solution-解决方案-
A hashmap is not required for this example because you can count the frequency of the English lowercase characters using an array. O(n) time complexity: O(2n) as we traverse the string 2 times (1 to count the letter frequency and 2 to find the letter with frequency = 1). Space complexity: O(26) we use an array of 26 to hold the English lowercase characters' frequency.
此示例不需要哈希映射,因为您可以使用数组计算英文字母小写字符的频率。时间复杂度:O(2n),因为遍历字符串两次(一次统计字母频率,一次查找频率为1的字母)。空间复杂度:O(26),使用一个大小为26的数组来存储英文字母小写字符的频率。
class Solution {
class Solution {
public:
public:
int firstUniqChar(string s) {
int firstUniqChar(string s) {
if (s.empty()) {
if (s.empty()) {
return -1;
return -1;
}
// use an array where we count the frequency of all english lower case characters
// 使用一个数组来统计所有英文字母小写字符的频率
int char_freq[26] = { 0 };
int char_freq[26] = { 0 };
for (int i = 0; i < s.size(); ++i) {
for (int i = 0; i < s.size(); ++i) {
//convert char to its ascii code in the range [0,26)
//将字符转换为其在[0,26)范围内的ASCII码
int char_idx = s[i] - 'a';
int char_idx = s[i] - 'a';
char_freq[char_idx]++; //increase letter frequency
char_freq[char_idx]++; //增加字母频率
}
// check the letters of the string again from start to end
// 再次从头到尾检查字符串中的字母
for (int i = 0; i < s.size(); ++i) {
for (int i = 0; i < s.size(); ++i) {
int char_idx = s[i] - 'a';
int char_idx = s[i] - 'a';
//if the character has frequency of 1, return its position into string
//如果该字符的频率为1,则返回其在字符串中的位置
if (char_freq[char_idx] == 1) {
if (char_freq[char_idx] == 1) {
return i;
返回 i;
}
}
return -1;
return -1;
}
};
460. What is JVM and is it's platform-independent?
什么是JVM?它是平台无关的吗?
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc758d557c902bb4588 | 官方: 否 | 付费: 否
答案:
The Java Virtual Machine (JVM) is a runtime environment for bytecode(.class files) that is run on the Java Platform. The JVM is the platform. It is the JVM that does the work. The Java Virtual Machine (JVM) is responsible for this. Due to its awareness of the various platform characteristics and instruction lengths, JVM makes this possible. The JVM is not platform-independent. Java Virtual Machine (JVM) provides the environment for Java code to run. A file created with Java code is executed by the JVM. Most OSs (operating systems) are not compatible with one another, which means that the end result is dependent on the kernel, and the kernel is different for each OS (operating system). The JVM translates bytecode into machine language so that computers can access the same machine language code, and it actually executes those machine-language instructions. Without the JVM, you cannot run a Java program.
Java虚拟机(JVM)是Java平台上运行字节码(.class文件)的运行时环境。JVM就是平台。执行工作的是JVM。Java虚拟机(JVM)负责此任务。由于它了解各种平台特性和指令长度,JVM使这成为可能。JVM不是平台无关的。Java虚拟机(JVM)为Java代码运行提供环境。用Java代码创建的文件由JVM执行。大多数操作系统(OS)彼此不兼容,这意味着最终结果依赖于内核,而每个操作系统的内核都不同。JVM将字节码翻译成机器语言,以便计算机能访问相同的机器语言代码,并且它实际执行这些机器语言指令。没有JVM,你就无法运行Java程序。
461. What are wrapper classes?
什么是包装类?
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc758d557c902bb458b | 官方: 否 | 付费: 否
答案:
Wrapper classes wrap data types in object-like wrappers, allowing them to be converted to objects. They are used to turn any primitive type into an object in Java. Although they are not objects themselves, they are defined in the language. Thus, it is necessary to convert data types into objects in Java in some circumstances. To demonstrate this, we created a wrapper class that conforms to the structure of only objects.
包装类将数据类型包装在类似对象的包装器中,允许它们被转换为对象。它们用于在Java中将任何原始类型转换为对象。虽然它们本身不是对象,但它们在语言中已定义。因此,在某些情况下,有必要在Java中将数据类型转换为对象。为了说明这一点,我们创建了一个符合仅对象结构的包装类。
462. What do you think of the primary memory and the secondary memory?
你对主存储器和辅助存储器有何看法?
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc758d557c902bb458e | 官方: 否 | 付费: 否
答案:
Main memory is tasked with transferring data from secondary memory to the processor in Dragon Fantasy. RAM and ROM , two of the foremost memories in the system, are used but hard disk and other large-sized memories from secondary memory are also utilised. The main memory is straightforward and fast to utilise data from it rather than secondary memory, which requires additional time to utilise data. The main memory is faster to utilise data from than secondary memory, which results in less data being stored in the main memory permanently and more utilising data quicker. Secondary memory data is not stored in the main memory as permanently as RAM data, but only for a certain amount of time in order to achieve optimum performance.
主存储器负责将数据从辅助存储器传输到处理器,如龙幻想中所述。系统中的两个主要存储器RAM和ROM被使用,但硬盘和其他来自辅助存储器的大容量存储器也被利用。主存储器在利用数据时比辅助存储器更直接和快速,辅助存储器需要额外的时间来利用数据。主存储器利用数据的速度快于辅助存储器,这导致主存储器中永久存储的数据较少,而更快速地利用数据。辅助存储器中的数据不像RAM数据那样永久存储在主存储器中,而只是为了达到最佳性能而存储一段时间。
463. What is Reentrancy?
什么是可重入性?
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc758d557c902bb4591 | 官方: 否 | 付费: 否
答案:
Multi programmed timesharing systems using Reentrant Procedures are useful for retaining a record of activations for subsequent executions of programs. Reentrant Procedures are procedures that must be written so that multiple individuals may share a single copy of the program code during the same period. The program code cannot modify itself, and the local data for each user process must be stored separately. The permanent part is the code, and the temporary part is the pointer to the calling program and local variables used by that program. Each activation is called an execution instance. It executes the code in the permanent part but retains its own copy of local variables/parameters. The temporary part associated with each activation is the activation record. Typically, the activation record is retained on the stack. A reentrant procedure may be interrupted and executed again if it is interrupted.
使用可重入过程的多道程序设计分时系统对于保留程序后续执行的激活记录很有用。可重入过程是必须编写的程序代码,以便多个个体可以在同一时期内共享该程序代码的单个副本。程序代码不能修改自身,并且每个用户进程的本地数据必须分开存储。永久部分是代码,临时部分是指向调用程序的指针和该程序使用的局部变量。每次激活称为一个执行实例。它执行永久部分的代码,但保留其自身的局部变量/参数副本。与每次激活相关联的临时部分是激活记录。通常,激活记录保留在堆栈上。一个可重入过程可以被中断,并在被中断后再次执行。
MAQ Interview Preparation
464. How can I get placed in MAQ?
我怎样才能在MAQ获得职位?
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc858d557c902bb45b8 | 官方: 否 | 付费: 否
答案:
- It is important to understand the concepts clearly and to complete the projects in a timely manner, and your attitude is crucial.
It is important to study elitmus and apply for MAQ, too. To be eligible for MAQ Software hiring through the AMCAT platform, you must also take the AMCAT test.
- 学习elitmus并申请MAQ也很重要。要通过AMCAT平台有资格被MAQ Software招聘,你还必须参加AMCAT测试。
It is important to master the core computer science subjects, LINUX, shell scripting, and projects such as those made with LISP.
- 掌握核心计算机科学科目、LINUX、shell脚本以及像使用LISP制作的项目很重要。
Write more to master the theoretical concepts and do not forget the core computer science subjects.
- 多写代码以掌握理论概念,并且不要忘记核心计算机科学科目。
You can also ask for a referral from LinkedIn or other mediums.
- 你还可以通过LinkedIn或其他媒介请求推荐。
465. What is the fresher salary in MAQ?
MAQ公司新人的薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc858d557c902bb45bb | 官方: 否 | 付费: 否
答案:
According to Ambitionbox, the average MAQ Software salary ranges from approximately ₹4.6 Lakhs per year .
根据Ambitionbox的数据,MAQ Software的平均薪资大约为每年₹46万卢比。
466. Is the MAQ interview hard?
MAQ的面试难吗?
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc858d557c902bb45be | 官方: 否 | 付费: 否
答案:
The technical interview is challenging and complicated, and it will be based solely on the information you provide in your resume. They will ask you questions based on the areas of study and the projects you've completed while in college.
技术面试具有挑战性且复杂,完全基于你简历中提供的信息。他们会根据你大学期间的学习领域和完成的项目提问。
467. Why do you want to work for MAQ?
你为什么想为MAQ工作?
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc858d557c902bb45c1 | 官方: 否 | 付费: 否
答案:
Freshers can find comfort in working at MAQ Software. The team members go beyond to satisfy the demands of the company. Working in such an environment makes you realise just how important it is to work together. You will gain a lot of experience in the industry and high-quality delivery in a hectic situation. With a focus on innovative Software applications, MAQ Software enables companies to boost their productivity. Using the latest agile engineering methods, the company accelerates software innovations that enable customers to transform their sectors.
新人在MAQ Software工作会感到舒适。团队成员会竭尽全力满足公司需求。在这样的环境中工作会让你意识到团队合作有多重要。你将在行业中积累大量经验,并在紧张情况下实现高质量交付。凭借对创新软件应用的关注,MAQ Software帮助公司提升生产力。公司采用最新的敏捷工程方法,加速软件创新,使客户能够转型其行业。
Sample Answer:
示例回答:
“There are four reasons why I would like to work for MAQ Software. The first justification is from the fact that, after using some of its goods and services myself, it is obvious that they always put the needs of the client first and are driven to improve people's lives. That is a quality that I actually like in a firm.
“我想为MAQ Software工作的原因有四个。第一个理由是,在我自己使用过一些其产品和服务后,很明显他们始终将客户需求放在首位,并致力于改善人们的生活。这是我真正欣赏的公司特质。
The second factor is that this ongoing drive will help us to develop, learn, and get better. Working for this company will provide me with the opportunity to continue learning and growing since I share my desire to do so. The desire to work on diverse, tough tasks is the third justification. After researching this position and your business, I am aware that I will work with many teams and departments that are pursuing the same goals.
第二个因素是这种持续的驱动力将帮助我们发展、学习和进步。为这家公司工作将为我提供继续学习和成长的机会,因为我也有同样的愿望。第三个理由是希望在多样化和艰巨的任务中工作。在研究了这个职位和贵公司之后,我知道我将与许多追求相同目标的团队和部门合作。
Last but not least, it is obvious from your website and social media platforms that you take your obligations seriously, which is another reason I wish to work for your IT firm. You support an inclusive workplace atmosphere, you care about the planet we live on, and you are socially responsible.”
最后但同样重要的是,从你们的网站和社交媒体平台可以明显看出,你们认真对待自身责任,这也是我希望在贵IT公司工作的另一个原因。你们支持包容的工作环境,关心我们共同生活的星球,并且具有社会责任感。”
468. Does MAQ pay well?
MAQ的薪资待遇好吗?
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc858d557c902bb45c4 | 官方: 否 | 付费: 否
答案:
According to Glassdoor, the typical compensation range for an entry-level (or E1) software engineer is $110,928 .
根据Glassdoor的数据,入门级(或E1)软件工程师的典型薪酬范围是$110,928。
469. How long is the MAQ Interview Process?
MAQ的面试流程需要多长时间?
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc858d557c902bb45c7 | 官方: 否 | 付费: 否
答案:
MAQ Software takes an average of five days to interview for all job titles when considering all user-submitted interviews. The hiring process for software engineers, on the other hand, takes an average of 2 days, while that for software developer roles is on average 7 days .
考虑到所有用户提交的面试情况,MAQ Software处理所有职位的面试平均需要五天。然而,软件工程师的招聘流程平均需要两天,而软件开发人员岗位则平均为七天。
470. What is the Eligibility Criteria at MAQ
MAQ的资格标准是什么
- 知识点: 其他/未分类 (标签: interviewbit, maq, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: MAQ Software
- id: 69b37bc858d557c902bb45ca | 官方: 否 | 付费: 否
答案:
- 6 CGPA/60% and no active backlogs are required throughout the academic years
- B.Tech (CS), BCA + MCA, M.Tech, B.Tech+M.Tech(CSE).
471. Differentiate between Multiprogramming vs Multitasking.
区分多道程序设计与多任务处理。
- 知识点: 其他/未分类 (标签: interviewbit, mindtree, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Mindtree
- id: 69b37bd258d557c902bb4bda | 官方: 否 | 付费: 否
答案:
Following are the differences between Multiprogramming and Multitasking:
以下是多道程序设计与多任务处理之间的区别:
| Multiprogramming 多道程序设计 | Multitasking 多任务处理 |
|---|---|
| Multiprogramming is primarily used to maximise CPU efficiency by arranging applications so that only one programme is running at any given time. 多道程序设计主要用于通过安排应用程序,使任一时刻只有一个程序在运行,从而最大化CPU效率。 | Multitasking, on the other hand, tries to improve reaction time by sharing computing resources among multiple users. 另一方面,多任务处理试图通过在多用户之间共享计算资源来提高响应时间。 |
| The goal of multiprogramming is to make the CPU work harder. The programs are designed in such a way that the CPU is never idle; each program is executed one after the other. 多道程序设计的目标是让CPU更忙碌地工作。程序的设计方式使得CPU永远不会空闲;每个程序依次执行。 | Multitasking, on the other hand, aims to enhance CPU reaction time. 另一方面,多任务处理旨在提高CPU的响应时间。 |
| Multiprogramming is based on the concept of context switching, which is a common operation that allows a single processor machine's CPU to switch from one task to another. The Process Control Block (PCB) keeps track of an active process's state so that the CPU can resume from the same point. 多道程序设计基于上下文切换的概念,这是一种常见操作,允许单处理器机器的CPU从一个任务切换到另一个任务。进程控制块(PCB)跟踪活动进程的状态,以便CPU可以从同一点恢复。 | Multitasking, on the other hand, is based on time-sharing, which means that each activity or process is completed in the same amount of time. 另一方面,多任务处理基于时间共享,这意味着每个活动或进程在相同的时间内完成。 |
| Multiprogramming relies on a computer's ability to store programs for longer periods of time in order to reduce CPU idle time. Processes are allocated using the scheduling mechanism. The operating system executes a portion of one program at a time, then another program, and so on. 多道程序设计依赖于计算机存储程序更长时间的能力,以减少CPU空闲时间。进程通过调度机制进行分配。操作系统一次执行一个程序的一部分,然后是另一个程序,以此类推。 | The CPU, on the other hand, allows multiple processes to run at the same time using time-sharing and executes them properly under a multitasking operating system. 另一方面,CPU允许在时间共享下同时运行多个进程,并在多任务操作系统下正确执行它们。 |
| Multiprogramming can be done on a computer with a modest amount of RAM or ROM memory; a large quantity of memory is not required. 多道程序设计可以在具有适度RAM或ROM内存的计算机上完成;不需要大量内存。 | Multitasking, on the other hand, demands a large quantity of memory storage in order to complete all jobs or processes at the same time. 另一方面,多任务处理需要大量内存存储,以便同时完成所有作业或进程。 |
472. Differentiate between interface and abstract class in the context of Java.
在Java的背景下,区分接口和抽象类。
- 知识点: 其他/未分类 (标签: interviewbit, mindtree, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mindtree
- id: 69b37bd258d557c902bb4be3 | 官方: 否 | 付费: 否
答案:
The following table lists the differences between an interface and abstract class:
下表列出了接口和抽象类之间的区别:
| Interface 接口 | Abstract class 抽象类 |
|---|---|
| Only abstract methods are allowed in an interface. It can also contain default and static methods with Java 8. 接口中只允许抽象方法。在Java 8中,它还可以包含默认和静态方法。 | There are abstract and non-abstract methods in an abstract class. 抽象类中有抽象方法和非抽象方法。 |
| We cannot implement the concept of multiple inheritances using interfaces. 我们不能使用接口实现多重继承的概念。 | We cannot implement the concept of multiple inheritances using abstract classes. 我们不能使用抽象类实现多重继承的概念。 |
| The implementation of an abstract class cannot be provided by an interface. 接口不能提供抽象类的实现。 | An abstract class can provide interface implementation. 抽象类可以提供接口的实现。 |
| Only static and final variables are used in the interface. 接口中只使用静态和最终变量。 | Variables in an abstract class can be final, non-final, static, or non-static. 抽象类中的变量可以是最终的、非最终的、静态的或非静态的。 |
| To declare an interface, we use the interface keyword. 要声明接口,我们使用interface关键字。 | To declare an abstract class, we use the abstract keyword. 要声明抽象类,我们使用abstract关键字。 |
| Only another Java interface can be extended by an interface. 接口只能扩展另一个Java接口。 | An abstract class can implement numerous Java interfaces by extending another Java class. 抽象类可以通过扩展另一个Java类来实现多个Java接口。 |
| The keyword "implements" can be used to create an interface. 可以使用"implements"关键字来创建接口。 | The keyword "extends" can be used to extend an abstract class. 可以使用"extends"关键字来扩展抽象类。 |
| By default, members of a Java interface are public. 默认情况下,Java接口的成员是公共的。 | Private, protected, and other class members can be found in a Java abstract class. Java抽象类中可以找到私有、受保护和其他类成员。 |
473. Write a program to calculate the Least Common Multiple (LCM) of two numbers. Example : Input : a = 10, b =15 Output : 30 a = 5, b = 7 Output : 35
编写一个程序来计算两个数的最小公倍数(LCM)。示例:输入:a = 10, b = 15 输出:30 a = 5, b = 7 输出:35
- 知识点: 其他/未分类 (标签: interviewbit, mindtree, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Mindtree
- id: 69b37bd358d557c902bb4be9 | 官方: 否 | 付费: 否
答案:
Input : a = 10, b =15 Output : 30 a = 5, b = 7 Output : 35
输入:a = 10, b = 15 输出:30 a = 5, b = 7 输出:35
Approach:
方法:
Let us assume the two numbers are a and b. Then, the two numbers have the following relationship :
假设两个数为 a 和 b。那么,这两个数具有以下关系:
a b = LCM(a, b) GCD(a, b)
a b = LCM(a, b) GCD(a, b)
or,
或,
LCM(a, b) = (a * b) / GCD(a, b)
LCM(a, b) = (a * b) / GCD(a, b)
Let us take an example to understand better. For a = 10 and b = 15, a b = 150, LCM(10, 15) = 30, GCD(10, 15) = 5. So, a b = LCM(a, b) * GCD(a, b).
让我们通过一个例子来更好地理解。对于 a = 10 和 b = 15,a b = 150,LCM(10, 15) = 30,GCD(10, 15) = 5。所以,a b = LCM(a, b) * GCD(a, b)。
Code :
代码:
include
using namespace std;
using namespace std;
//Function to find the greatest common divisor of the two numbers
//求两个数的最大公约数的函数
int findGCD(int a,int b)
int findGCD(int a, int b)
{
if (b == 0)
如果 (b == 0)
return a;
返回 a;
return findGCD(b, a % b);
返回 findGCD(b, a % b);
}
// Function to return LCM of two numbers
// 返回两个数的最小公倍数的函数
int findLCM(int a, int b)
int findLCM(int a, int b)
{
return (a * b) / findGCD(a, b);
返回 (a * b) / findGCD(a, b);
}
int main()
int main()
{
int a = 10, b = 15;
int a = 10, b = 15;
cout <<"The Least Common Multiple of the two numbers " << a << " and " << b << " is : " << findLCM(a, b);
cout <<"这两个数的最小公倍数 " << a << " 和 " << b << " 是 : " << findLCM(a, b);
return 0;
return 0;
}
Output:
输出:
The Least Common Multiple of the two numbers 10 and 15 is : 30
这两个数的最小公倍数 10 和 15 是 : 30
Explanation:
说明:
In the above code, the function findGCD() finds the greatest common divisor of the two numbers a and b. We use the Euclidean algorithm to find the greatest common divisor of the two numbers. The function findLCM() finds the least common multiple of the two numbers.
在上述代码中,函数 findGCD() 用于计算两个数 a 和 b 的最大公约数。我们使用欧几里得算法来求两个数的最大公约数。函数 findLCM() 用于计算两个数的最小公倍数。
474. Differentiate between new and malloc() in the context of C++.
在 C++ 的上下文中,区分 new 和 malloc()。
- 知识点: 其他/未分类 (标签: interviewbit, mindtree, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mindtree
- id: 69b37bd358d557c902bb4c00 | 官方: 否 | 付费: 否
答案:
The following table lists the differences between new and malloc():
下表列出了 new 和 malloc() 之间的区别:
| new | malloc() |
|---|---|
| new is an operator. new 是一个运算符。 | malloc() is a function. malloc() 是一个函数。 |
| When we use a new operator, it calls the constructor. 当我们使用 new 运算符时,它会调用构造函数。 | Usage of the malloc() function does not involve invoking constructors. 使用 malloc() 函数不涉及调用构造函数。 |
| It returns the data type specified while using the new operator. 它返回使用 new 运算符时指定的数据类型。 | It returns a void type which needs to be typecasted manually to the required data type. 它返回 void 类型,需要手动强制转换为所需的数据类型。 |
| When the new operator fails, it throws an error of bad_alloc exception. 当 new 运算符失败时,它会抛出 bad_alloc 异常错误。 | When the malloc() command fails, it returns NULL. 当 malloc() 命令失败时,它返回 NULL。 |
| Here, the size of memory required is computed automatically by the compiler. 这里,所需内存的大小由编译器自动计算。 | Here, the size of memory required needs to be computed manually and provided at the time of using malloc(). 这里,所需内存的大小需要手动计算并在使用 malloc() 时提供。 |
475. Explain the Open Systems Interconnection (OSI) model in the context of computer networks.
在计算机网络的上下文中,解释开放系统互连(OSI)模型。
- 知识点: 其他/未分类 (标签: interviewbit, mindtree, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mindtree
- id: 69b37bd358d557c902bb4c03 | 官方: 否 | 付费: 否
答案:
Following are the different layers in the OSI model:
以下是 OSI 模型中的不同层:
Physical Layer: The physical layer is the lowest layer in the OSI reference model. It is in charge of establishing a physical connection between the devices. Bits of information are stored in the physical layer. Following are the responsibilities of the physical layer : - Bit synchronisation: A clock is provided by the physical layer, which allows the bits to be synchronised. This clock controls both the sender and the receiver, ensuring bit-level synchronisation.
物理层:物理层是 OSI 参考模型中最低的层。它负责在设备之间建立物理连接。信息位存储在物理层中。以下是物理层的职责: - 位同步:物理层提供一个时钟,使位能够同步。这个时钟控制发送方和接收方,确保位级同步。
- The transmission rate, or the number of bits transferred per second, is likewise defined by the Physical layer.
- Physical topologies: The physical layer defines the arrangement of devices/nodes in a network, such as bus, star, or mesh topologies.
Transmission mode: The physical layer also specifies how data is passed between the two linked devices. Simplex, half-duplex, and full-duplex transmission modes are available.
Data Link Layer (DLL): The data link layer is in charge of message transport from node to node. The major purpose of this layer is to ensure that data transfers from one node to another through the physical layer are error-free. Following are the responsibilities of data link layer : - Framing: The data link layer is responsible for framing. It allows a sender to deliver a set of bits to a receiver that are relevant to the receiver. This can be done by attaching unique bit patterns to the frame's beginning and end.数据链路层(DLL):数据链路层负责从节点到节点的消息传输。该层的主要目的是确保通过物理层从一个节点到另一个节点的数据传输无错误。以下是数据链路层的职责: - 帧同步:数据链路层负责帧同步。它允许发送方将一组位传递给接收方,这些位与接收方相关。这可以通过在帧的开头和结尾附加唯一的位模式来实现。
- Physical addressing: After producing frames, the Data link layer adds the sender and/or receiver's physical addresses (MAC addresses) to the header of each frame.
- Error control: The data link layer implements error control by detecting and retransmitting broken or lost frames.
- Flow Control: Because the data rate on both sides must be consistent or the data would be corrupted, flow control coordinates the amount of data that can be transferred before acknowledgment.
When many devices share a single communication channel, the MAC sub-layer of the data link layer assists in determining which device has control over the channel at any particular time.
Network Layer: The network layer is responsible for data transmission between hosts on different networks. Following are the responsibilities of the network layer : - Routing: From source to destination, the network layer protocols determine which path is best. Routing is the name for this network layer function.网络层:网络层负责不同网络中主机之间的数据传输。以下是网络层的职责: - 路由:从源到目的地,网络层协议确定哪条路径最佳。这种网络层功能称为路由。
The network layer defines an addressing scheme in order to uniquely identify each device on the internetwork. The network layer places the IP addresses of the sender and receiver in the header. An address like this recognises each gadget in a unique and universal way.
Transport Layer: The transport layer delivers services to the application layer while also receiving services from the network layer. Segments are the units of data in the transport layer. Following are the responsibilities of the Transport layer : - This layer accepts the message from the (session) layer and splits it down into smaller parts. A header is attached to each of the segments created. The message is reassembled by the transport layer at the destination station.传输层:传输层向应用层提供服务,同时也从网络层接收服务。传输层中的数据单位是段。以下是传输层的职责: - 该层从(会话)层接受消息并将其分割成更小的部分。每个创建的段都附加一个头部。传输层在目的地站重新组装消息。
The transport layer header provides a form of address called service point address or port address in order to deliver the message to the relevant process. The transport layer ensures that the message is delivered to the relevant process by supplying this address.
Session Layer: The Session Layer is in charge of establishing connections, maintaining sessions, authenticating users, and ensuring security. Following are the responsibilities of session layer : - Establishing, maintaining, and terminating a session: The layer enables the two processes to create, use, and terminate a connection.会话层:会话层负责建立连接、维护会话、验证用户身份以及确保安全。以下是会话层的职责: - 建立、维护和终止会话:该层使两个进程能够创建、使用和终止连接。
- Synchronization: This layer allows a process to insert checkpoints into the data that serve as synchronisation points. These synchronisation points aid in the detection of errors so that data may be correctly resynchronized, message ends are not severed prematurely, and data loss is avoided.
Dialog Controller: The session layer enables two systems to communicate in half-duplex or full-duplex mode.
Presentation Layer: The Presentation Layer is often referred to as the Translation Layer. The data from the application layer is retrieved and processed here so that it may be transmitted across the network in the proper format. Following are the responsibilities of the presentation layer : - It is responsible for translations such as ASCII to EBCDIC.表示层:表示层通常被称为翻译层。这里检索并处理来自应用层的数据,以便以适当的格式通过网络传输。以下是表示层的职责: - 它负责翻译,例如从 ASCII 到 EBCDIC 的转换。
- Encryption/decryption: Data encryption is the process of converting data into a different form or coding. The ciphertext is the encrypted data, and the plain text is the decoded data. When encrypting and decrypting data, a key-value is used.
Compression: This technique reduces the amount of data that must be transmitted over the network.
Application Layer: The Application layer, which is implemented by network applications, is at the very top of the OSI Reference Model stack of levels. Following are the responsibilities of the application layer : - This layer also acts as a window for application services to connect to the network and show the information they receive to the user.应用层:应用层由网络应用程序实现,位于 OSI 参考模型层次栈的最顶端。以下是应用层的职责: - 该层还充当应用程序服务连接到网络并向用户显示接收信息的窗口。
- It is also responsible for file transfer access and management.
- It is responsible for mail services.
- It is also responsible for directory services.
476. Differentiate between WHERE clause and HAVING clause in SQL.
在 SQL 中,区分 WHERE 子句和 HAVING 子句。
- 知识点: 其他/未分类 (标签: interviewbit, mindtree, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mindtree
- id: 69b37bd358d557c902bb4c06 | 官方: 否 | 付费: 否
答案:
The following table lists the differences between the WHERE clause and the HAVING clause:
下表列出了 WHERE 子句和 HAVING 子句之间的区别:
| WHERE | HAVING |
|---|---|
| The WHERE Clause is used to filter records from a table depending on a condition that is given. WHERE 子句用于根据给定的条件过滤表中的记录。 | The HAVING Clause is used to filter records from groups based on a condition that is given. HAVING 子句用于根据给定的条件过滤分组中的记录。 |
| You can use the WHERE Clause without the GROUP BY Clause. 你可以在没有 GROUP BY 子句的情况下使用 WHERE 子句。 | The HAVING Clause is ineffective without the GROUP BY Clause. 没有 GROUP BY 子句,HAVING 子句无效。 |
| The WHERE Clause is used in row operations. WHERE 子句用于行操作。 | The HAVING Clause is used to implement column operations. HAVING 子句用于实现列操作。 |
| The WHERE clause can be used in conjunction with the SELECT, UPDATE, and DELETE statements. WHERE 子句可以与 SELECT、UPDATE 和 DELETE 语句一起使用。 | Only the SELECT statement can employ the HAVING Clause. 只有 SELECT 语句可以使用 HAVING 子句。 |
| The aggregate function cannot be used in the WHERE Clause. 聚合函数不能用于 WHERE 子句中。 | The HAVING Clause is capable of containing aggregate functions. HAVING 子句能够包含聚合函数。 |
| With single-row functions such as UPPER, LOWER, and so on, the WHERE Clause is used. 使用单行函数(如 UPPER、LOWER 等)时使用 WHERE 子句。 | With multiple-row functions like SUM, COUNT, and others, the HAVING Clause is employed. 使用多行函数(如 SUM、COUNT 等)时使用 HAVING 子句。 |
| The WHERE Clause comes before the GROUP BY Clause. WHERE 子句位于 GROUP BY 子句之前。 | After the GROUP BY Clause, the HAVING Clause is used. HAVING 子句位于 GROUP BY 子句之后。 |
477. What do you understand by subnetting in the context of computer networks?
在计算机网络背景下,你对子网划分的理解是什么?
- 知识点: 其他/未分类 (标签: interviewbit, mindtree, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mindtree
- id: 69b37bd358d557c902bb4c0c | 官方: 否 | 付费: 否
答案:
Subnetting is the process of dividing a larger network into smaller networks in order to preserve security. As a result, smaller networks are easier to maintain. To divide a network into two pieces, select one bit from the host ID part for each Subnet. To divide a network into four subnets, two bits from the host id component must be chosen for each subnet and so on.
子网划分是为了维护安全性,将较大的网络划分为较小网络的过程。因此,较小的网络更容易维护。要将一个网络分成两部分,需要从主机ID部分为每个子网选择一位。要将一个网络划分为四个子网,则必须为主机ID部分选择两位,以此类推。
In the above image, we can see that we have divided the network 20.0.0.0/24 into two subnets 20.0.1.0/24 and 20.0.3.0/24.
在上图中,我们可以看到我们将20.0.0.0/24网络划分成了两个子网:20.0.1.0/24和20.0.3.0/24。
478. What are the advantages and disadvantages of subnetting?
子网划分的优点和缺点是什么?
- 知识点: 其他/未分类 (标签: interviewbit, mindtree, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mindtree
- id: 69b37bd358d557c902bb4c0f | 官方: 否 | 付费: 否
答案:
Following are the advantages of subnetting : - It protects one network from the intrusion of another. For example, in an organisation, the Developer department's code must not be accessible by any other department.
以下是子网划分的优点:- 它可以保护一个网络免受另一个网络的入侵。例如,在一个组织中,开发部门的代码不能被其他任何部门访问。
- It's possible that some subnets will require higher network priority than others. A sales department, for example, may need to host webcasts or video conferences. Subnetting makes it possible to treat networks with different priorities differently.
Maintenance is simple in the case of small networks.
Following are the disadvantages of subnetting : - To reach a Process in the case of a single network, only three steps are required: Source Host to Destination Network, Destination Network to Destination Host, and lastly Destination Host to Process. Subnetting, on the other hand, necessitates four phases for Inter-Network Communication. Source Host to Destination Network, Destination Network to appropriate Subnet, Subnet to Host, and lastly Host to Process are the steps. As a result, Time complexity rises. More time is necessary for communication or data transfer in the case of Subnet.以下是子网划分的缺点:- 在单个网络的情况下,到达一个进程只需要三个步骤:源主机到目标网络,目标网络到目标主机,最后是目标主机到进程。另一方面,子网划分对于网络间通信则需要四个阶段。这些步骤是:源主机到目标网络,目标网络到适当的子网,子网到主机,最后是主机到进程。因此,时间复杂度上升。在子网的情况下,通信或数据传输需要更多时间。
- Only two IP addresses are spent for Network Id and Broadcast address in a single network, while two IP addresses are wasted for each Subnet in subnetting.
- The total Network's cost rises as well. Subnetting necessitates the purchase of expensive internal routers, switches, hubs, and bridges.
479. Differentiate between preemptive and non-preemptive scheduling algorithms.
区分抢占式和非抢占式调度算法。
- 知识点: 其他/未分类 (标签: interviewbit, mindtree, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Mindtree
- id: 69b37bd358d557c902bb4c12 | 官方: 否 | 付费: 否
答案:
Following are the differences between preemptive and non-preemptive scheduling algorithms:
以下是抢占式和非抢占式调度算法之间的区别:
| Preemptive Scheduling 抢占式调度 | Non-Preemptive Scheduling 非抢占式调度 |
|---|---|
| The CPU is assigned to the processes in preemptive scheduling for a limited time 在抢占式调度中,CPU分配给进程的时间是有限的。 | In non-preemptive scheduling, the CPU is allocated to the processes until they terminate or switch to the waiting state. 在非抢占式调度中,CPU分配给进程直到它们终止或切换到等待状态。 |
| In Preemptive scheduling, when a higher priority task arrives, the executing process in preemptive scheduling is halted in the middle of its execution. 在抢占式调度中,当一个更高优先级的任务到达时,正在执行的进程会在执行中途被暂停。 | In non-preemptive scheduling, the executing process is not disturbed in the middle of its execution and waits until it is completed. 在非抢占式调度中,正在执行的进程不会在执行中途被打扰,并且会等待直到完成。 |
| The overhead of transitioning a process from the ready state to the running state, and vice versa, as well as maintaining the ready queue, exists in Preemptive Scheduling. 在抢占式调度中,存在将进程从就绪状态转换到运行状态以及反之的开销,以及维护就绪队列的开销。 | Non-preemptive scheduling, on the other hand, has no overhead of transitioning the process from running to ready state. 另一方面,非抢占式调度没有将进程从运行状态转换到就绪状态的开销。 |
| In the case of preemptive scheduling, if a high-priority process repeatedly appears in the ready queue, the low-priority process will have to wait for a long time, and it may have to starve. 在抢占式调度的情况下,如果一个高优先级进程反复出现在就绪队列中,低优先级进程将不得不等待很长时间,并且可能会饥饿。 | If CPU is allotted to a process with a long burst time in non-preemptive scheduling, processes with shorter burst times may be forced to starve. 如果在非抢占式调度中将CPU分配给一个具有较长突发时间的进程,则具有较短突发时间的进程可能会被迫饥饿。 |
| Preemptive scheduling achieves flexibility by granting important processes access to the CPU as soon as they enter the ready queue, regardless of what task is already running. 抢占式调度通过无论当前正在运行什么任务,只要重要进程进入就绪队列就立即授予其CPU访问权,从而实现灵活性。 | Non-preemptive scheduling is referred to as stiff because even if a crucial process joins the ready queue, the process's CPU is unaffected. 非抢占式调度被认为是僵硬的,因为即使一个关键进程加入就绪队列,该进程的CPU也不会受到影响。 |
| Preemptive Scheduling is cost associative because it must maintain the integrity of shared data 抢占式调度与成本相关,因为它必须维护共享数据的完整性。 | Non-Preemptive scheduling is not cost associative. 非抢占式调度与成本无关。 |
480. Given a string as an input, write a program to reverse the words in the given string and display the new string.
给定一个字符串作为输入,编写一个程序来反转给定字符串中的单词,并显示新字符串。
- 知识点: 其他/未分类 (标签: interviewbit, mindtree, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Mindtree
- id: 69b37bd358d557c902bb4c1b | 官方: 否 | 付费: 否
答案:
Example: Input: str = “InterviewBit is best” Output : best is InterviewBit
示例:输入:str = “InterviewBit is best” 输出:best is InterviewBit
Approach:
方法:
We maintain a vector of strings. We traverse the given string and keep forming the word until a space is encountered. When space is encountered we add the word formed to the vector of strings. In the end, we print the vector of strings in reverse format.
我们维护一个字符串向量。我们遍历给定的字符串,并不断形成单词,直到遇到空格。当遇到空格时,我们将形成的单词添加到字符串向量中。最后,我们以反向格式打印字符串向量。
Code :
代码:
include <bits/stdc++.h>
using namespace std;
using namespace std;
// function to reverse the words in an inputted string
// 用于反转输入字符串中的单词的函数
void displayModifiedString(string str)
void displayModifiedString(string str)
{
// vector to store all the words of the inputted string
// 用于存储输入字符串中所有单词的向量
vectorarr;
vectorarr;
string temp = ""; // variable to form each word of the string
string temp = ""; // 用于构成字符串中每个单词的变量
for (int i = 0; i < str.length(); i++)
for (int i = 0; i < str.length(); i++)
{
// if space is encountered, we push the formed word to the vector
// 如果遇到空格,则将形成的单词推入向量
if (str[i] == ' ')
if (str[i] == ' ')
{
arr.push_back(temp);
arr.push_back(temp);
temp = "";// resetting the temp variable
temp = "";// 重置临时变量
}
// we keep forming the word
// 否则继续形成单词
else
else
temp += str[i];
temp += str[i];
}
arr.push_back(temp);// we push back the last formed word
arr.push_back(temp);// 推入最后一个形成的单词
// we print the vector in the reverse order
// 按逆序打印向量
for (int i = arr.size() - 1; i > 0; i--)
for (int i = arr.size() - 1; i > 0; i--)
cout << arr[i] << " ";
cout << arr[i] << " ";
cout << arr[0] << endl;
cout << arr[0] << endl;
}
int main()
int main()
{
string str = "InterviewBit is best";
string str = "InterviewBit is best";
displayModifiedString(str);
displayModifiedString(str);
return 0;
return 0;
}
Output :
输出:
best is InterviewBit
best is InterviewBit
Explanation :
解释:
In the above code, the function displayModifiedString takes a string input and displays the modified string with words in reverse order. We keep forming a word until a space character is found. Once space is found, we push back the word to the vector. Lastly, we display the vector in reverse order.
在上述代码中,函数displayModifiedString接收一个字符串输入,并显示单词顺序反转后的修改字符串。我们持续形成一个单词,直到遇到空格字符。一旦找到空格,我们将该单词推入向量中。最后,我们按逆序显示向量。
MindTree Interview Preparation
481. What is the salary for freshers in MindTree?
MindTree招聘应届生的薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, mindtree, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mindtree
- id: 69b37bd358d557c902bb4c58 | 官方: 否 | 付费: 否
答案:
MindTree presently pays trainees an average salary of Rs. 3.2 lakh per year (roughly Rs 26,700 per month).
MindTree目前支付给实习生的平均年薪为32万卢比(大约每月2.67万卢比)。
482. Is it easy to get placed in MindTree?
在MindTree工作容易吗?
- 知识点: 其他/未分类 (标签: interviewbit, mindtree, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mindtree
- id: 69b37bd358d557c902bb4c5b | 官方: 否 | 付费: 否
答案:
With the right preparation and determination, it is easy to get placed in MindTree . The interviews in MindTree focus on the basic computer fundamentals. So make sure that you have your fundamentals clear. Also, practice a lot of Data Structures and Algorithms. That being done, the interview should be a piece of cake for you.
只要有正确的准备和决心,在MindTree工作很容易。MindTree的面试侧重于基本的计算机基础知识。所以确保你的基础知识扎实。此外,多练习数据结构和算法。做到这些,面试对你来说应该是小菜一碟。
483. Is there any bond in MindTree?
MindTree有任何服务协议吗?
- 知识点: 其他/未分类 (标签: interviewbit, mindtree, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mindtree
- id: 69b37bd358d557c902bb4c5e | 官方: 否 | 付费: 否
答案:
There is no bond, however you are required to sign a service agreement on your first day. There is a service agreement in place for campus hires as well. The service agreement is usually for a period of 24 months and a sum of 2 lakh. You can leave the company without an experience certificate or proof, but you must pay the sum owed if you leave before the end of the service agreement period.
没有服务协议,但第一天需要签署一份服务协议。校园招聘也有服务协议。服务协议通常为期24个月,金额为20万卢比。你可以在没有经验证明的情况下离职,但如果在服务协议期限结束前离开,必须支付所欠金额。
484. Why do you want to join MindTree?
你为什么想加入MindTree?
- 知识点: 其他/未分类 (标签: interviewbit, mindtree, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mindtree
- id: 69b37bd358d557c902bb4c61 | 官方: 否 | 付费: 否
答案:
For such types of questions highlight the core principles of the company and the work culture which motivates you to join the company. Talk about your desire to grow and learn while working in this company as your prime reason. Also, state the reviews of the company which you have heard from your seniors currently working for this company.
对于这类问题,请突出公司的核心原则和工作文化,这些会激励你加入该公司。将你希望在这家公司成长和学习的愿望作为首要理由来谈论。此外,也可以提到你从目前在这家公司工作的前辈那里听到的公司评价。
Coding Problems
0/1
Intermediate Problems
中级问题
Time Complexity
时间复杂度
Word Count
字数
Medium
中等
25.24 Mins
25.24 分钟
Solve
解答
485. Write a program to find the sum of the digits of a number. The input number is given in the form of a string.
编写一个程序来计算一个数字各位数字之和。输入的数字以字符串形式给出。
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4d9d | 官方: 否 | 付费: 否
答案:
Increment the sum with that character by running a loop from the beginning to the end of the string (in this case it is numeric). The execution of the above method is shown below.
将该字符加到总和中,通过从字符串开头到结尾运行一个循环(此例中字符串是数字)。上述方法的执行过程如下所示。
int getSum(string str)
int getSum(string str)
{
int sum = 0;
int sum = 0;
// Traversing through the string
// 遍历字符串
for (int i = 0; i < str.length(); i++) {
for (int i = 0; i < str.length(); i++) {
// Since ascii value of
// 因为数字的
// numbers starts from 48
// ASCII 值从 48 开始
// so we subtract it from sum
// 所以我们将其从总和中减去
sum = sum + str[i] - 48;
sum = sum + str[i] - 48;
}
return sum;
return sum;
}
The above problem can also be solved using recursion.
上述问题也可以使用递归解决。
486. Discuss the ‘extern’ keyword in C.
讨论 C 语言中的‘extern’关键字。
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4da0 | 官方: 否 | 付费: 否
答案:
The declaration of a variable or function plainly states that it exists someplace in the program but that no memory has been allocated for it. In terms of the definition, defining a variable or function does more than just declare it; this even allocates memory for that variable or function.
变量或函数的声明只是陈述它在程序中某处存在,但尚未为其分配内存。就定义而言,定义变量或函数不仅仅是声明它;它甚至为该变量或函数分配了内存。
The extern keyword is used to make variables and functions more visible. The usage of extern in function declarations or definitions is unnecessary because functions are visible all through the program by default. Its application is self-evident. When you use an extern with a variable, you're merely declaring it, not defining it. When an extern variable is declared with initialization, it is also considered to be the variable's definition.
extern 关键字用于使变量和函数更具可见性。在函数声明或定义中使用 extern 是不必要的,因为函数默认在整个程序中可见。其应用是不言而喻的。当你对变量使用 extern 时,你只是在声明它,而不是定义它。当带初始化的 extern 变量被声明时,它也被视为该变量的定义。
487. Assume there are n people seated at a circular table with the names A, B, C, D,...
假设有 n 个人坐在一张圆桌旁,名字分别为 A、B、C、D、...
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4da3 | 官方: 否 | 付费: 否
答案:
You must output all n people (in order) beginning with the supplied name if you are given a name. Consider the following six people: A B C D E F and the given name is ‘C’. You need to print: C D E F A B
如果给定一个名字,你必须按顺序输出所有 n 个人(从给定的名字开始)。考虑以下六个人:A B C D E F,给定名字为‘C’。你需要打印:C D E F A B
This question is based on circular array implementation. Creating an auxiliary array of size 2*n and storing it in another array is a straightforward method. Now we simply print n elements beginning from any given index. For example, you make the auxiliary array as follows: A B C D E F A B C D E F. You then print the following six elements: A B C D E F A B C D E F.
这个问题基于循环数组的实现。创建一个大小为2*n的辅助数组并将其存储到另一个数组中是一种直接的方法。现在我们只需从任意给定索引开始打印n个元素。例如,你创建如下的辅助数组:A B C D E F A B C D E F。然后打印以下六个元素:A B C D E F A B C D E F。
This method takes O(n) time but adds O(n) space to the solution. Dealing with circular arrays with the same array is an efficient solution. It is worth noting that after the n-th index, the next index will start from 0 which can be obtained using the mod operator. This makes it easy for us to access the elements of the circular array within the specified array without requiring any more space.
这种方法需要O(n)时间,但给解决方案增加了O(n)的空间。使用同一数组处理循环数组是一种高效的解决方案。值得注意的是,在第n个索引之后,下一个索引将从0开始,这可以使用取模运算符获得。这使得我们能够在指定数组内方便地访问循环数组的元素,而不需要额外的空间。
include <bits/stdc++.h>
using namespace std;
using namespace std;
// function to output circular seating arrangement starting
// 函数用于输出从任意给定索引开始的循环座位安排
// from any given index.
// 从任意给定索引开始。
void display(char a[], int N, int index)
void display(char a[], int N, int index)
{
// print from ind-th index to (n+i)th index.
// 从第ind个索引打印到第(n+i)个索引。
for (int i = index; i < N + index; i++)
for (int i = index; i < N + index; i++)
cout << a[(i % N)] << " ";
cout << a[(i % N)] << " ";
}
// Driver code
// 驱动代码
int main()
int main()
{
char a[] = { 'A', 'B', 'C', 'D', 'E', 'F' };
char a[] = { 'A', 'B', 'C', 'D', 'E', 'F' };
int N = sizeof(a) / sizeof(a[0]);
int N = sizeof(a) / sizeof(a[0]);
print(a, N, 2);
print(a, N, 2);
return 0;
return 0;
}
Output:
输出:
C D E F A B
C D E F A B
The above implementation takes O(n) time and O(1) space.
上述实现需要 O(n) 时间复杂度和 O(1) 空间复杂度。
- Data Science
- All Events
- My Events
488. Explain how the elements of a two dimensional array are stored in the memory.
解释二维数组的元素在内存中是如何存储的。
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4da6 | 官方: 否 | 付费: 否
答案:
The members of a 2D array could be stored in the memory using two different ways. - Row-Major Order: In row-major ordering, all of the 2D array's rows are sequentially stored in memory. The first row of the array is completely stored in memory, followed by the second row, and so on until the last row is completely recorded in memory.
二维数组的成员可以通过两种不同的方式存储在内存中。- 行优先顺序:在行优先顺序中,二维数组的所有行按顺序存储在内存中。数组的第一行完全存储在内存中,接着是第二行,以此类推,直到最后一行完全记录在内存中。
- Column-Major Order: In column-major ordering, all of the 2D array's columns are stored in the memory in the same order. The first column of the array is completely stored in memory, followed by the second row, and so on until the last column of the array is completely stored in memory.
489. List the differences between superclass and subclass in inheritance in context of OOPS.
列出在面向对象编程的继承上下文中,超类和子类之间的区别。
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4db5 | 官方: 否 | 付费: 否
答案:
Inheritance is an OOP concept. It allows a new class to access the methods and properties of an existing class. The Superclass is the inherited class, and the Subclass is the derived class. Vehicle, for example, is a Superclass with the subclasses Car, Truck, and Motorcycle. The superclass Vehicle includes the subclasses Car, Truck, and Motorcycle. They share common characteristics like speed, colour, and so on, but they also have distinct characteristics, such as the count of wheels in a car compared to the count of wheels in a motorcycle.
继承是面向对象编程中的一个概念。它允许新类访问现有类的方法和属性。超类是被继承的类,而子类是派生类。例如,Vehicle 是超类,其子类有 Car、Truck 和 Motorcycle。超类 Vehicle 包含子类 Car、Truck 和 Motorcycle。它们共享共同的特征,如速度、颜色等,但也有彼此不同的特征,例如汽车的车轮数量与摩托车的车轮数量相比不同。
| Parameter 参数 | Superclass 超类 | Subclass 子类 |
|---|---|---|
| The Superclass is the existing class through which the new classes are derived when inheritance is used. 定义 | The Subclass is the class which inherits the methods and properties from the Superclass when inheritance is used. 超类是现有类,当使用继承时,新类从该类派生。 | 子类是当使用继承时,从超类继承方法和属性的类。 |
| Synonyms 同义词 | Superclass is also known as parent class or base class. 超类也称为父类或基类。 | Subclass is also known as child class or derived class. 子类也称为子类或派生类。 |
| Functionality 功能 | The attributes and methods of the derived class cannot be used by a superclass. 派生类的属性和方法不能被超类使用。 | A subclass can use the attributes and methods of the base class. 子类可以使用基类的属性和方法。 |
| Single-Level-Inheritance 单级继承 | There exists one superclass 存在一个超类 | There exists one subclass. 存在一个子类。 |
| Hierarchical Inheritance 层次继承 | There exists one superclass 存在一个超类 | There exist many subclasses. 存在多个子类。 |
| Multiple Inheritance 多重继承 | There exist many superclasses. 存在多个超类。 | There exists one subclass. 存在一个子类。 |
490. Predict the output of the code below.
预测以下代码的输出。
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4db8 | 官方: 否 | 付费: 否
答案:
// Java
// Java
class ABC
class ABC
{
static int x;
static int x;
static
static
{
System.out.println("X");
System.out.println("X");
x = 50;
x = 50;
}
}
public class StaticBlock
public class StaticBlock
{
static
static
{
System.out.println("Y");
System.out.println("Y");
}
public static void main(String[] args)
public static void main(String[] args)
{
System.out.println("Z");
System.out.println("Z");
System.out.println(ABC.x);
System.out.println(ABC.x);
}
}
Output
输出
Y
Y
Z
Z
X
X
50
Explanation:
说明:
First, the static block within the calling class for the main method will be executed. As a result, the letter 'Y' will be produced first. The main method is then called, and the sequence is now maintained as expected.
首先,包含main方法的调用类中的静态块将被执行。因此,字母'Y'将首先被输出。之后调用main方法,顺序现在按预期保持。
Successful Tech Career for FREE!
免费开启成功的科技职业生涯!
Successful Tech Career!
成功的技术职业生涯!
Interview Process
面试流程
CTC & Designation
CTC与职位级别
Projects on the Job
工作项目
Referral System
推荐系统
Try It Out
试试看
2 Lakh+ Roadmaps Created
已生成20万+职业规划
491. Discuss checkpoints and their advantages in DBMS.
讨论数据库管理系统(DBMS)中的检查点及其优势。
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4dbe | 官方: 否 | 付费: 否
答案:
When transaction logs are produced in a real-time setting, they consume a significant amount of storage space. Keeping track of each update and maintaining it may also take up more physical space in the system. As the transaction log file grows in size, it may eventually become unmanageable. Checkpoints can be used to address this. A Checkpoint is a way for deleting all prior transaction logs and saving them in a permanent storage location.
在实时环境中生成事务日志时,它们会占用大量存储空间。跟踪每次更新并维护它们也可能占用系统更多的物理空间。随着事务日志文件不断增大,最终可能变得难以管理。检查点可以用来解决这个问题。检查点是一种删除所有先前事务日志并将其保存到永久存储位置的方法。
The checkpoint specifies a time when the DBMS was in a steady-state and all transactions had been committed. These checkpoints are tracked during transaction execution. Transaction log files will be generated after the execution. The log file is discarded when it reaches the savepoint/checkpoint by recording its updates to the database. Then a new log is produced with the transaction's upcoming execution actions, which is updated till the next checkpoint, and the process is continued.
检查点指定了一个数据库管理系统处于稳定状态且所有事务均已提交的时间。这些检查点在事务执行过程中被跟踪。事务日志文件将在执行后生成。当日志文件达到保存点/检查点时,通过将其更新记录到数据库来丢弃该日志文件。然后为事务接下来的执行操作生成新日志,该日志会不断更新直到下一个检查点,并且该过程会继续进行。
A checkpoint is a functionality that provides a value of C in ACID-compliant to RDBMS. If the database unexpectedly shuts down, a checkpoint is utilised to recover. Checkpoints write all changed pages from logs relay to the data file, i.e. from a buffer to a physical disc, at regular intervals. It's also known as "dirty page hardening." It's a specialised procedure that SQL Server runs at predetermined times. A checkpoint serves as a synchronisation point between both the database and the transaction log.
检查点是一种为符合ACID规范的关系型数据库管理系统提供C值(一致性)的功能。如果数据库意外关闭,则利用检查点进行恢复。检查点会定期将日志中继中的已更改页面(即从缓冲区到物理磁盘)写入数据文件。这也被称为“脏页固化”。这是SQL Server在预定时间执行的专门过程。检查点充当数据库和事务日志之间的同步点。
The following are some of the benefits of using checkpoints: - It makes the data recovery procedure go faster.
以下是使用检查点的一些好处:- 它使数据恢复过程更快。
- The majority of DBMS packages perform self-checkpoints.
- To avoid unnecessary redo operations, checkpoint records in the log file are employed.
- It has very low overhead and could be done very often because the modified pages are flushed away continuously in the background.
492. Differentiate between DataSet and DataReader in context of ASP.NET.
在ASP.NET的上下文中,区分DataSet和DataReader。
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4dc1 | 官方: 否 | 付费: 否
答案:
Both DataSet and DataReader are extensively used in asp.net applications to get/fetch data from the database. The following are some key distinctions between DataSet and DataReader: - Read-only and forward-only data from a database are retrieved using DataReader. It allows you to expose data from a database, whereas a DataSet is a set of in-memory tables.
DataSet和DataReader都广泛用于ASP.NET应用程序中,以从数据库获取/提取数据。以下是DataSet和DataReader之间的一些关键区别:- 使用DataReader从数据库检索只读且仅向前的数据。它允许你暴露来自数据库的数据,而DataSet是一组内存中的表。
- DataReader retrieves entries from a database, saves them in a network buffer, and returns them whenever a request is made. It does not wait for the whole query to complete before releasing the records. As a result, it is much faster than the DataSet, which releases the data when it has loaded all of it into memory.
- DataReader works in the same way as a forward-only recordset. It fetches one row at a time, resulting in lower network costs than DataSet, which gets all rows at once, i.e. all data from the datasource to its memory region. In comparison to DataReader, DataSet has additional system overheads.
- DataReader retrieves information from a single table, whereas DataSet retrieves information from numerous tables. Because DataReader can only read information from a single table, no relationships between tables can be maintained, but DataSet can keep relationships between several tables.
- DataReader is a connected architecture in which the data is available as long as the database connection is open, whereas DataSet is a disconnected architecture in which the connection is automatically opened, the data is fetched into memory, and the connection is closed when done. DataReader requires manual connection opening and closing in code, whereas DataSet does so automatically.
- DataSet can be serialised and represented in XML, allowing it to be readily shared across layers, whereas DataReader cannot be serialised.
493. Explain Regression Testing in context of Software Engineering?
在软件工程背景下,解释什么是回归测试?
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4dd4 | 官方: 否 | 付费: 否
答案:
Regression testing is a sort of software testing used to ensure that recent modifications to a programme or code have not had an unfavourable effect on existing functionality. Regression testing is simply a sample of all or a portion of the tests that have been performed. These test cases are performed again to check that the current functionality is functioning properly. This test ensures that new code modifications do not have unintended consequences for existing functions. It ensures that the above script is still valid once the latest code modifications are made.
回归测试是一种软件测试类型,用于确保对程序或代码的近期修改没有对现有功能产生不利影响。回归测试简单来说就是对已执行测试的全部或部分进行抽样。这些测试用例会再次执行,以检查当前功能是否正常运行。该测试确保新的代码修改不会对现有功能造成意外后果。它确保在最新的代码修改完成后,上述脚本仍然有效。
494. Explain the term Coupling in context of Software Engineering.
在软件工程背景下,解释术语“耦合”。
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4dd9 | 官方: 否 | 付费: 否
答案:
The extent of interdependence between the modules is measured by coupling. Low coupling is a sign of good software. The different types of coupling are: - Data Coupling: The modules are considered to be data coupled if their dependencies are due to the fact that they interact by transmitting only data. The components in data coupling are independent of one another and communicate via data. Tramp data is not included in module communications.
模块之间的相互依赖程度通过耦合来衡量。低耦合是良好软件的标志。耦合的不同类型包括:- 数据耦合:如果模块之间的依赖关系是由于它们仅通过传输数据进行交互,则被视为数据耦合。数据耦合中的组件相互独立,并通过数据进行通信。模块通信中不包括跳变数据(Tramp data)。
- Stamp Coupling: Stamp coupling involves passing the entire data structure from one module to another. As a result, tramp data is involved.
- Control Coupling: The modules are considered to be control coupled if they communicate via passing control information.
- External Coupling: External coupling means that the modules are dependent on other modules that are not part of the program being created or a certain sort of hardware.
- Common Coupling: Shared data, such as global data structures, exists between the modules. Changes in global data necessitate a retracement of all modules that access that data in order to assess the impact of the modification. As a result, it has drawbacks such as difficulties reusing modules, limited control over data access, and low maintainability.
- Content Coupling: One module can manipulate the data of another, or control flow can be sent from one module to another in a content coupling. This is the most perilous type of coupling and should be avoided if possible.
495. What is Open Shortest Path First (OSPF) in Computer Networks? What criteria should two routers fulfil so that a neighbourship in OSPF can be formed?
在计算机网络中,什么是开放最短路径优先(OSPF)?在OSPF中,两个路由器应满足什么条件才能形成邻居关系?
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4ddc | 官方: 否 | 付费: 否
答案:
OSPF is a link-state routing protocol that uses its own shortest path first (SPF) algorithm to discover the best path between the source and destination routers. A link-state routing protocol employs the idea of triggered updates, in which updates are only triggered when a change in the learnt routing table is detected, as opposed to the distance-vector routing protocol, in which the routing table is exchanged over a period of time.
OSPF是一种链路状态路由协议,它使用自己的最短路径优先(SPF)算法来发现源路由器和目标路由器之间的最佳路径。链路状态路由协议采用触发更新的理念,即仅在检测到学习到的路由表发生变化时才触发更新,这与距离向量路由协议不同,后者会在一段时间内交换路由表。
Open shortest path first (OSPF) is an Interior Gateway Protocol (IGP) established by the Internet Engineering Task Force (IETF). It is a protocol that tries to move packets inside a huge autonomous system or routing domain. It's a network layer protocol which uses AD value 110 and runs on protocol number 89. OSPF employs the multicast address 224.0.0.5 for normal communications and 224.0.0.6 for updates to designated routers (DRs) and backup designated routers (BDRs).
开放最短路径优先(OSPF)是由互联网工程任务组(IETF)建立的内部网关协议(IGP)。它是一种协议,旨在在大型自治系统或路由域内移动数据包。它是一种网络层协议,使用AD值110,运行在协议号89上。OSPF使用多播地址224.0.0.5进行正常通信,使用224.0.0.6向指定路由器(DRs)和备份指定路由器(BDRs)发送更新。
In OSPF, there are requirements for both routers to meet in order to form neighborship: - Both the routers should be found in the same region.
在OSPF中,两个路由器需要满足以下要求才能形成邻居关系:- 两个路由器应位于同一区域。
- The router-id should be unique.
- The same subnet mask must be used.
- Hello, and the timer for the dead must be the same as well.
- The stub flag should be identical.
- Authentication must be identical.
496. What is a proxy server in Computer Networks? How does the proxy safeguard computer privacy and data?
在计算机网络中,什么是代理服务器?代理如何保护计算机隐私和数据?
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4ddf | 官方: 否 | 付费: 否
答案:
A proxy server is a device or router that acts as a bridge between users and the internet. As a result, it aids in preventing cyber intruders from gaining access to a private network. It is a server that acts as an "intermediary" between end-users and the websites they browse online. An IP address is used when a device connects to the internet. This is comparable to your home's street address in that it directs incoming data and provides a return address for some other devices to verify. A proxy server is effectively a machine on the internet with its own IP address.
代理服务器是一种设备或路由器,充当用户和互联网之间的桥梁。因此,它有助于防止网络入侵者访问私有网络。它是一种服务器,充当最终用户和他们在线浏览的网站之间的“中介”。当设备连接到互联网时,会使用一个IP地址。这类似于你家的街道地址,因为它指导传入数据并为其他设备提供返回地址以供验证。代理服务器实际上是互联网上一台拥有自己IP地址的机器。
A proxy server serves as both a firewall and a filter. A proxy meant to safeguard data and privacy can be selected by an end-user or a network administrator. This scrutinises the data that enters and exits your network. It then applies restrictions to prevent you from exposing your digital address to the rest of the world. Hackers or other undesirable actors only see the proxy's IP address. People online cannot access your personal information, schedules, applications, or files without your specific IP address.
代理服务器既充当防火墙,也充当过滤器。最终用户或网络管理员可以选择一个旨在保护数据和隐私的代理。这会审查进入和离开你网络的数据。然后它应用限制,防止你将数字地址暴露给外界。黑客或其他不良行为者只能看到代理的IP地址。没有你的特定IP地址,在线人员无法访问你的个人信息、日程、应用程序或文件。
With this in place, web requests are routed to the proxy, which further connects to the internet and retrieves the information you require. Passwords and other private information are protected further if the server supports encryption.
有了这个设置,网页请求会被路由到代理,代理进一步连接到互联网并获取你所需的信息。如果服务器支持加密,密码和其他私人信息会得到进一步保护。
497. What do you know about VPN and its types in Computer Networks? List the advantages of using a VPN.
关于计算机网络中的VPN及其类型,你了解什么?列出使用VPN的优点。
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4de2 | 官方: 否 | 付费: 否
答案:
The Virtual Private Network (VPN) is a private internet-based WAN (Wide Area Network). A VPN is an encrypted link between a device and a network via the Internet. The encrypted connection aids in the secure transmission of sensitive data. It prohibits unauthorised individuals from listening in on traffic. It enables the building of a secure tunnel (protected network) via the internet between separate networks (public network). A client can access the organization's network remotely by using the VPN.
虚拟专用网络(VPN)是一种基于互联网的私有广域网(WAN)。VPN是通过互联网在设备和网络之间建立的加密链接。加密连接有助于安全传输敏感数据。它禁止未经授权的人员窃听流量。它允许通过互联网在不同网络(公共网络)之间建立安全隧道(受保护网络)。客户端可以通过VPN远程访问组织的网络。
The types of VPN are: - Remote access: A remote-access VPN establishes a secure connection between a device and the corporate network. Endpoints are computing devices such as laptops, tablets, and smartphones. Endpoint security checks may now be performed on endpoints to ensure they satisfy a specific posture before joining thanks to advancements in VPN technology.
VPN的类型包括:- 远程访问:远程访问VPN在设备和公司网络之间建立安全连接。端点是计算设备,如笔记本电脑、平板电脑和智能手机。由于VPN技术的进步,现在可以在端点加入前执行端点安全检查,以确保它们满足特定状态。
Site-to-site: A site-to-site VPN establishes an Internet connection between the corporate office and the branch offices. When the distance between these offices makes direct network connections impossible, site-to-site VPNs are employed. To create and maintain a connection, specialised equipment is necessary.
The following are some of the benefits of using a VPN : - VPNs are used to link offices in distinct geographical regions via the internet and are less expensive than WAN connections.使用VPN的一些好处如下:- VPN用于通过互联网连接不同地理区域的办公室,并且比WAN连接更便宜。
- VPNs are used to safeguard transactions and move secret data between workplaces in different parts of the world.
- By utilising virtualization, a VPN protects an organization's information safe from any possible threats or invasions.
- VPN encrypts internet traffic and hides the user's identity online.
498. Why Mphasis?
为什么选择Mphasis?
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4e0f | 官方: 否 | 付费: 否
答案:
Mphasis promotes a culture of continual learning in order to prepare the employees for the future. They provide a learning environment that combines Instructor-Led Training (ILTs), Virtual ILTs, and eLearning in a holistic manner. The employees can choose from a variety of topics and courses to help them advance their careers.
Mphasis倡导持续学习的文化,旨在为员工未来做好准备。他们提供一个结合了讲师引导培训(ILTs)、虚拟ILTs和在线学习的整体学习环境。员工可以从多种主题和课程中选择,以促进职业发展。
499. Is it easy to crack Mphasis online test?
破解Mphasis在线测试容易吗?
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4e12 | 官方: 否 | 付费: 否
答案:
There were four categories in the Mphasis Amcat online test: aptitude, verbal, logical, and programming MCQs. The aptitude, verbal, and logical tests should be simple. The MCQ questions for Mphasis programming are generally trickier. You must attentively read the questions and respond to them.
Mphasis Amcat在线测试分为四类:能力测试、语言测试、逻辑测试和编程选择题。能力和逻辑测试应该相对简单。Mphasis编程部分的选择题通常更具挑战性。您必须仔细阅读问题并作答。
500. Is there a coding round for Mphasis?
Mphasis有编程环节吗?
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4e15 | 官方: 否 | 付费: 否
答案:
Mphasis can have a coding round or a technical interview round after the online test. There are usually two programming questions in it. The candidate has the option of writing the program in C or C++, depending on his or her preference.
Mphasis在在线测试后可能包含编程环节或技术面试环节。通常会有两个编程问题。考生可以根据自己的偏好选择用C或C++编写程序。
501. Is there any eligibility criteria for Mphasis?
Mphasis有资格要求吗?
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4e18 | 官方: 否 | 付费: 否
答案:
The following are the Mphasis eligibility criteria: - The candidate has to be a citizen of India.
Mphasis的资格要求如下:- 候选人必须是印度公民。
- Minimum of 60% in graduation or a 6.3 CGPA, and no current backlogs (min 55 per cent and above is considered for the Maharashtra students)
- The candidate must be able to communicate effectively.
- To be assigned to any of Mphasis' operating locations, the candidate must be adaptable.
- The candidate must be adaptable to any technology and the work schedules that will be assigned to them for training and subsequent deployment.
- Basic computer programming skills are required.
502. How long is the Interview Process at Mphasis?
Mphasis的面试流程有多长?
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4e1b | 官方: 否 | 付费: 否
答案:
The hiring procedure for shortlisted applicants takes 10 to 15 days on average. It may differ if the hiring process includes a client interview.
对于入围候选人的招聘流程平均需要10到15天。如果招聘流程包含客户面试,时间可能会有所不同。
503. What is the salary for freshers (Software Engineers) in Mphasis?
Mphasis初级软件工程师的薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, mphasis, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Mphasis
- id: 69b37bd658d557c902bb4e1e | 官方: 否 | 付费: 否
答案:
For people with less than one year of experience to three years of experience, the average Mphasis Associate Software Engineer salary in India is around 3.7 lakhs per year.
对于经验不到一年至三年的员工,Mphasis印度区助理软件工程师的平均年薪约为37万卢比。
504. Write a program that returns the next permutation of the number given in the array.
编写一个程序,返回数组中给定数字的下一个排列。
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb6143 | 官方: 否 | 付费: 否
答案:
For example - the next permutation of arr = [1,2,3] is [1,3,2].
例如 - arr = [1,2,3] 的下一个排列是 [1,3,2]。
For solving this problem, we can find the peak element and then search for the element that has the next lowest element. Then we can sort the element. The element will be the next permutation.
要解决此问题,我们可以找到峰值元素,然后搜索具有次低元素(即下一个最小元素)的元素。然后我们可以对元素进行排序。该元素将是下一个排列。
public void next permutation(int[] nums) {
public void next permutation(int[] nums) {
int peakIndex = 0;
int peakIndex = 0;
//Finding the peak index
//查找峰值索引
for(int i = 1; i < nums.length; i++){
for(int i = 1; i < nums.length; i++){
if(nums[i] > nums[i-1])
if(nums[i] > nums[i-1])
peakIndex = i;
peakIndex = i;
}
//When the index is 0 the next permutation
//当索引为0时,下一个排列
//will be the first. So return by sorting.
//将是第一个。因此通过排序返回。
if(peakIndex == 0){
if(peakIndex == 0){
Arrays.sort(nums);
Arrays.sort(nums);
return;
return;
}
//Adjusting Pointers
//调整指针
int prevIndex = peakIndex - 1;
int prevIndex = peakIndex - 1;
int index = prevIndex;
int index = prevIndex;
int currIndex = peakIndex;
int currIndex = peakIndex;
//Finding the next greater element index
//找到下一个更大的元素索引
while(currIndex < nums.length && nums[currIndex] > nums[index]){
while(currIndex < nums.length && nums[currIndex] > nums[index]){
prevIndex = currIndex;
prevIndex = currIndex;
currIndex++;
currIndex++;
}
//swapping the value of that location
//交换该位置的值
int temp = nums[index];
int temp = nums[index];
nums[index] = nums[prevIndex];
nums[index] = nums[prevIndex];
nums[prevIndex] = temp;
nums[prevIndex] = temp;
//Changing the values by sorting
//通过排序改变值
Arrays.sort(nums, index+1, nums.length);
Arrays.sort(nums, index+1, nums.length);
}
505. Given array nums containing n numbers of distinct values in the range [0, n], return the only value that is missing from the array.
给定数组 nums,包含范围 [0, n] 内的 n 个不同数值,返回数组中唯一缺失的值。
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb6146 | 官方: 否 | 付费: 否
答案:
We can follow the approach of mathematics by the formula of (n*n + n) / 2. This calculates the actual sum that needs to be in the array. And if we sum the array. Then the difference will be the answer.
我们可以采用数学方法,使用公式 (n*n + n) / 2。这计算了数组中应有的实际总和。如果我们对数组求和,那么差值就是答案。
//Method that returns the missing value
//返回缺失值的方法
public int missingNumber(int[] nums) {
public int missingNumber(int[] nums) {
int sumArray = 0;
int sumArray = 0;
int n = nums.length;
int n = nums.length;
// Finding the sum of the array
// 计算数组的总和
for(int i = 0; i<n; i++)
for(int i = 0; i<n; i++)
sumArray += nums[i];
sumArray += nums[i];
// Calculating actual sum.
// 计算实际总和。
int ActualSum = (n*n + n)/2;
int ActualSum = (n*n + n)/2;
return ActualSum - sumArray;
return ActualSum - sumArray;
}
506. Given an array of distinct integer candidates and the desired integer target, produce a list of all the possible combinations of candidates where the sum of the chosen numbers is the target. You may return the combinations in any order.
给定一个包含不同整数的候选数组 candidates 和目标整数 target,生成所有可能的组合列表,其中所选数字的总和等于 target。你可以按任意顺序返回组合。
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb614c | 官方: 否 | 付费: 否
答案:
You may choose the same number from the candidates array an unlimited number of times. Whether two combinations are unique depends on the frequency of at least one of the chosen numbers.
你可以无限次地从候选数组中选择同一个数字。两个组合是否唯一取决于所选数字中至少一个数字的出现频率。
Example - Input: candidates = [2,3,6,7], target = 7
示例 - 输入:candidates = [2,3,6,7], target = 7
Output: [[2,2,3],[7]]This problem seems that we can solve using the backtracking approach. So the solution will be.
输出:[[2,2,3],[7]]这个问题似乎可以使用回溯法来解决。所以解决方案如下。
class Solution {
class Solution {
List<List> ans;
List<List> ans;
//Helper method that generates the result.
// 生成结果的辅助方法。
private void findSum(int i, int target, Listconsider, int[] candidates){
private void findSum(int i, int target, Listconsider, int[] candidates){
//If reaches the target then add one of the possible answers
// 如果达到目标值,则将可能答案之一添加到
//to the answer array and terminate the recursive call
// 答案数组中,并终止递归调用
if(target == 0){
if(target == 0){
ans.add(new ArrayList<>(consider));
ans.add(new ArrayList<>(consider));
return;
return;
}
//If the index array is out of bound then terminate the call.
// 如果索引数组越界,则终止调用。
else if(i == candidates.length)
else if(i == candidates.length)
return;
return;
//If the target goes negative then also terminate the call.
// 如果目标值变为负数,则同样终止调用。
else if(target < 0)
else if(target < 0)
return;
return;
else{
否则{
//Skipping the element and finding the sum with the next
//跳过该元素,并求与下一个元素的和
//Sub problem
//子问题
findSum(i+1, target, consider, candidates);
findSum(i+1, target, consider, candidates);
//Adding the element to the list and trying the possibility
//将元素添加到列表中,并尝试可能性
//with the element and recursively calling for the next
//使用该元素,并递归调用以处理下一个
//sub-problem
//子问题
consider.add(candidates[i]);
consider.add(candidates[i]);
findSum(i, target-candidates[i], consider, candidates);
findSum(i, target-candidates[i], consider, candidates);
//Backtracking. Removing the element from the list and
//回溯。从列表中移除该元素,并
//recursively calling for solving the next sub-problem.
//递归调用以解决下一个子问题。
consider.remove(consider.size() - 1);
consider.remove(consider.size() - 1);
}
}
public List<List
public List<List> combination(int[] candidates, int target) {
ans = new ArrayList<>();
ans = new ArrayList<>();
//Calling helper function for solving the problem
//调用辅助函数以解决问题
findSum(0, target, new ArrayList<>(), candidates);
findSum(0, target, new ArrayList<>(), candidates);
return ans;
return ans;
}
}
507. The array nums have an integer element at each position. At each position in the array, the element represents the length of the maximum jump you can from the position.
数组 nums 的每个位置都有一个整数元素。在数组的每个位置,该元素表示从该位置可以进行的最大跳跃长度。
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb614f | 官方: 否 | 付费: 否
答案:
You are initially in the first position. Write a program that returns true if it reaches the last index from the first index. Otherwise, return false.
你最初位于第一个位置。编写一个程序,如果从第一个索引能到达最后一个索引则返回 true。否则,返回 false。
Example -
示例 -
Input: nums = [2,3,1,1,4]Output: trueIn the above example. We can reach the last index either from the 0 indexes or 1 index. 2. Input: nums = [3,2,1,0,4]Output: falseIn the above example, we cannot reach the last index if any steps start from 0 so will return false.
- 输入:nums = [2,3,1,1,4]输出:true在上面的示例中,我们可以从0索引或1索引到达最后一个索引。 2. 输入:nums = [3,2,1,0,4]输出:false在上面的示例中,如果从0开始的任何步骤都无法到达最后索引,因此将返回 false。
This problem seems to be a Dynamic programming problem. So we can try all the possibilities by using the top-down approach and use memoization to optimize the recursive calls. So the solution is-
这个问题似乎是一个动态规划问题。因此,我们可以使用自顶向下的方法尝试所有可能性,并使用备忘录来优化递归调用。所以解决方案是 -
class Solution {
class Solution {
int[] nums;
int[] nums;
Boolean[] dp;
Boolean[] dp;
//Helper Method that returns the result
//辅助方法,返回结果
private boolean solution(int i){
private boolean solution(int i){
//Base Cases
//基础情况
if(i == nums.length-1)
if(i == nums.length-1)
return true;
返回 true;
if(i >= nums.length)
if(i >= nums.length)
return false;
返回 false;
//Returning already computed result.
//返回已计算的结果。
//Overlapping Problems
//重叠子问题
if(dp[i] != null)
if(dp[i] != null)
return dp[i];
return dp[i];
//Trying all the possibilities by going to
//尝试所有可能性,通过从第一个索引
//every step from the first index
//走到每一步
for(int j = 1; j <= nums[i]; j++){
for(int j = 1; j <= nums[i]; j++){
boolean choise = solution(i+j);
boolean choise = solution(i+j);
//Memoization. Storing the computed result
//记忆化。存储计算结果
//So that it cannot be recomputed.
//这样不会重复计算。
if(choise) return dp[i] = true;
if(choise) return dp[i] = true;
}
return dp[i] = false;
return dp[i] = false;
}
public boolean canJump(int[] nums) {
public boolean canJump(int[] nums) {
this.nums = nums;
this.nums = nums;
dp = new Boolean[nums.length+1];
dp = new Boolean[nums.length+1];
//Calling helper method to set the answer.
//调用辅助方法来设置答案。
boolean ans = solution(0);
boolean ans = solution(0);
return ans;
return ans;
}
}
508. Write a program that returns true if the string contains the same frequency in for every character. Otherwise, return false.
编写一个程序,如果字符串中每个字符出现的频率相同,则返回true,否则返回false。
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb6152 | 官方: 否 | 付费: 否
答案:
We can solve this problem by counting the frequency in the hash and can check if all the value in the hash is the same or not.
我们可以通过在哈希表中统计频率来解决此问题,并检查哈希表中所有值是否相同。
public boolean areOccurrencesEqual(String s) {
public boolean areOccurrencesEqual(String s) {
int max = 0;
int max = 0;
char[] hash = new char[26];
char[] hash = new char[26];
//Counting the frequency and getting the max frequency
//计算频率并获取最大频率
for(int i = 0; i < s.length(); i++){
for(int i = 0; i < s.length(); i++){
hash[s.charAt(i)-'a']++;
hash[s.charAt(i)-'a']++;
max = Math.max(max, hash[s.charAt(i)-'a']);
max = Math.max(max, hash[s.charAt(i)-'a']);
}
//Checking if the frequency matches with the max number
//检查频率是否与最大值匹配
for(int i = 0; i < 26; i++){
for(int i = 0; i < 26; i++){
if(hash[i] != 0 && hash[i] != max)
if(hash[i] != 0 && hash[i] != max)
return false;
返回 false;
}
return true;
返回 true;
}
509. Write a program to reverse the singly linked list.
编写程序来反转单链表。
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb6155 | 官方: 否 | 付费: 否
答案:
We can use a recursive approach to reverse the linked list. We can use head recursion and while returning time, we can adjust the pointers. The Solution is -
我们可以使用递归方法来反转链表。我们可以使用头递归,在返回时调整指针。解决方案如下 -
class Solution {
class Solution {
private ListNode reverse(ListNode head){
private ListNode reverse(ListNode head){
if(head == null || head.next == null){
if(head == null || head.next == null){
return head;
return head;
}
// Recursively calling function that returns the linked list for sub problem
// 递归调用函数,该函数返回子问题的链表
ListNode x = reverse(head.next);
ListNode x = reverse(head.next);
//Adjusting the pointers
//调整指针
head.next.next = head;
head.next.next = head;
head.next = null;
head.next = null;
return x;
return x;
}
public ListNode reverseList(ListNode head) {
public ListNode reverseList(ListNode head) {
//Calling helper method that returns reversed liked list
//调用返回反转链表的辅助方法
return reverse(head);
return reverse(head);
}
}
510. Write a program to print the nth Tribonacci number. A Tribonacci number is a number that has the value by adding the previous 3 values.
编写一个程序来打印第n个Tribonacci数。Tribonacci数是将前3个值相加而得到的数。
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb6158 | 官方: 否 | 付费: 否
答案:
We can follow the approach of dynamic programming by storing the last 3 values and updating the values on iteration. The solution is -
我们可以采用动态规划的方法,存储最后3个值并在迭代中更新这些值。解决方案是 -
class Solution {
class Solution {
int trib(int n, int [] dp){
int trib(int n, int [] dp){
//Base case for terminating the recursive call
//终止递归调用的基本情况
if(n == 0 || n == 1)
if(n == 0 || n == 1)
return n;
返回 n;
if(n == 2)
if(n == 2)
return 1;
return 1;
//Finding the result not already computed
//查找尚未计算的结果
if(dp[n] == 0){
if(dp[n] == 0){
dp[n] = trib(n-1, dp) + trib(n-2, dp) + trib(n-3, dp);
dp[n] = trib(n-1, dp) + trib(n-2, dp) + trib(n-3, dp);
}
//Returning already computed result or the result that
//返回已计算的结果,或者最近计算出的结果
//latest computed
//最近计算出的结果
return dp[n];
return dp[n];
}
public int tribonacci(int n) {
public int tribonacci(int n) {
int []dp = new int[n+1];
int []dp = new int[n+1];
//Calling helper method that computes and returns the result.
//调用辅助方法,该方法计算并返回结果。
return trib(n, dp);
return trib(n, dp);
}
}
511. Write a program to solve the n-queen problem. You will be given an N x N board. And the task is to place the queen in a position such that it cannot overlap the queen diagonally, vertically, or diagonally.
编写一个程序解决n皇后问题。你会得到一个N x N的棋盘。任务是放置皇后,使其不能与其他皇后在水平、垂直或斜线方向上重叠。
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb615b | 官方: 否 | 付费: 否
答案:
For input 4, there can be 2 possible solutions, So you need to return that.
对于输入4,可以有2种可能的解决方案,所以你需要返回这个结果。
We can solve this problem with the help of backtracking. We can try every possibility and we can check if the queen does not get overlapped. So the solution will be -
我们可以通过回溯法来解决这个问题。我们可以尝试每一种可能性,并检查皇后是否不会重叠。所以解决方案将是 -
class Solution {
class Solution {
//HashMap that keeps track of the attacking position of the queen
//HashMap用于跟踪皇后的攻击位置
HashMap<Integer, Boolean> posDiag;
HashMap<Integer, Boolean> posDiag;
HashMap<Integer, Boolean> negDiag;
HashMap<Integer, Boolean> negDiag;
HashMap<Integer, Boolean> vertical;
HashMap<Integer, Boolean> 垂直;
//List that stores the possible answers
//存储可能答案的列表
List<List> ans;
List<List> 答案;
int N;
int N;
// Helper method that generates the answer
// 生成答案的辅助方法
private void solution(int i, Listres){
私有 解决方案(整数 i, Listres){
//If it reaches the end then that will be a possible solution.
//如果到达末尾,则那将是一个可能的解决方案。
//So we will add this to the list.
//所以我们将把它添加到列表中。
if(i == N){
如果(i == N){
ans.add(new ArrayList(res));
答案.add(新的 ArrayList(res));
return;
return;
}
// Checking if every position is not attacked by checking from
//通过检查每个位置是否不被攻击来检查
// hashmap. And if not attacking then the recursive calling the next solution.
//hashmap。如果不攻击,则递归调用下一个解决方案。
for(int j = 0; j < N; j++){
对于(整数 j = 0; j < N; j++){
int posIndex = i+j;
整数 posIndex = i+j;
int negIndex = i-j;
整数 negIndex = i-j;
if(posDiag.containsKey(posIndex) ||
如果(posDiag.containsKey(posIndex) ||
negDiag.containsKey(negIndex) ||
negDiag.containsKey(negIndex) ||
verticle.containsKey(j)) continue;
verticle.containsKey(j)) continue;
posDiag.put(posIndex, true);
posDiag.put(posIndex, true);
negDiag.put(negIndex, true);
negDiag.put(negIndex, true);
//Adding the possible answer to the answer list
//将可能的答案添加到答案列表中
verticle.put(j, true);
verticle.put(j, true);
String old = res.get(i);
String old = res.get(i);
StringBuffer sb = new StringBuffer(old);
StringBuffer sb = new StringBuffer(old);
sb.replace(j, j+1, "Q");
sb.replace(j, j+1, "Q");
res.set(i, sb.toString());
res.set(i, sb.toString());
// Recursively calling the method to generate an answer.
//递归调用该方法以生成答案。
solution(i+1, res);
solution(i+1, res);
//Removing queen and trying the next possibility.
//移除皇后并尝试下一种可能性。
// Backtracking.
// 回溯。
posDiag.remove(posIndex);
posDiag.remove(posIndex);
negDiag.remove(negIndex);
negDiag.remove(negIndex);
verticle.remove(j);
verticle.remove(j);
res.set(i, old);
res.set(i, old);
}
}
public List<List> solveNQueens(int n) {
public List<List> solveNQueens(int n) {
ans = new ArrayList<>();
ans = new ArrayList<>();
if(n == 2 || n == 3)
if(n == 2 || n == 3)
return ans;
return ans;
posDiag = new HashMap<>();
posDiag = new HashMap<>();
negDiag = new HashMap<>();
negDiag = new HashMap<>();
verticle = new HashMap<>();
verticle = new HashMap<>();
N = n;
N = n;
StringBuffer sb = new StringBuffer();
StringBuffer sb = new StringBuffer();
Listres = new ArrayList<>();
Listres = new ArrayList<>();
for(int i = 0; i < n; i++) sb.append(".");
for(int i = 0; i < n; i++) sb.append(".");
for(int i = 0; i < n; i++) res.add(new String(sb.toString()));
for(int i = 0; i < n; i++) res.add(new String(sb.toString()));
//Calling helper method to generate the solution.
//调用辅助方法生成解决方案。
solution(0, res);
solution(0, res);
return ans;
return ans;
}
}
Useful Resources
有用资源
- Data Science Interview Questions
- Python Interview Questions
- SQL Interview Questions
- Java Interview Questions
- Devops Interview Questions
- Data Engineer Interview Questions
- Software Engineering Interview Questions
- Front End Developer Interview Questions
- Technical Interview Questions
- Coding Interview Questions
- Interview Resources
- DSA- Programming
- Mock Interview
512. An m x n grid of cells is used, where each cell has either a life (as 1) or dead (as 0) state initially. When each cell interacts with its eight neighbours (horizontal, vertical, and diagonal), the following four rules govern their behavior.
使用一个 m x n 的单元格网格,其中每个单元格最初处于存活(1)或死亡(0)状态。当每个单元格与其八个邻居(水平、垂直和对角)交互时,以下四条规则决定其行为。
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb615e | 官方: 否 | 付费: 否
答案:
- When a live cell has fewer than two live neighbours, it dies because of being under-populated.
- A cell with two or three living neighbours survives to the next generation.
- An overcrowded 1 live cell kills off any cells with more than three live neighbours.
- Whenever a dead cell comes across three live cells, it becomes alive again by reproduction.
- The current state is computed by applying the above rules to every cell in the m x n grid board in succession. Write a program to return to the next state.
One of the approaches is that we can use the auxiliary grid with the old value and then we update the grid using the above 4 rules. This takes O(mn) time and also O(mn) extra space. But we can solve this problem in-place by keeping a track of the previous value of the grid with some unique value for each state. The special number that we considered to count the sides with 1. - 1 changes to 0 = -2
一种方法是使用带有旧值的辅助网格,然后根据上述 4 条规则更新网格。这需要 O(mn) 时间和 O(mn) 的额外空间。但我们可以通过为每种状态使用特殊值跟踪网格的先前值,从而在原地解决此问题。我们考虑用来计数含 1 的边的特殊数字。- 1 变为 0 = -2
- 0 changes to 0 = 0
- 1 changes 1 = 1
0 changes to 1 = 2
With this above value, we can proceed with the solution. The below solution will be like this -有了上述值,我们可以继续解决方案。下面的解决方案如下 -
//Method that updates the value of the grid.
//更新网格值的方法。
public void gameOfLife(int[][] board) {
public void gameOfLife(int[][] board) {
/*
A special number that we considered to count the sides with 1
我们考虑用来计数含 1 的边的特殊数字
1 -> 0 = -2
0 -> 0 = 0
1 -> 1 = 1
0 -> 1 = 2
*/
int m = board.length;
int m = board.length;
int n = board[0].length;
int n = board[0].length;
for(int i = 0; i < m; i++){
for(int i = 0; i < m; i++){
for(int j = 0; j < n; j++){
for(int j = 0; j < n; j++){
int count = 0;
int count = 0;
//Counting the dead cell in the neighbor
//计算邻居中的死亡单元格
if(i-1 >= 0){
if(i-1 >= 0){
if((j-1 >= 0) && ((boardi-1 == 1) || (boardi-1 == -2)))
如果((j-1 >= 0) && ((boardi-1 == 1) || (boardi-1 == -2)))
count++;
count++;
if((boardi-1 == 1) || (boardi-1 == -2))
如果((boardi-1 == 1) || (boardi-1 == -2))
count++;
count++;
if((j+1 < n) && ((boardi-1 == 1) || (boardi-1 == -2)))
如果((j+1 < n) && ((boardi-1 == 1) || (boardi-1 == -2)))
count++;
count++;
}
if(i+1 < m){
如果(i+1 < m){
if((j-1 >= 0) && ((boardi+1 == 1) || (boardi+1 == -2)))
如果((j-1 >= 0) && ((boardi+1 == 1) || (boardi+1 == -2)))
count++;
count++;
if((boardi+1 == 1) || (boardi+1 == -2))
如果((boardi+1 == 1) || (boardi+1 == -2))
count++;
count++;
if((j+1 < n) && ((boardi+1 == 1) || (boardi+1 == -2)))
如果((j+1 < n) && ((boardi+1 == 1) || (boardi+1 == -2)))
count++;
count++;
}
if((j-1 >= 0) && ((boardi == 1) || (boardi == -2)))
如果((j-1 >= 0) && ((boardi == 1) || (boardi == -2)))
count++;
count++;
if((j+1 < n) && ((boardi == 1) || (boardi == -2)))
如果((j+1 < n) && ((boardi == 1) || (boardi == -2)))
count++;
count++;
//Updating the value of the grid based on the live count.
//根据存活数量更新网格的值。
if(count == 3 && boardi == 0)
if(count == 3 && boardi == 0)
boardi = 2;
boardi = 2;
else if(count < 2 && boardi == 1)
else if(count < 2 && boardi == 1)
boardi = -2;
boardi = -2;
else if(count > 3 && boardi == 1)
else if(count > 3 && boardi == 1)
boardi = -2;
boardi = -2;
}
}
//Loop to update the value by special identification number.
//循环通过特殊标识号更新值。
for(int i = 0; i < m; i++){
for(int i = 0; i < m; i++){
for(int j = 0; j < n; j++){
for(int j = 0; j < n; j++){
if(boardi == -2)
if(boardi == -2)
boardi = 0;
boardi = 0;
else if(boardi == 2)
else if(boardi == 2)
boardi = 1;
boardi = 1;
}
}
}
Successful Tech Career for FREE!
免费开启成功的科技职业生涯!
Successful Tech Career!
成功的技术职业生涯!
Interview Process
面试流程
CTC & Designation
CTC与职位级别
Projects on the Job
工作项目
Referral System
推荐系统
Try It Out
试试看
2 Lakh+ Roadmaps Created
已生成20万+职业规划
513. What are serialization and deserialization OOPs?
什么是面向对象编程中的序列化和反序列化?
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb6161 | 官方: 否 | 付费: 否
答案:
When an object is passed around between different parts of an application, it needs to be serialized into a standard format so that it can be transmitted safely across the network without accidentally corrupting it or causing other problems. - Serialization is the process of converting an object into a compact representation that can be stored and transported reliably. A serializer takes some data of type Object and converts it into another data type: String (or ByteArray) or ArrayList etc. The rest of OOPs is about encapsulation and abstraction - separating data from its internal representation so the user doesn't have direct access or knowledge about its implementation details.
当一个对象在应用程序的不同部分之间传递时,它需要被序列化为标准格式,以便能够安全地通过网络传输,而不会意外损坏或引发其他问题。- 序列化是将对象转换为一种紧凑表示的过程,这种表示可以可靠地存储和传输。序列化器获取Object类型的数据,并转换为另一种数据类型:String(或ByteArray)或ArrayList等。OOP的其他部分涉及封装和抽象——将数据与其内部表示分离,这样用户无法直接访问或了解其实现细节。
- Deserialization on the other hand is the reverse process of serialization. It is the process of converting the serialized data stream object into the actual instance of the class. Deserialization is often used to convert data back from our storage systems when we need it again.
514. What are public and private members of a class?
类的公有成员和私有成员是什么?
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb6164 | 官方: 否 | 付费: 否
答案:
In object-oriented programming (OOP), there are two types of members that can be accessed by any type: private and public. Private members are used for storing data, while public members are used for accessing that data. Private members are inaccessible outside of the class itself, while public members can be used by any other class in the same program. This means that any variables declared as public can be accessed by another class, but private variables cannot be accessed at all.
在面向对象编程(OOP)中,有两类成员可以被任何类型访问:私有和公有。私有成员用于存储数据,而公有成员用于访问这些数据。私有成员在类外部无法访问,而公有成员可以被同一程序中的任何其他类使用。这意味着声明为公有的任何变量可以被其他类访问,但私有变量完全无法访问。
Public and private members are also referred to as "class variables" and "instance variables."
公有成员和私有成员也被称为“类变量”和“实例变量”。
A good example of a private member is a variable that is defined inside a class but not accessible from outside the class. This is done to keep sensitive information away from other classes in the same project.
私有成员的一个典型例子是定义在类内部但无法从类外部访问的变量,这样做是为了将敏感信息与同一项目中的其他类隔离开来。
Another example of a private member is a function that's only available within a particular class. The purpose of this function is to provide specialized functionality for a particular class or subclass. The best way to understand private and public members are by looking at their context and purpose.
私有成员的另一个例子是仅在特定类内部可用的函数,该函数的目的是为特定类或其子类提供专门功能。理解私有成员和公共成员的最佳方式是审视它们的上下文和用途。
515. Explain row-major order and column-major Order.
解释行优先顺序和列优先顺序。
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb6167 | 官方: 否 | 付费: 否
答案:
The data from two-dimensional arrays are in a contiguous fashion. So how these data are to be stored in the memory are derived by the row-major order and the column-major order. - In row-major order, first, the entire row will be stored one after another in a continuous manner. For example - Consider the below image.
二维数组中的数据以连续方式存储,因此这些数据在内存中的存储方式由行优先顺序和列优先顺序决定。- 在行优先顺序中,先按连续方式依次存储整个第一行,然后是第二行,依此类推。例如 - 考虑下图。
In the above image, we can see that the first row is filled first and then the second row, and so on. - In column-major, the data in the two-dimensional matrix is represented and stored in the memory column-wise. For Example - Consider the below image.
在上图中,我们可以看到先填充第一行,然后填充第二行,以此类推。- 在列优先顺序中,二维矩阵中的数据按列表示并存储在内存中。例如 - 考虑下图。
In the above image, we can see that the first column is filled first and then the second column, and so on.
在上图中,我们可以看到先填充第一列,然后填充第二列,以此类推。
516. What is Cache Memory?
什么是缓存内存?
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb616d | 官方: 否 | 付费: 否
答案:
Cache memory serves a similar purpose as RAM in a computer. Cache memory is temporary storage that can be used to store frequently accessed data.
缓存内存与计算机中的RAM用途类似。缓存内存是临时存储空间,可用于存储频繁访问的数据。
Being able to quickly access data can improve the performance of a system by reducing the amount of time it takes for a processor to access the data. Having more cache memory also results in faster processing times.
快速访问数据的能力可以通过减少处理器访问数据所需的时间来提升系统性能。拥有更多缓存内存还能带来更快的处理速度。
Cache memory is typically much faster than RAM and can be used to temporarily store frequently accessed data like application data, metadata, or result data. It’s commonly referred to as “system cache” because it tends to be located on the same die (or integrated circuit) as the processor itself.
缓存内存通常比RAM快得多,可用于临时存储频繁访问的数据,如应用程序数据、元数据或结果数据。它通常被称为“系统缓存”,因为它往往位于与处理器相同的芯片(或集成电路)上。
517. What is an abstract class? And what is the advantage and disadvantage of using abstract classes?
什么是抽象类?使用抽象类的优点和缺点是什么?
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb6179 | 官方: 否 | 付费: 否
答案:
An abstract class is a class that is defined without any implementation. Abstract classes can be used to provide a common base for other classes or to define an interface that can be implemented by other classes. Abstract classes are not directly usable by programs. However, they can be useful in defining interfaces that other classes can implement and use. Abstract classes can also be used to provide shared functionality that other classes need access to but do not need to implement completely. - The main advantage of using an abstract class is that it can allow programmers to write code that only needs to access the abstract methods defined in the class, while other code in the program can use the methods in the class if they are needed. This allows programmers to write simpler code that does not need to worry about all the details of how the abstract methods will work. If another class or subclass needs access to an abstract method, it simply needs to implement the abstract method and call it as required, without having to worry about exactly how it will work when it is called.
抽象类是一种没有实现的类。抽象类可用于为其他类提供公共基类,或定义可由其他类实现的接口。抽象类不能被程序直接使用,但它们在定义接口方面很有用,其他类可实现并使用这些接口。抽象类也可用于提供其他类需要访问但无需完全实现的共享功能。- 使用抽象类的主要优点是,它允许程序员编写只需访问类中定义的抽象方法的代码,而程序中的其他代码在需要时可以使用类中的方法。这使程序员能够编写更简单的代码,无需担心抽象方法将如何工作的所有细节。如果另一个类或子类需要访问抽象方法,只需实现该抽象方法并按需调用即可,无需担心调用时它具体如何运作。
- The main disadvantage of using an abstract class is that it cannot be used for any actual implementation. In order for an abstract class to be used, all its methods must be defined and implemented before it can be used by any other code. If any of these methods is left undefined or unimplemented, then the program will fail when trying to use the class.
518. What is the difference between Rename and Alias?
重命名和别名之间有什么区别?
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb617c | 官方: 否 | 付费: 否
答案:
Rename is a task that changes the name of an object. Alias is a task that creates a symbolic reference for an object. Creating an alias means that you can refer to the object by a different name, but this does not change the underlying identity of the object or its value.
重命名是更改对象名称的任务,而别名是为对象创建符号引用的任务。创建别名意味着你可以用不同的名称引用该对象,但这不会改变对象的基础身份或其值。
The main difference between aliasing and renaming is that renaming changes the value of an object. Aliasing only changes how the object is identified.
别名和重命名之间的主要区别在于,重命名会改变对象的值,而别名仅改变对象的标识方式。
To understand how aliases and renaming differ, let’s consider an example. Suppose that you have an integer value that represents a person’s age in years. You can represent this value as 3, but it would be more useful if you could also represent the person’s age as 82. With renaming, you can accomplish this by calling the value “Bob”. Now, “Bob” is a name, but it doesn’t change the number 3 into 82. With renaming, you can change the value of “Bob” from 3 to 82.
要理解别名和重命名如何不同,让我们考虑一个例子。假设你有一个整数代表人的年龄(以年为单位)。你可以将此值表示为3,但如果你也能将人的年龄表示为82会更实用。通过重命名,你可以通过将该值称为“鲍勃”来实现这一点。现在,“鲍勃”是一个名称,但它不会将数字3变成82。通过重命名,你可以将“鲍勃”的值从3更改为82。
519. What are Codd Rules? Explain Each of them.
什么是科德规则?请逐一解释。
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb6182 | 官方: 否 | 付费: 否
答案:
Dr Edgar F. Codd established twelve rules for databases that adhered to the Relational Model after conducting extensive research on it. He said that a database must follow these rules in order to be considered a true relational database. All databases that rely on relational functionality to store data should follow these basic rules. - Information RuleEvery piece of data stored in a database must be represented as a value of a table cell. It is imperative to keep everything in a table format.
埃德加·F·科德博士在深入研究关系模型后,为遵循该模型的数据库确立了十二条规则。他说,一个数据库必须遵循这些规则才能被视为真正的关系数据库。所有依赖关系功能来存储数据的数据库都应遵循这些基本规则。- 信息规则:数据库中存储的每条数据都必须表示为表格单元格的值。将一切内容保持在表格格式中是至关重要的。
- Guaranteed Access RuleEvery data element/value that is present in the database can be accessed logically using a table name, primary key (row_value), and attribute name (column_value). No pointers or other techniques may be used to access the data.
- Systematic Treatment of NULL ValuesIt is very important to treat the NULL values in a database systematically and uniformly. This is because a NULL may be thought of as being missing data, unconfirmed data, or nonstandard data.
- Active Online CatalogAn online catalog of the database's structure must be maintained, known as a data dictionary. Users may query the catalog using the same query language used for accessing the database itself.
- Comprehensive Data Sub-Language RuleA database must be only accessible using a language that has the linear syntax, and it must support data definition, data manipulation, and transaction management operations, and can be used directly or through some application. This language may be used directly or through some application. If the database provides access to data without the help of this language, it is considered a violation.
- View Updating RuleEvery aspect of a database that may have been altered, must also be accessible to the system.
- High-Level Insert, Update and Delete RuleIt is necessary for a database to support high-level insertion, updating, and deleting of data records. The database doesn't need to support only a single row of data, that is, it must also support the union, intersection, and negation operations to yield sets of data records.
- Physical Data IndependenceAccessing a database should not depend on the physical structure of the database. Any change in the physical structure of a database should not affect how the data is accessed by external applications.
- Logical Data IndependenceA database must maintain logical data that is independent of the way it is used by applications. When two tables are combined or one is split into two new tables, there should be no effect on the applications. Because this is such a difficult objective to achieve, this rule is usually difficult to comply with.
- Integrity IndependenceIt is critical for a database that is used by an application to be independent of the application and interface. Integrity constraints of the database can be altered without modifying the application. This is because the front-end application and its interface are not tied to the database.
- Distribution IndependenceThe data should always appear to be located at a single location to end-users. This fundamental design principle has been built upon the notion that users should never be able to see that data is distributed across various locations.
- Non-Subversion RuleA system's interface must not be able to subvert the system and bypass security and integrity constraints if the interface provides low-level access to records.
520. What are Data Segments? And how does this relate to system performance?
什么是数据段?这与系统性能有何关联?
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb6185 | 官方: 否 | 付费: 否
答案:
A data segment is a portion of the disk space that is allocated to store user data. The disk space can be divided into segments, which are containers for storing different types of data. There are three types of segments: Physical, Leachable, and Non-Leachable. - Physical segments store your data in the hard drive itself.
数据段是分配给存储用户数据的磁盘空间的一部分。磁盘空间可以被划分为段,这些段是用于存储不同类型数据的容器。有三种类型的段:物理段、可浸出段和不可浸出段。- 物理段将数据存储在硬盘驱动器本身中。
- Leachable segments are those that contain data that you have permission to access.
Non-leachable segments contain information that you do not have permission to access, such as system files and cached data.
It affects the system performance as -它影响系统性能的方式如下 -
The amount of time that it takes for your computer to respond when you press a key on your keyboard depends on the speed at data transfer from your hard drive to the processor. If there is a bottleneck in one area, it can affect performance in other areas. Lack of free storage space can also cause system slowdowns because the operating system has to move more data around than it needs to. To keep things running smoothly, make sure you keep sufficient free space on all drives and keep your system clean by regularly deleting unnecessary files.
当您按下键盘上的按键时,计算机响应所需的时间取决于数据从硬盘驱动器传输到处理器的速度。如果某一区域存在瓶颈,可能会影响其他区域的性能。可用存储空间不足也可能导致系统变慢,因为操作系统不得不移动比所需更多的数据。为了保持流畅运行,请确保所有驱动器都有足够的空闲空间,并通过定期删除不必要的文件来保持系统清洁。
521. Explain something about PL/SQL.
请解释一下PL/SQL的相关内容。
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb6188 | 官方: 否 | 付费: 否
答案:
- PL/SQL is a procedural programming language that runs on top of the SQL database. It has its syntax, but it can also be used in conjunction with SQL to access the full range of features offered by the database. PL/SQL is often used for business applications because it is capable of performing more complicated tasks than SQL alone. Also, because it runs on top of the SQL database, it can take advantage of the full range of features that the database offers. This includes data integrity checks and advanced security features such as user authentication and authorization control.
- PL/SQL is a high-level language that is easy to learn and use. It makes it possible to write complex, flexible applications that are able to perform complex tasks with ease.
- One key advantage of PL/SQL is its ability to run on top of a relational database, giving it access to all the data integrity and security features that are available in SQL. Another advantage is its ability to work with other languages, such as HTML and Cascading Style Sheets (CSS). This means that you can easily integrate functionality from other applications into your PL/SQL program without having to rewrite any code.
522. What is the Eligibility Criteria at Nagarro?
Nagarro的资格标准是什么?
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb61ba | 官方: 否 | 付费: 否
答案:
- Course Eligibility: B.Tech (Computer Science & Engineering, Information Technology, and Electronics and Communication Engineering/ MCA.
- Percentage Criteria: Overall greater than 60%.
- Backlog: No Active Backlog.
- Year Gap: Not more than 2 years.
523. Is the Nagarro interview hard?
Nagarro的面试难吗?
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb61bd | 官方: 否 | 付费: 否
答案:
Online coding test in Nagarro is considered hard level. Because they ask 5 questions from the graph or trees in a limited time. But if you have already practised enough, then it’s not too difficult to pass all the test cases. And also if you cannot solve all the 5 questions but you managed to solve 4 out of 5 then you get a high chance to clear for the next round. An in-person technical interview is also of a medium level. You just need to practice and give answers confidently.
Nagarro的在线编码测试被认为难度较高。因为他们在有限时间内提出5个关于图或树的问题。但如果你已经进行了充分练习,那么通过所有测试案例并不太难。而且,如果你不能解决全部5个问题,但设法解决了5个中的4个,那么你很有机会进入下一轮。面对面技术面试也属于中等难度。你只需要练习并自信地回答即可。
524. What is your biggest achievement?
你最大的成就是什么?
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb61c1 | 官方: 否 | 付费: 否
答案:
This is the common question that will be asked by your interviewer during your interview. The best approach to answer this question is to consider picking something that is as recent as possible and relevant to this job or your career. Even if they don't specifically ask for one, pick a professional achievement.
这是面试官在面试中会问的常见问题。回答此问题的最佳方法是选择尽可能近期且与这份工作或你的职业相关的事情。即使他们不特别要求,也要选择一个职业成就。
Consider an example answer for freshers- My most significant professional accomplishment was finishing my engineering degree in four years with an 8.4 SGPA. I had no financial backing from my family and had to work full-time so that I might study engineering. This taught me to be organized, maintain good habits, and focus on my goals. I am pleased with my accomplishment, and I think that my lessons will help me in my future career.
考虑一个针对应届毕业生的示例答案 - 我最显著的专业成就是在四年内以8.4的SGPA完成了我的工程学位。我没有家庭的经济支持,必须全职工作才能学习工程。这教会了我有条理、保持良好习惯并专注于目标。我对我的成就感到满意,并且我认为我的经验将有助于我未来的职业发展。
525. How to crack the Nagarro aptitude test?
如何通过Nagarro的能力倾向测试?
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb61c4 | 官方: 否 | 付费: 否
答案:
There is no specific trick that can be used to crack the Nagarro Aptitude Test. The only way is to practice questions. You can refer to the asked questions from the above section or previous years.
没有特定的技巧可以用来通过Nagarro能力倾向测试。唯一的方法是练习题目。你可以参考上述部分或往年问过的问题。
526. What is the salary for a fresher in Nagarro?
Nagarro应届毕业生的薪资是多少?
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bf958d557c902bb61c7 | 官方: 否 | 付费: 否
答案:
Nagarro offers a salary package in India-
Nagarro在印度的薪资待遇如下-
| Profile 职位 | Salary (in CTC) 薪资(CTC) |
|---|---|
| Associate Software Developer 助理软件开发者 | 4.5 LPA |
| Software Engineer 软件工程师 | 6 - 6.5 LPA |
| Senior Software Engineer 高级软件工程师 | 12-15 LPA |
527. How long is the Interview Process at Nagarro?
Nagarro的面试流程需要多长时间?
- 知识点: 其他/未分类 (标签: interviewbit, nagarro, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: Nagarro
- id: 69b37bfa58d557c902bb61ca | 官方: 否 | 付费: 否
答案:
The complete process starting from the online test to the job offer takes almost 20-25 days . After each round, the company takes 2-3 business days to release the results. And after the HR interview, generally, it depends on the hiring team how much time they take to release the offer letter. But generally, it will be reached within 1 week.
从在线测试到收到录用通知的完整流程大约需要20-25天。每轮结束后,公司需要2-3个工作日公布结果。在HR面试后,通常取决于招聘团队发放录用通知书所需的时间,但一般会在1周内送达。
528. What is the definition of denormalization?
什么是反规范化?
- 知识点: 其他/未分类 (标签: interviewbit, ntt-data, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: NTT DATA
- id: 69b37bff58d557c902bb6615 | 官方: 否 | 付费: 否
答案:
Denormalization is the process of adding redundant data to a database schema in order to improve the performance of certain queries. It is often used in situations where the performance of a database is critical and the cost of performing complex joins or aggregations is too high.
反规范化是向数据库模式中添加冗余数据以提升特定查询性能的过程。它常用于数据库性能至关重要且执行复杂连接或聚合操作成本过高的场景。
Denormalization involves breaking the rules of normalization, which is a design technique used to organize a database in a way that reduces redundancy and dependency. Normalization is based on the idea of breaking down a large table into smaller, more focused tables that store related data.
反规范化涉及打破规范化的规则,规范化是一种用于组织数据库以减少冗余和依赖性的设计技术。规范化基于将大型表拆分为更小、更聚焦的相关数据存储表的思想。
By adding redundant data to the database schema, denormalization can reduce the number of joins or aggregations that are needed to execute a query, which can improve the performance of the query. However, denormalization can also increase the size of the database and make it more difficult to maintain, so it should be used with caution.
通过向数据库模式中添加冗余数据,反规范化可以减少执行查询所需的连接或聚合数量,从而提升查询性能。然而,反规范化也可能增加数据库大小并使维护更加困难,因此应谨慎使用。
529. What are micro and macro kernels?
什么是微内核和宏内核?
- 知识点: 其他/未分类 (标签: interviewbit, ntt-data, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: NTT DATA
- id: 69b37bff58d557c902bb661f | 官方: 否 | 付费: 否
答案:
A kernel is the central component of an operating system that manages the hardware and software resources of a computer. There are two main types of kernels: micro kernels and microkernels.
内核是操作系统的核心组件,负责管理计算机的硬件和软件资源。内核主要有两种类型:微内核和宏内核。
A microkernel is a type of kernel that only includes the essential components needed to manage the hardware and software resources of a computer. Micro kernels are designed to be small and simple, and they only include the core functionality that is required to manage the system.
微内核是一种只包含管理计算机硬件和软件资源所需基本组件的内核。微内核设计得小巧而简单,只包含管理系统所需的核心功能。
A macro kernel, on the other hand, is a type of kernel that includes a wide range of functionality and features, including device drivers, libraries, and system services. Macro kernels are typically larger and more complex than micro kernels, but they provide a more comprehensive set of features and capabilities.
与之相反,宏内核是一种包含广泛功能和特性的内核,包括设备驱动程序、库和系统服务。宏内核通常比微内核更大更复杂,但它们提供了更全面的功能和能力集合。
Micro kernels and macro kernels have different trade-offs in terms of performance, flexibility, and complexity. Micro kernels are generally faster and more flexible than macro kernels, but they may be less comprehensive in terms of the features and capabilities they offer. Macro kernels, on the other hand, maybe slower and less flexible than micro kernels, but they may provide a more comprehensive set of features and capabilities.
微内核和宏内核在性能、灵活性和复杂性方面各有不同的权衡。微内核通常比宏内核更快、更灵活,但它们在提供的功能和能力方面可能不够全面。另一方面,宏内核可能比微内核更慢、灵活性更低,但它们可能提供更全面的功能和能力集合。
530. What are the types of scheduling queues?
有哪些类型的调度队列?
- 知识点: 其他/未分类 (标签: interviewbit, ntt-data, company-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: general
- 公司: NTT DATA
- id: 69b37bff58d557c902bb6626 | 官方: 否 | 付费: 否
答案:
In a computer operating system, scheduling queues are data structures that are used to store and manage the execution of processes or tasks. There are several types of scheduling queues, including:
在计算机操作系统中,调度队列是用于存储和管理进程或任务执行的数据结构。有几种类型的调度队列,包括:
First-In-First-Out (FIFO) queue: This is a simple queue in which processes are added to the end of the queue and are executed in the order in which they were added. 2. Shortest Job First (SJF) queue: This is a queue in which processes are ordered based on their expected execution time. Processes with shorter execution times are executed before processes with longer execution times. 3. Round Robin (RR) queue: This is a queue in which processes are executed in a fixed time slice, called a time quantum. Each process is given a time quantum to execute, and if it does not finish within the time quantum, it is moved to the end of the queue and another process is given a chance to execute. 4. Priority queue: This is a queue in which processes are ordered based on their priority level. Processes with higher priority are executed before processes with lower priority. 5. Multi-Level Queue (MLQ): This is a queue that consists of multiple sub-queues, each of which is assigned a different priority level. Processes are placed in the appropriate sub-queue based on their priority level, and the scheduler executes the processes in each sub-queue according to the scheduling algorithm that is used for that sub-queue.
- 先进先出(FIFO)队列:这是一种简单队列,进程被添加到队列末尾,并按添加顺序执行。 2. 最短作业优先(SJF)队列:这是一种按预期执行时间对进程进行排序的队列。执行时间较短的进程先于执行时间较长的进程执行。 3. 轮转(RR)队列:这是一种在固定时间片(称为时间量子)内执行进程的队列。每个进程获得一个时间量子来执行,如果它未在时间量子内完成,则被移到队列末尾,另一个进程获得执行机会。 4. 优先级队列:这是一种按优先级对进程进行排序的队列。优先级较高的进程先于优先级较低的进程执行。 5. 多级队列(MLQ):这是一种由多个子队列组成的队列,每个子队列分配不同的优先级。进程根据其优先级被放入相应的子队列,调度器根据该子队列使用的调度算法执行每个子队列中的进程。
评论