Core Java · Collections · Spring Boot · MySQL
Delivered by Aditya Dua
Sr. Manager, Field Services — GitHub India
KL University · Skill Development Division | 110 Industry Problems →
✔ You will learn
✗ This is NOT
"AI can write the code. But it can't do the thinking for you."
Make it clear
→ Make it correct
→ Make it clean
Choose based on your comfort level — both tracks lead to a valid submission
☕
Java Track
Build a solid, well-tested core Java solution
Module A / B problems
🚀
Full-Stack Track
Build a REST API backed by a real database
Module C+ problems
Convert any statement into an engineering contract
| Point | Question |
|---|---|
| Inputs | What data comes in? |
| Outputs | What must be produced? |
| Rules | What business logic applies? |
| Edge Cases | Where can logic break silently? |
| Constraints | Any limits on values or formats? |
| Assumptions | What are you assuming when unstated? |
⚡ Rule: If a team can't state inputs/outputs in 2 minutes — they are NOT ready to code
What does this print?
int marks = 450;
int total = 500;
System.out.println("Percentage: " + marks/total * 100);
💥 Integer division! 450/500 = 0, then 0 * 100 = 0.
Fix: (double) marks / total * 100
🏗 Use a Class when
Multiple fields + behavior belong together
Employee — name, salary, computePay()
🧬 Use Inheritance when
"IS-A" relationship exists
SavingsAccount IS-A Account
🔧 Use Subclass when
Behavior differs by type
FDAccount lock-in vs CurrentAccount overdraft
Dog IS-A Animal · SavingsAccount IS-A Account
Car HAS-A Engine · Employee HAS-A Address
| Need | Use | Example |
|---|---|---|
| Ordered items | List<T> | Cart, price ticks, log lines |
| No duplicates | Set<T> | Unique customers, keywords |
| Key→Value lookup | Map<K,V> | Word counts, category rates |
| FIFO queue | Queue<T> | ATM queue, task scheduler |
Click an answer — can you go 4/4? 🎯
Q1: You're storing which state belongs to which country. What do you use?
✅ Map<String, String> — state is the key, country is the value. Perfect key→value lookup!
Q2: You want to track all unique students who visited the library today. What do you use?
✅ Set<String> — automatically rejects duplicate entries. If a student swipes twice, counted once!
Q3: Students are standing in a canteen queue — first come, first served. What do you use? 🍱
✅ Queue<String> — First In, First Out. Exactly how a canteen (should) work!
Q4: You want to keep your Swiggy order history in the order you placed them. What do you use? 🍕
✅ List<Order> — maintains insertion order, allows you to order biryani twice. No judgment!
☕ Spring Boot Server
Controller (thin — no logic!)
@RestController
@RequestMapping("/api/submissions")
public class SubmissionController {
@Autowired SubmissionService svc;
@PostMapping
public ResponseEntity> create(
@RequestBody Submission s) {
return ResponseEntity.ok(
svc.create(s));
}
}
Service (logic owner)
@Service
public class SubmissionService {
@Autowired SubmissionRepository repo;
public Submission create(Submission s) {
if (s.getStudentName() == null)
throw new IllegalArgumentException(
"Name required");
s.setStatus("SUBMITTED");
return repo.save(s);
}
}
Q1: Your code checks "if score > 40, student passes". Where does this go?
✅ Service layer — any business rule goes in Service. Controller just passes it through.
Q2: A waiter in a restaurant is like which Spring Boot layer? 🍽
✅ Controller = waiter (takes request, delivers response). Service = chef (does the real work). Repository = fridge (stores stuff). DB = pantry 😄
✅ Happy Path
❌ Error Paths
⚡ Design happy path AND failure path together.
"The best engineers don't just write code —
they make the machine think what they thought."
Tonight: think deeply.
Tomorrow: build fast.
Always: ship something real.
— Aditya Dua · Sr. Manager, Field Services · GitHub India