Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Kotlin puzzler
Search
Gorita
March 17, 2019
Programming
0
92
Kotlin puzzler
interesting kotlin language quiz.
Gorita
March 17, 2019
Tweet
Share
More Decks by Gorita
See All by Gorita
Advanced MVP(refactoring MVP)
gorita
0
260
Other Decks in Programming
See All in Programming
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
210
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
190
Package Management Learnings from Homebrew
mikemcquaid
0
220
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
2
510
MUSUBIXとは
nahisaho
0
130
Data-Centric Kaggle
isax1015
2
770
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
220
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
AtCoder Conference 2025
shindannin
0
1.1k
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
190
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.8k
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
110
Crafting Experiences
bethany
1
48
The SEO identity crisis: Don't let AI make you average
varn
0
68
Designing for Performance
lara
610
70k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
210
Facilitating Awesome Meetings
lara
57
6.8k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
99
Transcript
Kotlin Puzzler to help your “Huh?” situations PARK MIREUK
This session is 7 puzzles 01 1min ~ 1.5min to
solve 02 interpretation 03 https://goo.gl/ejrMtw
Purpose -Not a test -Save your debugging time -To understand
kotlin language -For fun (remember easily) Before.. https://goo.gl/ejrMtw
My BankAccount 01
result: 1. a and b is equal:true 2. a and
b is equal:false https://goo.gl/ejrMtw
result: 1. a and b is equal:true 2. a and
b is equal:false https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
The compiler automatically derives the following members from all properties
declared in the primary constructor: - equals(), hashCode(), toString(), componentN(), copy() https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
Engineer’s lover 02
result: 1. There is no lover. 2. Soo:null 3. nothing
https://goo.gl/ejrMtw
result: 1. There is no lover. 2. Soo:null 3. nothing
https://goo.gl/ejrMtw
“I don’t know…maybe ?.let doing something..” Why?? https://goo.gl/ejrMtw
Let’s talk about ?.let Use ‘?.let’ for null check? •
Yes, you can. https://goo.gl/ejrMtw
Let’s talk about ?.let Use ‘?.let’ for null check? •
Yes, you can. • But, checking null works with safe call ?. not related with let https://goo.gl/ejrMtw
Let’s talk about ?.let let, run, also, apply . •
Expression • Scope https://goo.gl/ejrMtw
Let’s talk about ?.let let, run, also, apply . •
Expression • Opposite of Statement • Has returns • Scope https://goo.gl/ejrMtw
Let’s talk about ?.let let, run, also, apply . •
Expression • Opposite of Statement • Has returns • Scope https://goo.gl/ejrMtw
result: 1. There is no lover. 2. Soo:null 3. nothing
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
If the expression to the left of ?: is not
null, the elvis operator returns it, otherwise it returns the expression to the right. Execute expression to the left of ?: is null, Not ‘james.lover’ is null https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
Execute expression to the left of ?: is null https://goo.gl/ejrMtw
Easy Book 03
result: 1. hasAuthorName:true 2. hasAuthorName:false https://goo.gl/ejrMtw
result: 1. hasAuthorName:true 2. hasAuthorName:false https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
Need to check operator != first. Left expression of !=
and right expression of !=. https://goo.gl/ejrMtw
No account, No password 04
result: account is 1. empty. 2. . 3. null. password
is 1. empty. 2. . 3. null. https://goo.gl/ejrMtw
result: account is 1. empty. 2. . 3. null. password
is 1. empty. 2. . 3. null. https://goo.gl/ejrMtw
result: account is 1. empty. 2. . 3. null. password
is 1. empty. 2. . 3. null. https://goo.gl/ejrMtw
result: account is 1. empty. 2. . 3. null. password
is 1. empty. 2. . 3. null. https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
null “null” https://goo.gl/ejrMtw
result: account is 1. empty. 2. . 3. null. password
is 1. empty. 2. . 3. null. https://goo.gl/ejrMtw
My name is 05
result: 1. Hello, my name is james 2. Hello, my
name is 3. nothing https://goo.gl/ejrMtw
result: 1. Hello, my name is james 2. Hello, my
name is 3. nothing https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
Compile error https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
Memo 06
result: 1. pass 2. fail https://goo.gl/ejrMtw
result: 1. pass 2. fail https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
junit assert kotlin assert$ https://goo.gl/ejrMtw
% “write failing test first” remember https://goo.gl/ejrMtw
Be our guest 07
result: https://goo.gl/ejrMtw
result: 1:6, 2:6 3:6, 4:7, 5:7 6:6, 7:8, 9:7
https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
1. Same as java final https://goo.gl/ejrMtw
https://goo.gl/ejrMtw
2. Hire at least two.. https://goo.gl/ejrMtw
Thank You
Thank You