SlideShare uma empresa Scribd logo
1 de 88
Baixar para ler offline
(Не)адекватное
(Java)-интервью
https://twitter.com/mxcl/status/608682016205344768
Google: 90% of our engineers use
the software you wrote (Homebrew),
but you can’t invert a binary tree on
a whiteboard so fuck off.
Max Howell
@mxcl
https://www.facebook.com/aleksandr.jastremski/
posts/1859123867664822?pnref=story
Проверяется твое умение оперировать
названиями абстрактных алгоритмов,
знание всех видов сортировки и отличия
их от кошки Шрёдингера.
https://www.facebook.com/aleksandr.jastremski/
posts/1859123867664822?pnref=story
Проверяется твое умение оперировать
названиями абстрактных алгоритмов,
знание всех видов сортировки и отличия
их от кошки Шрёдингера.
Вам вообще нужно что-бы этот человек пришел
и начал делать "Работу"? Или у вас конкурс на
самого пафосного чувака?
Приходит к нам, значит, Ерлангист.
А мы ему кусок кода на С++, "где-то
тут критический баг, поправь. Два
часа тебе на изучение JVM".
https://www.facebook.com/aleksey.shipilev/posts/10154469128968049?pnref=story
https://www.facebook.com/aleksey.shipilev/posts/10154469128968049?pnref=story
Приходит к нам, значит, Ерлангист.
А мы ему кусок кода на С++, "где-то
тут критический баг, поправь. Два
часа тебе на изучение JVM".
На самом деле, у нас в проектах ramp-up даже
крутейших инженеров занимает от 3 месяцев. [….]
Никто в своём уме не будет думать, что чувак
сможет правильно что-то починить, если он не
знает кодобазы, прошлого опыта, и проч.
https://www.facebook.com/aleksey.shipilev/posts/10154469128968049?pnref=story
Приходит к нам, значит, Ерлангист.
А мы ему кусок кода на С++, "где-то
тут критический баг, поправь. Два
часа тебе на изучение JVM".
На самом деле, у нас в проектах ramp-up даже
крутейших инженеров занимает от 3 месяцев. [….]
Никто в своём уме не будет думать, что чувак
сможет правильно что-то починить, если он не
знает кодобазы, прошлого опыта, и проч.
Кого собеседуем?
И зачем?
5 минутСвоё мнение о кандидате вы составляете за первые 5 минут общения. Остальное время
вы используете лишь для того, чтобы убедиться, или разубедиться, в своём мнении.
Какие вопросы бывают?
Алгоритмические задачки
Вопросы на знание ЯП (Java)
Вопросы на знание стандартной библиотеки (JDK)
Вопросы на знание фреймворков (Spring)
Какие вопросы бывают?
Вопросы о дизайне (как бы ты сделал…)
Общие вопросы по программированию
Вопросы о предыдущем опыте
Инверсия бинарного дерева
4
72
9631
4
72
9631
4
27
1369
Инверсия бинарного дерева
leetcode.com
public class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int x) { val = x; }
}
public class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int x) { val = x; }
}
public class Solution {
public TreeNode invertTree(TreeNode root) {
if(root == null){
return root;
}
TreeNode node = new TreeNode(root.val);
node.left = invertTree(root.right);
node.right = invertTree(root.left);
return node;
}
}
public class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int x) { val = x; }
}
public class Solution {
public TreeNode invertTree(TreeNode root) {
if(root == null){
return root;
}
TreeNode node = new TreeNode(root.val);
node.left = invertTree(root.right);
node.right = invertTree(root.left);
return node;
}
}
public class Solution {
public TreeNode invertTree(TreeNode root) {
if (root == null) { return null; }
final Queue<TreeNode> queue = new LinkedList<>();
queue.offer(root);
while(!queue.isEmpty()) {
final TreeNode node = queue.poll();
final TreeNode left = node.left;
node.left = node.right;
node.right = left;
if(node.left != null) { queue.offer(node.left); }
if(node.right != null) { queue.offer(node.right); }
}
return root;
}
}
Найдите все пермутации букв в строке.
Напишите функцию для реверса строки.
Реализуйте BFS и DFS для обхода дерева,
дайте оценку времени исполнения и
потребления памяти.
…
Create a function that takes a string as a parameter.
This function will return and integer calculated with
the number of occurrence of characters in String used
as parameter:
Magic number:
Create a function that takes a string as a parameter.
This function will return and integer calculated with
the number of occurrence of characters in String used
as parameter:
Magic number:
result = number of 'a'
* number of 'p' or 'r' or 't' or 'f'
+ number of 'e'
* number of 'n' or 'm'
- number of ' '
* number of 'a'
+ number of 'n' or 'm'
Create a function that takes a string as a parameter.
This function will return and integer calculated with
the number of occurrence of characters in String used
as parameter:
Magic number:
magicNumber("i love java"); // returns -4
result = number of 'a'
* number of 'p' or 'r' or 't' or 'f'
+ number of 'e'
* number of 'n' or 'm'
- number of ' '
* number of 'a'
+ number of 'n' or 'm'
Что такое
“number of”?
result = number of 'a'
* number of 'p' or 'r' or 't' or 'f'
+ number of 'e'
* number of 'n' or 'm'
- number of ' '
* number of 'a'
+ number of 'n' or 'm'
Как это
считать?
“Найдите самую релевантную
комбинацию для поиска из трёх слов.”
2 4 17 44 71 119 554 661 669 771 818
6 8 19 21 25 41 52 59 111 255 414
7 9 33 37 39 55 57 99 101 241 340
“Найдите самую релевантную
комбинацию для поиска из трёх слов.”
2 4 17 44 71 119 554 661 669 771 818
6 8 19 21 25 41 52 59 111 255 414
7 9 33 37 39 55 57 99 101 241 340
“Найдите самую релевантную
комбинацию для поиска из трёх слов.”
2 4 17 44 71 119 554 661 669 771 818
6 8 19 21 25 41 52 59 111 255 414
7 9 33 37 39 55 57 99 101 241 340
“Найдите самую релевантную
комбинацию для поиска из трёх слов.”
2 4 17 44 71 119 554 661 669 771 818
6 8 19 21 25 41 52 59 111 255 414
7 9 33 37 39 55 57 99 101 241 340
“Найдите самую релевантную
комбинацию для поиска из трёх слов.”
2 4 17 44 71 119 554 661 669 771 818
6 8 19 21 25 41 52 59 111 255 414
7 9 33 37 39 55 57 99 101 241 340
“Найдите самую релевантную
комбинацию для поиска из трёх слов.”
2 4 17 44 71 119 554 661 669 771 818
6 8 19 21 25 41 52 59 111 255 414
7 9 33 37 39 55 57 99 101 241 340
“Найдите самую релевантную
комбинацию для поиска из трёх слов.”
2 4 17 44 71 119 554 661 669 771 818
6 8 19 21 25 41 52 59 111 255 414
7 9 33 37 39 55 57 99 101 241 340
“Найдите самую релевантную
комбинацию для поиска из трёх слов.”
2 4 17 44 71 119 554 661 669 771 818
6 8 19 21 25 41 52 59 111 255 414
7 9 33 37 39 55 57 99 101 241 340
“Найдите самую релевантную
комбинацию для поиска из трёх слов.”
2 4 17 44 71 119 554 661 669 771 818
6 8 19 21 25 41 52 59 111 255 414
7 9 33 37 39 55 57 99 101 241 340
“Найдите самую релевантную
комбинацию для поиска из трёх слов.”
2 4 17 44 71 119 554 661 669 771 818
6 8 19 21 25 41 52 59 111 255 414
7 9 33 37 39 55 57 99 101 241 340
“Найдите самую релевантную
комбинацию для поиска из трёх слов.”
2 4 17 44 71 119 554 661 669 771 818
6 8 19 21 25 41 52 59 111 255 414
7 9 33 37 39 55 57 99 101 241 340
“Найдите самую релевантную
комбинацию для поиска из трёх слов.”
2 4 17 44 71 119 554 661 669 771 818
6 8 19 21 25 41 52 59 111 255 414
7 9 33 37 39 55 57 99 101 241 340
“Найдите самую релевантную
комбинацию для поиска из трёх слов.”
Вопрос: когда поиск остановится?
¯_( )_/¯
FizzBuzzWrite a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz"
instead of the number and for the multiples of five print "Buzz". For numbers which are
multiples of both three and five print "FizzBuzz".
Вопросы на знание ЯП
(Java edition)
Классика жанра
System.out.println(10/3);
equals() и hashCode()
В чём разница между
абстрактным классом и интерфейсом?
Параметры методов в Java передаются
по значению или по ссылке?
class Foo {
void boo() {
class Bar {}
Bar b = new Bar();
System.out.println(b);
}
}
Компилируется ли это код?
Зачем писать такой код?
Во что компилируется такой код?
http://arhipov.blogspot.com.ee/2015/11/finalfinallyfinalize.html
final
finally
finalize
public static int foo() {
try {
return 0;
}
finally {
return 42;
}
}
finally
public static int foo() {
try {
throw new RuntimeException();
}
finally {
return 42;
}
}
finally
public static void main(String[] args) {
try {
throw new NullPointerException("NPE 1");
} catch (NullPointerException e) {
throw new NullPointerException("NPE 2");
} finally {
return;
}
}
finally
http://arhipov.blogspot.com.ee/2015/12/another-great-java-interview-question.html
public class Singleton {
private static Singleton INSTANCE = null;
private Singleton() {}
public static Singleton getInstance() {
if(INSTANCE == null) {
INSTANCE = new Singleton();
}
return instance;
}
}
public class Singleton {
private static Singleton INSTANCE = null;
private Singleton() {}
public static Singleton getInstance() {
if(INSTANCE == null) {
INSTANCE = new Singleton();
}
return instance;
}
}
public class Singleton {
private static Singleton INSTANCE = null;
private Singleton() {}
public static Singleton getInstance() {
if(INSTANCE == null) {
INSTANCE = new Singleton();
}
return instance;
}
}
public class Singleton {
private static Singleton INSTANCE = null;
private Singleton() {}
public static Singleton getInstance() {
if(INSTANCE == null) {
INSTANCE = new Singleton();
}
return instance;
}
}
public class Singleton {
private static Singleton INSTANCE = null;
private Singleton() {}
public static Singleton getInstance() {
if(INSTANCE == null) {
INSTANCE = new Singleton();
}
return INSTANCE;
}
}
public class Singleton {
private static Singleton INSTANCE = null;
private Singleton() {}
public static Singleton getInstance() {
if(INSTANCE == null) {
synchronized(Singleton.class){
INSTANCE = new Singleton();
}
}
return INSTANCE;
}
}
public class Singleton {
private static volatile
Singleton INSTANCE = null;
private Singleton() {}
public static Singleton getInstance() {
if(INSTANCE == null) {
synchronized(Singleton.class){
INSTANCE = new Singleton();
}
}
return INSTANCE;
}
}
public class Singleton {
private static volatile
Singleton INSTANCE = null;
private Singleton() {}
public static Singleton getInstance() {
if(INSTANCE == null) {
synchronized(Singleton.class){
INSTANCE = new Singleton();
}
}
return INSTANCE;
}
}
public class Singleton {
private static class Holder {
private static Singleton INSTANCE = null;
}
private Singleton() {}
public static Singleton getInstance() {
return Holder.INSTANCE;
}
}
Горец…
Горец… …и…
Горец… …и… …ещё один горец
Горец… …и… …ещё один горец
Помните о разных
загрузчиках, когда
используете синглтоны!
Как сериализовать синглтон?
public enum Singleton {
INSTANCE
}
PROBLEM?
Что такое volatile
и как это работает?
What would you add to Java?
How would you implement it?
Вопросы о JDK
notify() vs notifyAll()
Что такое WeakReference?
Как получить результат вызова
хранимой процедуры (БД)?
String proc = "{call proc(?,?)}";
stmt = con.prepareCall(proc);
stmt.setInt(1, 10);
stmt.registerOutParameter(2, Types.VARCHAR);
stmt.executeUpdate();
String result = stmt.getString(2);
Как получить UTF-8
представление строки?
"Девклуб".getBytes("UTF-8")
Puzzlers
1) Мапы поменяются местами
2) Обе мапы будут иметь содержание как в м2
3) Обе мапы будут иметь содержание как в м1
4) Этот код не компилируется!
Map<String, String> m1 = stringsMap();
// {a=aaaaa, b=bbbbb}
Map<String, String> m2 = numbersMap();
// {a=11111, b=22222}
m2.replaceAll(m1::put);
System.out.println(m1);
System.out.println(m2);
Java 8 Puzzlers: The Strange, the Bizarre, and the Wonderful
Map<String, String> m1 = stringsMap();
// {a=aaaaa, b=bbbbb}
Map<String, String> m2 = numbersMap();
// {a=11111, b=22222}
m2.replaceAll(m1::put);
System.out.println(m1); // {a=11111, b=22222}
System.out.println(m2); // {a=aaaaa, b=bbbbb}
1) Мапы поменяются местами
2) Обе мапы будут иметь содержание как в м2
3) Обе мапы будут иметь содержание как в м1
4) Этот код не компилируется!
Java 8 Puzzlers: The Strange, the Bizarre, and the Wonderful
Вопросы на знание
фреймворков
Вопросы о дизайне
(System design questions)
Как реализовать
сокращатель ссылок?
А теперь всё вместе!
Примеры неадеквата
Алгоритмы - если работа заключается чтоб взять
данные из формочки и положить в БД
Вопросы про глубинные познания JVM, если мы
интервьюируем прикладного программиста
Вопросы о многопоточном программировании, если
мы знаем, что на работе это никогда не понадобится
“Пазлеры" - если мы всегда ожидаем правильный
ответ
Вполне адекватно спрашивать
Алгоритмы, если мы ищем кодера алгоритмов
Вопросы про глубинные познания JVM, если мы
собеседуем JVM-разработчика
Вопросы о многопоточном программировании,
если работа подразумевает разработки
многопоточных приложений
Базовые вопросы на знание языка в
зависимости от готовности кандидата
Вопросы о дизайне решений
Вопросы о том какие проекты и как
человек делал
Вполне адекватно спрашивать

Mais conteúdo relacionado

Mais procurados

веселов
веселоввеселов
веселовNLPseminar
 
Cобачники против кинофобов
Cобачники против кинофобовCобачники против кинофобов
Cобачники против кинофобовLidiya Myalkina
 
Использование Fiddler и Charles при тестировании фронтенда проекта pulse.mail...
Использование Fiddler и Charles при тестировании фронтенда проекта pulse.mail...Использование Fiddler и Charles при тестировании фронтенда проекта pulse.mail...
Использование Fiddler и Charles при тестировании фронтенда проекта pulse.mail...Mail.ru Group
 
Производительность в Django
Производительность в DjangoПроизводительность в Django
Производительность в DjangoMoscowDjango
 
Быстрые конструкции в Python - Олег Шидловский, Python Meetup 26.09.2014
Быстрые конструкции в Python - Олег Шидловский, Python Meetup 26.09.2014Быстрые конструкции в Python - Олег Шидловский, Python Meetup 26.09.2014
Быстрые конструкции в Python - Олег Шидловский, Python Meetup 26.09.2014Python Meetup
 
Как программировать на JavaScript и не выстрелить себе в ногу
Как программировать на JavaScript и не выстрелить себе в ногуКак программировать на JavaScript и не выстрелить себе в ногу
Как программировать на JavaScript и не выстрелить себе в ногуAndreyGeonya
 
JavaScript. Loops and functions (in russian)
JavaScript. Loops and functions (in russian)JavaScript. Loops and functions (in russian)
JavaScript. Loops and functions (in russian)Mikhail Davydov
 
Параллельные вычисления в Perl 6
Параллельные вычисления в Perl 6Параллельные вычисления в Perl 6
Параллельные вычисления в Perl 6Andrew Shitov
 
Лекция 6. Классы 1.
Лекция 6. Классы 1.Лекция 6. Классы 1.
Лекция 6. Классы 1.Roman Brovko
 
Декораторы в Python и их практическое использование
Декораторы в Python и их практическое использование Декораторы в Python и их практическое использование
Декораторы в Python и их практическое использование Sergey Schetinin
 

Mais procurados (12)

веселов
веселоввеселов
веселов
 
Cобачники против кинофобов
Cобачники против кинофобовCобачники против кинофобов
Cобачники против кинофобов
 
Использование Fiddler и Charles при тестировании фронтенда проекта pulse.mail...
Использование Fiddler и Charles при тестировании фронтенда проекта pulse.mail...Использование Fiddler и Charles при тестировании фронтенда проекта pulse.mail...
Использование Fiddler и Charles при тестировании фронтенда проекта pulse.mail...
 
Производительность в Django
Производительность в DjangoПроизводительность в Django
Производительность в Django
 
Tricky Java Generics
Tricky Java GenericsTricky Java Generics
Tricky Java Generics
 
Rgsu04
Rgsu04Rgsu04
Rgsu04
 
Быстрые конструкции в Python - Олег Шидловский, Python Meetup 26.09.2014
Быстрые конструкции в Python - Олег Шидловский, Python Meetup 26.09.2014Быстрые конструкции в Python - Олег Шидловский, Python Meetup 26.09.2014
Быстрые конструкции в Python - Олег Шидловский, Python Meetup 26.09.2014
 
Как программировать на JavaScript и не выстрелить себе в ногу
Как программировать на JavaScript и не выстрелить себе в ногуКак программировать на JavaScript и не выстрелить себе в ногу
Как программировать на JavaScript и не выстрелить себе в ногу
 
JavaScript. Loops and functions (in russian)
JavaScript. Loops and functions (in russian)JavaScript. Loops and functions (in russian)
JavaScript. Loops and functions (in russian)
 
Параллельные вычисления в Perl 6
Параллельные вычисления в Perl 6Параллельные вычисления в Perl 6
Параллельные вычисления в Perl 6
 
Лекция 6. Классы 1.
Лекция 6. Классы 1.Лекция 6. Классы 1.
Лекция 6. Классы 1.
 
Декораторы в Python и их практическое использование
Декораторы в Python и их практическое использование Декораторы в Python и их практическое использование
Декораторы в Python и их практическое использование
 

Destaque

Joker 2016 - Bytecode 101
Joker 2016 - Bytecode 101Joker 2016 - Bytecode 101
Joker 2016 - Bytecode 101Anton Arhipov
 
JPoint 2016 - Etudes of DIY Java profiler
JPoint 2016 - Etudes of DIY Java profilerJPoint 2016 - Etudes of DIY Java profiler
JPoint 2016 - Etudes of DIY Java profilerAnton Arhipov
 
Oredev 2015 - Taming Java Agents
Oredev 2015 - Taming Java AgentsOredev 2015 - Taming Java Agents
Oredev 2015 - Taming Java AgentsAnton Arhipov
 
Riga Dev Day 2016 - Having fun with Javassist
Riga Dev Day 2016 - Having fun with JavassistRiga Dev Day 2016 - Having fun with Javassist
Riga Dev Day 2016 - Having fun with JavassistAnton Arhipov
 
JPoint 2016 - Bytecode
JPoint 2016 - BytecodeJPoint 2016 - Bytecode
JPoint 2016 - BytecodeAnton Arhipov
 
It's Not Your Fault - Blameless Post-mortems
It's Not Your Fault - Blameless Post-mortemsIt's Not Your Fault - Blameless Post-mortems
It's Not Your Fault - Blameless Post-mortemsJason Hand
 
JavaOne 2015 - Having fun with Javassist
JavaOne 2015 - Having fun with JavassistJavaOne 2015 - Having fun with Javassist
JavaOne 2015 - Having fun with JavassistAnton Arhipov
 
Introduction to Groovy
Introduction to GroovyIntroduction to Groovy
Introduction to GroovyAnton Arhipov
 
Con-FESS 2015 - Having Fun With Javassist
Con-FESS 2015 - Having Fun With JavassistCon-FESS 2015 - Having Fun With Javassist
Con-FESS 2015 - Having Fun With JavassistAnton Arhipov
 
Something about Golang
Something about GolangSomething about Golang
Something about GolangAnton Arhipov
 
Something about Golang
Something about GolangSomething about Golang
Something about GolangAnton Arhipov
 
import continuous.delivery.*
import continuous.delivery.*import continuous.delivery.*
import continuous.delivery.*Anton Arhipov
 
Con-FESS 2015 - Is your profiler speaking to you?
Con-FESS 2015 - Is your profiler speaking to you?Con-FESS 2015 - Is your profiler speaking to you?
Con-FESS 2015 - Is your profiler speaking to you?Anton Arhipov
 
Improve your Developer Experiece using the WAS Liberty Profile with JRebel
Improve your Developer Experiece using the WAS Liberty Profile with JRebel Improve your Developer Experiece using the WAS Liberty Profile with JRebel
Improve your Developer Experiece using the WAS Liberty Profile with JRebel Anton Arhipov
 
JPoint 2015 - Javassist на службе Java-разработчика
JPoint 2015 - Javassist на службе Java-разработчикаJPoint 2015 - Javassist на службе Java-разработчика
JPoint 2015 - Javassist на службе Java-разработчикаAnton Arhipov
 
NetBeans Plugin Development: JRebel Experience Report
NetBeans Plugin Development: JRebel Experience ReportNetBeans Plugin Development: JRebel Experience Report
NetBeans Plugin Development: JRebel Experience ReportAnton Arhipov
 
Загрузчики классов в Java - коллекция граблей
Загрузчики классов в Java - коллекция граблейЗагрузчики классов в Java - коллекция граблей
Загрузчики классов в Java - коллекция граблейAnton Arhipov
 
Voxxed Days Vilnius 2015 - Having fun with Javassist
Voxxed Days Vilnius 2015 - Having fun with JavassistVoxxed Days Vilnius 2015 - Having fun with Javassist
Voxxed Days Vilnius 2015 - Having fun with JavassistAnton Arhipov
 
Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Anton Arhipov
 

Destaque (20)

Joker 2016 - Bytecode 101
Joker 2016 - Bytecode 101Joker 2016 - Bytecode 101
Joker 2016 - Bytecode 101
 
JPoint 2016 - Etudes of DIY Java profiler
JPoint 2016 - Etudes of DIY Java profilerJPoint 2016 - Etudes of DIY Java profiler
JPoint 2016 - Etudes of DIY Java profiler
 
Oredev 2015 - Taming Java Agents
Oredev 2015 - Taming Java AgentsOredev 2015 - Taming Java Agents
Oredev 2015 - Taming Java Agents
 
Riga Dev Day 2016 - Having fun with Javassist
Riga Dev Day 2016 - Having fun with JavassistRiga Dev Day 2016 - Having fun with Javassist
Riga Dev Day 2016 - Having fun with Javassist
 
JPoint 2016 - Bytecode
JPoint 2016 - BytecodeJPoint 2016 - Bytecode
JPoint 2016 - Bytecode
 
It's Not Your Fault - Blameless Post-mortems
It's Not Your Fault - Blameless Post-mortemsIt's Not Your Fault - Blameless Post-mortems
It's Not Your Fault - Blameless Post-mortems
 
JavaOne 2015 - Having fun with Javassist
JavaOne 2015 - Having fun with JavassistJavaOne 2015 - Having fun with Javassist
JavaOne 2015 - Having fun with Javassist
 
Introduction to Groovy
Introduction to GroovyIntroduction to Groovy
Introduction to Groovy
 
Con-FESS 2015 - Having Fun With Javassist
Con-FESS 2015 - Having Fun With JavassistCon-FESS 2015 - Having Fun With Javassist
Con-FESS 2015 - Having Fun With Javassist
 
Something about Golang
Something about GolangSomething about Golang
Something about Golang
 
Something about Golang
Something about GolangSomething about Golang
Something about Golang
 
import continuous.delivery.*
import continuous.delivery.*import continuous.delivery.*
import continuous.delivery.*
 
Con-FESS 2015 - Is your profiler speaking to you?
Con-FESS 2015 - Is your profiler speaking to you?Con-FESS 2015 - Is your profiler speaking to you?
Con-FESS 2015 - Is your profiler speaking to you?
 
Taming Java Agents
Taming Java AgentsTaming Java Agents
Taming Java Agents
 
Improve your Developer Experiece using the WAS Liberty Profile with JRebel
Improve your Developer Experiece using the WAS Liberty Profile with JRebel Improve your Developer Experiece using the WAS Liberty Profile with JRebel
Improve your Developer Experiece using the WAS Liberty Profile with JRebel
 
JPoint 2015 - Javassist на службе Java-разработчика
JPoint 2015 - Javassist на службе Java-разработчикаJPoint 2015 - Javassist на службе Java-разработчика
JPoint 2015 - Javassist на службе Java-разработчика
 
NetBeans Plugin Development: JRebel Experience Report
NetBeans Plugin Development: JRebel Experience ReportNetBeans Plugin Development: JRebel Experience Report
NetBeans Plugin Development: JRebel Experience Report
 
Загрузчики классов в Java - коллекция граблей
Загрузчики классов в Java - коллекция граблейЗагрузчики классов в Java - коллекция граблей
Загрузчики классов в Java - коллекция граблей
 
Voxxed Days Vilnius 2015 - Having fun with Javassist
Voxxed Days Vilnius 2015 - Having fun with JavassistVoxxed Days Vilnius 2015 - Having fun with Javassist
Voxxed Days Vilnius 2015 - Having fun with Javassist
 
Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012Jenkins Evolutions - JEEConf 2012
Jenkins Evolutions - JEEConf 2012
 

Semelhante a Devclub 01/2017 - (Не)адекватное Java-интервью

Statis code analysis
Statis code analysisStatis code analysis
Statis code analysischashnikov
 
Зачем нужна Scala?
Зачем нужна Scala?Зачем нужна Scala?
Зачем нужна Scala?Vasil Remeniuk
 
Очень вкусный фрукт Guava
Очень вкусный фрукт GuavaОчень вкусный фрукт Guava
Очень вкусный фрукт GuavaEgor Chernyshev
 
Deep Dive C# by Sergey Teplyakov
Deep Dive  C# by Sergey TeplyakovDeep Dive  C# by Sergey Teplyakov
Deep Dive C# by Sergey TeplyakovAlex Tumanoff
 
Статический анализ и регулярные выражения
Статический анализ и регулярные выраженияСтатический анализ и регулярные выражения
Статический анализ и регулярные выраженияTatyanazaxarova
 
CodeFest 2014. Пугачев С. — Язык TypeScript или JavaScript на стероидах
CodeFest 2014. Пугачев С. — Язык TypeScript или JavaScript на стероидахCodeFest 2014. Пугачев С. — Язык TypeScript или JavaScript на стероидах
CodeFest 2014. Пугачев С. — Язык TypeScript или JavaScript на стероидахCodeFest
 
Что нового в Perl 5.14
Что нового в Perl 5.14Что нового в Perl 5.14
Что нового в Perl 5.14Andrew Shitov
 
Программирование разветвляющихся алгоритмов
Программирование разветвляющихся алгоритмовПрограммирование разветвляющихся алгоритмов
Программирование разветвляющихся алгоритмовAndrey Dolinin
 
Python и его тормоза
Python и его тормозаPython и его тормоза
Python и его тормозаAlexander Shigin
 
View как чистая функция от состояния базы данных - Илья Беда, bro.agency
View как чистая функция от состояния базы данных  - Илья Беда, bro.agencyView как чистая функция от состояния базы данных  - Илья Беда, bro.agency
View как чистая функция от состояния базы данных - Илья Беда, bro.agencyit-people
 
How threads help each other
How threads help each otherHow threads help each other
How threads help each otherAlexey Fyodorov
 
Артем Яворский "@babel/core": "7.x"
Артем Яворский "@babel/core": "7.x"Артем Яворский "@babel/core": "7.x"
Артем Яворский "@babel/core": "7.x"Fwdays
 
Ecma script 6 in action
Ecma script 6 in actionEcma script 6 in action
Ecma script 6 in actionYuri Trukhin
 
Solit 2014, EcmaScript 6 in Action, Трухин Юрий
Solit 2014, EcmaScript 6 in Action, Трухин Юрий Solit 2014, EcmaScript 6 in Action, Трухин Юрий
Solit 2014, EcmaScript 6 in Action, Трухин Юрий solit
 
Николай Паламарчук "Functional Programming basics for PHP developers"
Николай Паламарчук "Functional Programming basics for PHP developers"Николай Паламарчук "Functional Programming basics for PHP developers"
Николай Паламарчук "Functional Programming basics for PHP developers"Fwdays
 
Programming Java - Lecture 02 - Objects - Lavrentyev Fedor
Programming Java - Lecture 02 - Objects - Lavrentyev FedorProgramming Java - Lecture 02 - Objects - Lavrentyev Fedor
Programming Java - Lecture 02 - Objects - Lavrentyev FedorFedor Lavrentyev
 
O Babel 7 и немного больше, Артем Яворский
O Babel 7 и немного больше, Артем ЯворскийO Babel 7 и немного больше, Артем Яворский
O Babel 7 и немного больше, Артем ЯворскийSigma Software
 

Semelhante a Devclub 01/2017 - (Не)адекватное Java-интервью (20)

Statis code analysis
Statis code analysisStatis code analysis
Statis code analysis
 
Зачем нужна Scala?
Зачем нужна Scala?Зачем нужна Scala?
Зачем нужна Scala?
 
Очень вкусный фрукт Guava
Очень вкусный фрукт GuavaОчень вкусный фрукт Guava
Очень вкусный фрукт Guava
 
Deep Dive C# by Sergey Teplyakov
Deep Dive  C# by Sergey TeplyakovDeep Dive  C# by Sergey Teplyakov
Deep Dive C# by Sergey Teplyakov
 
Funny JS #2
Funny JS #2Funny JS #2
Funny JS #2
 
Статический анализ и регулярные выражения
Статический анализ и регулярные выраженияСтатический анализ и регулярные выражения
Статический анализ и регулярные выражения
 
CodeFest 2014. Пугачев С. — Язык TypeScript или JavaScript на стероидах
CodeFest 2014. Пугачев С. — Язык TypeScript или JavaScript на стероидахCodeFest 2014. Пугачев С. — Язык TypeScript или JavaScript на стероидах
CodeFest 2014. Пугачев С. — Язык TypeScript или JavaScript на стероидах
 
Что нового в Perl 5.14
Что нового в Perl 5.14Что нового в Perl 5.14
Что нового в Perl 5.14
 
Программирование разветвляющихся алгоритмов
Программирование разветвляющихся алгоритмовПрограммирование разветвляющихся алгоритмов
Программирование разветвляющихся алгоритмов
 
Python и его тормоза
Python и его тормозаPython и его тормоза
Python и его тормоза
 
View как чистая функция от состояния базы данных - Илья Беда, bro.agency
View как чистая функция от состояния базы данных  - Илья Беда, bro.agencyView как чистая функция от состояния базы данных  - Илья Беда, bro.agency
View как чистая функция от состояния базы данных - Илья Беда, bro.agency
 
How threads help each other
How threads help each otherHow threads help each other
How threads help each other
 
Артем Яворский "@babel/core": "7.x"
Артем Яворский "@babel/core": "7.x"Артем Яворский "@babel/core": "7.x"
Артем Яворский "@babel/core": "7.x"
 
Ecma script 6 in action
Ecma script 6 in actionEcma script 6 in action
Ecma script 6 in action
 
Solit 2014, EcmaScript 6 in Action, Трухин Юрий
Solit 2014, EcmaScript 6 in Action, Трухин Юрий Solit 2014, EcmaScript 6 in Action, Трухин Юрий
Solit 2014, EcmaScript 6 in Action, Трухин Юрий
 
Why02
Why02Why02
Why02
 
Curse of spring boot test [VRN]
Curse of spring boot test [VRN]Curse of spring boot test [VRN]
Curse of spring boot test [VRN]
 
Николай Паламарчук "Functional Programming basics for PHP developers"
Николай Паламарчук "Functional Programming basics for PHP developers"Николай Паламарчук "Functional Programming basics for PHP developers"
Николай Паламарчук "Functional Programming basics for PHP developers"
 
Programming Java - Lecture 02 - Objects - Lavrentyev Fedor
Programming Java - Lecture 02 - Objects - Lavrentyev FedorProgramming Java - Lecture 02 - Objects - Lavrentyev Fedor
Programming Java - Lecture 02 - Objects - Lavrentyev Fedor
 
O Babel 7 и немного больше, Артем Яворский
O Babel 7 и немного больше, Артем ЯворскийO Babel 7 и немного больше, Артем Яворский
O Babel 7 и немного больше, Артем Яворский
 

Mais de Anton Arhipov

JavaZone 2022 - Building Kotlin DSL.pdf
JavaZone 2022 - Building Kotlin DSL.pdfJavaZone 2022 - Building Kotlin DSL.pdf
JavaZone 2022 - Building Kotlin DSL.pdfAnton Arhipov
 
Build pipelines with TeamCity
Build pipelines with TeamCityBuild pipelines with TeamCity
Build pipelines with TeamCityAnton Arhipov
 
Build pipelines with TeamCity
Build pipelines with TeamCityBuild pipelines with TeamCity
Build pipelines with TeamCityAnton Arhipov
 
Devoxx Ukraine 2018 - Kotlin DSL in under an hour
Devoxx Ukraine 2018 - Kotlin DSL in under an hourDevoxx Ukraine 2018 - Kotlin DSL in under an hour
Devoxx Ukraine 2018 - Kotlin DSL in under an hourAnton Arhipov
 
GeeCON Prague 2018 - Kotlin DSL in under an hour
GeeCON Prague 2018 - Kotlin DSL in under an hourGeeCON Prague 2018 - Kotlin DSL in under an hour
GeeCON Prague 2018 - Kotlin DSL in under an hourAnton Arhipov
 
Build pipelines with TeamCity and Kotlin DSL
Build pipelines with TeamCity and Kotlin DSLBuild pipelines with TeamCity and Kotlin DSL
Build pipelines with TeamCity and Kotlin DSLAnton Arhipov
 
Build pipelines with TeamCity
Build pipelines with TeamCityBuild pipelines with TeamCity
Build pipelines with TeamCityAnton Arhipov
 
JavaDay Kiev 2017 - Integration testing with TestContainers
JavaDay Kiev 2017 - Integration testing with TestContainersJavaDay Kiev 2017 - Integration testing with TestContainers
JavaDay Kiev 2017 - Integration testing with TestContainersAnton Arhipov
 
GeeCON Prague 2017 - TestContainers
GeeCON Prague 2017 - TestContainersGeeCON Prague 2017 - TestContainers
GeeCON Prague 2017 - TestContainersAnton Arhipov
 
JavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloadingJavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloadingAnton Arhipov
 
JavaOne 2017 - TestContainers: integration testing without the hassle
JavaOne 2017 - TestContainers: integration testing without the hassleJavaOne 2017 - TestContainers: integration testing without the hassle
JavaOne 2017 - TestContainers: integration testing without the hassleAnton Arhipov
 
JavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloadingJavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloadingAnton Arhipov
 
JavaZone 2017 - The Hitchhiker’s guide to Java class reloading
JavaZone 2017 - The Hitchhiker’s guide to Java class reloadingJavaZone 2017 - The Hitchhiker’s guide to Java class reloading
JavaZone 2017 - The Hitchhiker’s guide to Java class reloadingAnton Arhipov
 
JUG.ua 20170225 - Java bytecode instrumentation
JUG.ua 20170225 - Java bytecode instrumentationJUG.ua 20170225 - Java bytecode instrumentation
JUG.ua 20170225 - Java bytecode instrumentationAnton Arhipov
 
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloadingRiga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloadingAnton Arhipov
 
GeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassleGeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassleAnton Arhipov
 
JEEConf 2017 - The hitchhiker’s guide to Java class reloading
JEEConf 2017 - The hitchhiker’s guide to Java class reloadingJEEConf 2017 - The hitchhiker’s guide to Java class reloading
JEEConf 2017 - The hitchhiker’s guide to Java class reloadingAnton Arhipov
 
JEEConf 2017 - Having fun with Javassist
JEEConf 2017 - Having fun with JavassistJEEConf 2017 - Having fun with Javassist
JEEConf 2017 - Having fun with JavassistAnton Arhipov
 

Mais de Anton Arhipov (19)

JavaZone 2022 - Building Kotlin DSL.pdf
JavaZone 2022 - Building Kotlin DSL.pdfJavaZone 2022 - Building Kotlin DSL.pdf
JavaZone 2022 - Building Kotlin DSL.pdf
 
Idiomatic kotlin
Idiomatic kotlinIdiomatic kotlin
Idiomatic kotlin
 
Build pipelines with TeamCity
Build pipelines with TeamCityBuild pipelines with TeamCity
Build pipelines with TeamCity
 
Build pipelines with TeamCity
Build pipelines with TeamCityBuild pipelines with TeamCity
Build pipelines with TeamCity
 
Devoxx Ukraine 2018 - Kotlin DSL in under an hour
Devoxx Ukraine 2018 - Kotlin DSL in under an hourDevoxx Ukraine 2018 - Kotlin DSL in under an hour
Devoxx Ukraine 2018 - Kotlin DSL in under an hour
 
GeeCON Prague 2018 - Kotlin DSL in under an hour
GeeCON Prague 2018 - Kotlin DSL in under an hourGeeCON Prague 2018 - Kotlin DSL in under an hour
GeeCON Prague 2018 - Kotlin DSL in under an hour
 
Build pipelines with TeamCity and Kotlin DSL
Build pipelines with TeamCity and Kotlin DSLBuild pipelines with TeamCity and Kotlin DSL
Build pipelines with TeamCity and Kotlin DSL
 
Build pipelines with TeamCity
Build pipelines with TeamCityBuild pipelines with TeamCity
Build pipelines with TeamCity
 
JavaDay Kiev 2017 - Integration testing with TestContainers
JavaDay Kiev 2017 - Integration testing with TestContainersJavaDay Kiev 2017 - Integration testing with TestContainers
JavaDay Kiev 2017 - Integration testing with TestContainers
 
GeeCON Prague 2017 - TestContainers
GeeCON Prague 2017 - TestContainersGeeCON Prague 2017 - TestContainers
GeeCON Prague 2017 - TestContainers
 
JavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloadingJavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloading
 
JavaOne 2017 - TestContainers: integration testing without the hassle
JavaOne 2017 - TestContainers: integration testing without the hassleJavaOne 2017 - TestContainers: integration testing without the hassle
JavaOne 2017 - TestContainers: integration testing without the hassle
 
JavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloadingJavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloading
 
JavaZone 2017 - The Hitchhiker’s guide to Java class reloading
JavaZone 2017 - The Hitchhiker’s guide to Java class reloadingJavaZone 2017 - The Hitchhiker’s guide to Java class reloading
JavaZone 2017 - The Hitchhiker’s guide to Java class reloading
 
JUG.ua 20170225 - Java bytecode instrumentation
JUG.ua 20170225 - Java bytecode instrumentationJUG.ua 20170225 - Java bytecode instrumentation
JUG.ua 20170225 - Java bytecode instrumentation
 
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloadingRiga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
 
GeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassleGeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassle
 
JEEConf 2017 - The hitchhiker’s guide to Java class reloading
JEEConf 2017 - The hitchhiker’s guide to Java class reloadingJEEConf 2017 - The hitchhiker’s guide to Java class reloading
JEEConf 2017 - The hitchhiker’s guide to Java class reloading
 
JEEConf 2017 - Having fun with Javassist
JEEConf 2017 - Having fun with JavassistJEEConf 2017 - Having fun with Javassist
JEEConf 2017 - Having fun with Javassist
 

Devclub 01/2017 - (Не)адекватное Java-интервью

  • 2.
  • 3.
  • 4. https://twitter.com/mxcl/status/608682016205344768 Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off. Max Howell @mxcl
  • 5. https://www.facebook.com/aleksandr.jastremski/ posts/1859123867664822?pnref=story Проверяется твое умение оперировать названиями абстрактных алгоритмов, знание всех видов сортировки и отличия их от кошки Шрёдингера.
  • 6. https://www.facebook.com/aleksandr.jastremski/ posts/1859123867664822?pnref=story Проверяется твое умение оперировать названиями абстрактных алгоритмов, знание всех видов сортировки и отличия их от кошки Шрёдингера. Вам вообще нужно что-бы этот человек пришел и начал делать "Работу"? Или у вас конкурс на самого пафосного чувака?
  • 7. Приходит к нам, значит, Ерлангист. А мы ему кусок кода на С++, "где-то тут критический баг, поправь. Два часа тебе на изучение JVM". https://www.facebook.com/aleksey.shipilev/posts/10154469128968049?pnref=story
  • 8. https://www.facebook.com/aleksey.shipilev/posts/10154469128968049?pnref=story Приходит к нам, значит, Ерлангист. А мы ему кусок кода на С++, "где-то тут критический баг, поправь. Два часа тебе на изучение JVM". На самом деле, у нас в проектах ramp-up даже крутейших инженеров занимает от 3 месяцев. [….] Никто в своём уме не будет думать, что чувак сможет правильно что-то починить, если он не знает кодобазы, прошлого опыта, и проч.
  • 9. https://www.facebook.com/aleksey.shipilev/posts/10154469128968049?pnref=story Приходит к нам, значит, Ерлангист. А мы ему кусок кода на С++, "где-то тут критический баг, поправь. Два часа тебе на изучение JVM". На самом деле, у нас в проектах ramp-up даже крутейших инженеров занимает от 3 месяцев. [….] Никто в своём уме не будет думать, что чувак сможет правильно что-то починить, если он не знает кодобазы, прошлого опыта, и проч.
  • 11. 5 минутСвоё мнение о кандидате вы составляете за первые 5 минут общения. Остальное время вы используете лишь для того, чтобы убедиться, или разубедиться, в своём мнении.
  • 12. Какие вопросы бывают? Алгоритмические задачки Вопросы на знание ЯП (Java) Вопросы на знание стандартной библиотеки (JDK) Вопросы на знание фреймворков (Spring)
  • 13. Какие вопросы бывают? Вопросы о дизайне (как бы ты сделал…) Общие вопросы по программированию Вопросы о предыдущем опыте
  • 17. public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } }
  • 18. public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } } public class Solution { public TreeNode invertTree(TreeNode root) { if(root == null){ return root; } TreeNode node = new TreeNode(root.val); node.left = invertTree(root.right); node.right = invertTree(root.left); return node; } }
  • 19. public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } } public class Solution { public TreeNode invertTree(TreeNode root) { if(root == null){ return root; } TreeNode node = new TreeNode(root.val); node.left = invertTree(root.right); node.right = invertTree(root.left); return node; } }
  • 20. public class Solution { public TreeNode invertTree(TreeNode root) { if (root == null) { return null; } final Queue<TreeNode> queue = new LinkedList<>(); queue.offer(root); while(!queue.isEmpty()) { final TreeNode node = queue.poll(); final TreeNode left = node.left; node.left = node.right; node.right = left; if(node.left != null) { queue.offer(node.left); } if(node.right != null) { queue.offer(node.right); } } return root; } }
  • 21. Найдите все пермутации букв в строке. Напишите функцию для реверса строки. Реализуйте BFS и DFS для обхода дерева, дайте оценку времени исполнения и потребления памяти. …
  • 22. Create a function that takes a string as a parameter. This function will return and integer calculated with the number of occurrence of characters in String used as parameter: Magic number:
  • 23. Create a function that takes a string as a parameter. This function will return and integer calculated with the number of occurrence of characters in String used as parameter: Magic number: result = number of 'a' * number of 'p' or 'r' or 't' or 'f' + number of 'e' * number of 'n' or 'm' - number of ' ' * number of 'a' + number of 'n' or 'm'
  • 24. Create a function that takes a string as a parameter. This function will return and integer calculated with the number of occurrence of characters in String used as parameter: Magic number: magicNumber("i love java"); // returns -4 result = number of 'a' * number of 'p' or 'r' or 't' or 'f' + number of 'e' * number of 'n' or 'm' - number of ' ' * number of 'a' + number of 'n' or 'm'
  • 25. Что такое “number of”? result = number of 'a' * number of 'p' or 'r' or 't' or 'f' + number of 'e' * number of 'n' or 'm' - number of ' ' * number of 'a' + number of 'n' or 'm' Как это считать?
  • 26.
  • 27. “Найдите самую релевантную комбинацию для поиска из трёх слов.”
  • 28. 2 4 17 44 71 119 554 661 669 771 818 6 8 19 21 25 41 52 59 111 255 414 7 9 33 37 39 55 57 99 101 241 340 “Найдите самую релевантную комбинацию для поиска из трёх слов.”
  • 29. 2 4 17 44 71 119 554 661 669 771 818 6 8 19 21 25 41 52 59 111 255 414 7 9 33 37 39 55 57 99 101 241 340 “Найдите самую релевантную комбинацию для поиска из трёх слов.”
  • 30. 2 4 17 44 71 119 554 661 669 771 818 6 8 19 21 25 41 52 59 111 255 414 7 9 33 37 39 55 57 99 101 241 340 “Найдите самую релевантную комбинацию для поиска из трёх слов.”
  • 31. 2 4 17 44 71 119 554 661 669 771 818 6 8 19 21 25 41 52 59 111 255 414 7 9 33 37 39 55 57 99 101 241 340 “Найдите самую релевантную комбинацию для поиска из трёх слов.”
  • 32. 2 4 17 44 71 119 554 661 669 771 818 6 8 19 21 25 41 52 59 111 255 414 7 9 33 37 39 55 57 99 101 241 340 “Найдите самую релевантную комбинацию для поиска из трёх слов.”
  • 33. 2 4 17 44 71 119 554 661 669 771 818 6 8 19 21 25 41 52 59 111 255 414 7 9 33 37 39 55 57 99 101 241 340 “Найдите самую релевантную комбинацию для поиска из трёх слов.”
  • 34. 2 4 17 44 71 119 554 661 669 771 818 6 8 19 21 25 41 52 59 111 255 414 7 9 33 37 39 55 57 99 101 241 340 “Найдите самую релевантную комбинацию для поиска из трёх слов.”
  • 35. 2 4 17 44 71 119 554 661 669 771 818 6 8 19 21 25 41 52 59 111 255 414 7 9 33 37 39 55 57 99 101 241 340 “Найдите самую релевантную комбинацию для поиска из трёх слов.”
  • 36. 2 4 17 44 71 119 554 661 669 771 818 6 8 19 21 25 41 52 59 111 255 414 7 9 33 37 39 55 57 99 101 241 340 “Найдите самую релевантную комбинацию для поиска из трёх слов.”
  • 37. 2 4 17 44 71 119 554 661 669 771 818 6 8 19 21 25 41 52 59 111 255 414 7 9 33 37 39 55 57 99 101 241 340 “Найдите самую релевантную комбинацию для поиска из трёх слов.”
  • 38. 2 4 17 44 71 119 554 661 669 771 818 6 8 19 21 25 41 52 59 111 255 414 7 9 33 37 39 55 57 99 101 241 340 “Найдите самую релевантную комбинацию для поиска из трёх слов.”
  • 39. 2 4 17 44 71 119 554 661 669 771 818 6 8 19 21 25 41 52 59 111 255 414 7 9 33 37 39 55 57 99 101 241 340 “Найдите самую релевантную комбинацию для поиска из трёх слов.” Вопрос: когда поиск остановится?
  • 41. FizzBuzzWrite a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
  • 42. Вопросы на знание ЯП (Java edition) Классика жанра
  • 45. В чём разница между абстрактным классом и интерфейсом?
  • 46. Параметры методов в Java передаются по значению или по ссылке?
  • 47. class Foo { void boo() { class Bar {} Bar b = new Bar(); System.out.println(b); } } Компилируется ли это код? Зачем писать такой код? Во что компилируется такой код?
  • 49. public static int foo() { try { return 0; } finally { return 42; } } finally
  • 50. public static int foo() { try { throw new RuntimeException(); } finally { return 42; } } finally
  • 51. public static void main(String[] args) { try { throw new NullPointerException("NPE 1"); } catch (NullPointerException e) { throw new NullPointerException("NPE 2"); } finally { return; } } finally
  • 53. public class Singleton { private static Singleton INSTANCE = null; private Singleton() {} public static Singleton getInstance() { if(INSTANCE == null) { INSTANCE = new Singleton(); } return instance; } }
  • 54. public class Singleton { private static Singleton INSTANCE = null; private Singleton() {} public static Singleton getInstance() { if(INSTANCE == null) { INSTANCE = new Singleton(); } return instance; } }
  • 55. public class Singleton { private static Singleton INSTANCE = null; private Singleton() {} public static Singleton getInstance() { if(INSTANCE == null) { INSTANCE = new Singleton(); } return instance; } }
  • 56. public class Singleton { private static Singleton INSTANCE = null; private Singleton() {} public static Singleton getInstance() { if(INSTANCE == null) { INSTANCE = new Singleton(); } return instance; } }
  • 57. public class Singleton { private static Singleton INSTANCE = null; private Singleton() {} public static Singleton getInstance() { if(INSTANCE == null) { INSTANCE = new Singleton(); } return INSTANCE; } }
  • 58. public class Singleton { private static Singleton INSTANCE = null; private Singleton() {} public static Singleton getInstance() { if(INSTANCE == null) { synchronized(Singleton.class){ INSTANCE = new Singleton(); } } return INSTANCE; } }
  • 59. public class Singleton { private static volatile Singleton INSTANCE = null; private Singleton() {} public static Singleton getInstance() { if(INSTANCE == null) { synchronized(Singleton.class){ INSTANCE = new Singleton(); } } return INSTANCE; } }
  • 60. public class Singleton { private static volatile Singleton INSTANCE = null; private Singleton() {} public static Singleton getInstance() { if(INSTANCE == null) { synchronized(Singleton.class){ INSTANCE = new Singleton(); } } return INSTANCE; } }
  • 61. public class Singleton { private static class Holder { private static Singleton INSTANCE = null; } private Singleton() {} public static Singleton getInstance() { return Holder.INSTANCE; } }
  • 64. Горец… …и… …ещё один горец
  • 65. Горец… …и… …ещё один горец Помните о разных загрузчиках, когда используете синглтоны!
  • 66.
  • 68. public enum Singleton { INSTANCE } PROBLEM?
  • 69.
  • 70. Что такое volatile и как это работает?
  • 71.
  • 72. What would you add to Java? How would you implement it?
  • 76. Как получить результат вызова хранимой процедуры (БД)? String proc = "{call proc(?,?)}"; stmt = con.prepareCall(proc); stmt.setInt(1, 10); stmt.registerOutParameter(2, Types.VARCHAR); stmt.executeUpdate(); String result = stmt.getString(2);
  • 77. Как получить UTF-8 представление строки? "Девклуб".getBytes("UTF-8")
  • 79. 1) Мапы поменяются местами 2) Обе мапы будут иметь содержание как в м2 3) Обе мапы будут иметь содержание как в м1 4) Этот код не компилируется! Map<String, String> m1 = stringsMap(); // {a=aaaaa, b=bbbbb} Map<String, String> m2 = numbersMap(); // {a=11111, b=22222} m2.replaceAll(m1::put); System.out.println(m1); System.out.println(m2); Java 8 Puzzlers: The Strange, the Bizarre, and the Wonderful
  • 80. Map<String, String> m1 = stringsMap(); // {a=aaaaa, b=bbbbb} Map<String, String> m2 = numbersMap(); // {a=11111, b=22222} m2.replaceAll(m1::put); System.out.println(m1); // {a=11111, b=22222} System.out.println(m2); // {a=aaaaa, b=bbbbb} 1) Мапы поменяются местами 2) Обе мапы будут иметь содержание как в м2 3) Обе мапы будут иметь содержание как в м1 4) Этот код не компилируется! Java 8 Puzzlers: The Strange, the Bizarre, and the Wonderful
  • 84. А теперь всё вместе!
  • 85.
  • 86. Примеры неадеквата Алгоритмы - если работа заключается чтоб взять данные из формочки и положить в БД Вопросы про глубинные познания JVM, если мы интервьюируем прикладного программиста Вопросы о многопоточном программировании, если мы знаем, что на работе это никогда не понадобится “Пазлеры" - если мы всегда ожидаем правильный ответ
  • 87. Вполне адекватно спрашивать Алгоритмы, если мы ищем кодера алгоритмов Вопросы про глубинные познания JVM, если мы собеседуем JVM-разработчика Вопросы о многопоточном программировании, если работа подразумевает разработки многопоточных приложений
  • 88. Базовые вопросы на знание языка в зависимости от готовности кандидата Вопросы о дизайне решений Вопросы о том какие проекты и как человек делал Вполне адекватно спрашивать