Java 面试的重要主题/API 列表

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4085089/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 04:42:25  来源:igfitidea点击:

Important topics/APIs list for Java interview

java

提问by daydreamer

This is little different from what already been asked for here

这与这里已经要求的内容略有不同

I would like to know what topics/APIs are most important for Java interviews. for example -

我想知道哪些主题/API 对 Java 面试最重要。例如 -

  • Concurrency,
  • Collections
    .....and like that.
  • 并发,
  • 收藏品
    ……之类的。

The reason is because implementations like ConcurrentHashMap(read here) have so much details in them, that one would like to discuss about them as it covers many important aspects

原因是因为像ConcurrentHashMap在这里阅读)这样的实现中有很多细节,人们想讨论它们,因为它涵盖了许多重要方面

回答by Bozho

  • java.io- difference between streams and writers. Buffered streams.
  • java.util- the collection framework. Setand List. What's HashMap, TreeMap. Some questions on efficiency of concrete collections
  • java.lang- wrapper types, autoboxing
  • java.util.concurrent- synchronization aids, atomic primitives, executors, concurrent collections.
  • multithreading - object monitors, synchronizedkeyword, methods - static and non-static.
  • java.io- 流和作家之间的区别。缓冲流。
  • java.util- 收集框架。SetList。什么HashMapTreeMap。关于混凝土收集效率的几个问题
  • java.lang- 包装类型,自动装箱
  • java.util.concurrent- 同步辅助、原子原语、执行器、并发集合。
  • 多线程 - 对象监视器、synchronized关键字、方法 - 静态和非静态。

回答by Sean Patrick Floyd

I'd say there are two things you need for every java interview:

我想说每次 Java 面试都需要做两件事:

  1. For Basic knowledge of the Language, consult your favorite book or the Sun Java Tutorial
  2. For Best Practices read Effective Java by Joshua Bloch
  1. 有关语言的基本知识,请查阅您最喜欢的书或Sun Java 教程
  2. 如需最佳实践,请阅读Joshua Bloch 的 Effective Java

Apart from that, read whatever seems appropriate to the job description, but I'd say these two are elementary.

除此之外,阅读任何似乎适合职位描述的内容,但我想说这两个是基本的。

I guess these packages are relevant for every java job:

我猜这些包与每个 Java 工作都相关:

  • java.lang (Core classes)
  • java.io (File and Resource I/O)
  • java.util (Collections Framework)
  • java.text (Text parsing / manipulation)
  • java.lang(核心类)
  • java.io(文件和资源 I/O)
  • java.util(集合框架)
  • java.text(文本解析/操作)

回答by Qwerky

IMHO its more important to have a firm understanding of the concepts rather than specific knowledge of the API and especially the internal workings of specific classes. For example;

恕我直言,更重要的是对概念有深刻的理解,而不是对 API 的特定知识,尤其是特定类的内部工作原理。例如;

  • knowing that HashMapis not synchronized is important
  • knowing how this might affect a multithreaded app is important
  • knowing what kind of solutions exist for this problem is important
  • 知道HashMap不同步很重要
  • 了解这可能如何影响多线程应用程序很重要
  • 知道对于这个问题存在什么样的解决方案很重要

回答by Luke Hutteman

I wouldn't worry too much about specific API details like individual methods of ConcurrentHashMap, unless you're interviewing for a job that is advertised as needing a lot of advanced threading logic.

我不会太担心具体的 API 细节,比如 ConcurrentHashMap 的各个方法,除非你正在面试一个被宣传为需要大量高级线程逻辑的工作。

A thorough understanding of the basic Java API's is more important, and books like Effective Java can help there. At least as important though is to know higher level concepts like Object Orientation and Design Patterns.

对基本 Java API 的透彻理解更为重要,而 Effective Java 之类的书籍可以提供帮助。至少同样重要的是了解更高级别的概念,如面向对象和设计模式。

Understanding what Polymorphism, Encapsulation and Inheritance are, and when and how to use them, is vital. Know how to decide between Polymorphism and Delegation (is-aversus has-ais a decent start, but the Liskov Substitution Principleis a better guide), and why you may want to favor composition over inheritance. I highly recommend "Agile Software Development" by Robert Martin for this subject. Or check out this linkfor an initial overview.

了解什么是多态性、封装性和继承性,以及何时以及如何使用它们是至关重要的。知道如何在多态和委托之间做出决定(is-ahas-a是一个不错的开始,但Liskov 替换原则是一个更好的指南),以及为什么您可能更喜欢组合而不是继承。我强烈推荐 Robert Martin 为该主题编写的“敏捷软件开发”。或查看此链接以获取初步概述。

Know some of the core patterns like singleton, factory, facade and observer. Read the GoF book and/or Head First Design Patterns.

了解一些核心模式,如单例模式、工厂模式、外观模式和观察者模式。阅读 GoF 书籍和/或 Head First Design Patterns。

I also recommend learning about refactoring, unit testing, dependency injection and mocking.

我还建议学习重构、单元测试、依赖注入和模拟。

All these subject won't just help you during interviews, they will make you a better developer.

所有这些主题不仅会在面试中为您提供帮助,还会使您成为更好的开发人员。

回答by hvgotcodes

I ask some basic questions ('whats the difference between a list and a set?', 'whats an interface?', etc) and then I go off the resume. If hibernate is on there 5 times, I expect the candidate to be able to define ORM. You would be surprised how often it happens that they can't. I am also interested in how the candidate approaches software -- do they have a passion for it? And it is very important that the candidate believes in TDD. Naturally, if its a really senior position, the questions will be more advanced (e.g. 'whats ThreadLocal and when do you use it'), but for most candidates this is not necessary.

我会问一些基本问题(“列表和集合之间有什么区别?”、“界面是什么?”等),然后我会离开简历。如果休眠 5 次,我希望候选人能够定义 ORM。你会惊讶地发现他们不能这样做的频率如此之高。我也对候选人如何接触软件感兴趣——他们是否对它充满热情?候选人相信 TDD 非常重要。自然,如果它是一个真正的高级职位,问题会更高级(例如“什么是 ThreadLocal 以及您何时使用它”),但对于大多数候选人来说,这不是必需的。

回答by Raul Lapeira Herrero

We usually require the following knowledge on new developers:

对于新开发者,我们通常需要以下知识:

Low level (programming) questions:

低级(编程)问题:

http://www.interview-questions-java.com/

http://www.interview-questions-java.com/

Antipatterns:

反模式:

http://en.wikipedia.org/wiki/Anti-pattern

http://en.wikipedia.org/wiki/Anti-pattern

Design:

设计:

http://en.wikipedia.org/wiki/Design_Patterns

http://en.wikipedia.org/wiki/Design_Patterns

回答by vstoyanov

On some of the interviews I have been to, there is also the java.io package covered, sometimes with absurd questions on what kind of exceptions would some rarely used method declare to throw, or whether some strange looking constructor overload exists.
Concurrency is always important for higher-level positions, but I think that knowing the concepts well (and understanding them ofc) would win you more points than specific API knowledge.
Some other APIs that get mentioned at interviews are Reflection (maybe couple questions on what can be achieved with it) and also java.lang.ref.Reference and its subclasses.

在我参加过的一些采访中,也涵盖了 java.io 包,有时会提出一些荒谬的问题,即一些很少使用的方法会声明抛出什么样的异常,或者是否存在一些看起来很奇怪的构造函数重载。
并发性对于更高级别的职位总是很重要,但我认为很好地了解概念(并理解它们)会比特定的 API 知识为您赢得更多积分。
面试中提到的其他一些 API 是 Reflection(可能是关于可以实现什么的几个问题)以及 java.lang.ref.Reference 及其子类。

回答by user2246289

Completely agree with Luke here. We can not stick to some API's to prepare for Core Java interviews. I think a complete understanding of the OOPS concept in Java is must. Have good knowledge of oops shows the interviewer that the person can learn new API's easily and quick.

在这里完全同意卢克。我们不能拘泥于某些 API 来准备 Core Java 面试。我认为必须完全理解 Java 中的 OOPS 概念。对 oops 有很好的了解向面试官表明该人可以轻松快速地学习新的 API。

Topics that should be covered are as follows:

应涵盖的主题如下:

OOPS Concept

面向对象的概念

Upcasting & DownCasting

上播和下播

Threading

穿线

Collection framework.

集合框架。

Here is a good post to get started. Core Java Interview Q & A

这是一个很好的入门帖子。核心 Java 面试问答