✅ Coding Interview Questions with Answers Part-5 🧠💻
41. What is exception handling
Exception handling manages runtime errors.
• Prevents crashes
• Keeps program running
Try-catch-finally blocks handle errors (e.g., divide by zero).
42. Checked vs unchecked exceptions
Checked: compile-time, must handle (e.g., IOException).
Unchecked: runtime, not forced (e.g., NullPointerException).
Checked equals predictable.
43. Mutable vs immutable object
Mutable: state changes (e.g., List).
Immutable: state fixed (e.g., String).
Immutability provides thread safety and easier debugging.
44. What is garbage collection
Garbage collection frees unused memory.
Tracks unreachable objects and deletes them (Java, Python).
Reduces memory leaks.
45. What is REST API
REST API enables client-server communication via HTTP methods (GET, POST, PUT, DELETE).
Stateless requests (e.g., fetch user data).
46. What is JSON
JSON: lightweight, readable data format.
Language-independent, used in API responses (key-value pairs).
47. HTTP vs HTTPS
HTTP: no encryption, less secure.
HTTPS: encrypted, protects user data.
48. What is version control? Why Git matters
Version control tracks code changes. Git enables collaboration, rollback, and branch management.
Used by all tech teams.
49. Explain a coding problem you optimized recently
State problem, bottleneck, optimization, and result (e.g., reduced nested loops, improved O(n²) to O(n)).
50. How you approach a new coding problem
1. Understand problem
2. Clarify constraints
3. Brute force
4. Optimize
5. Test edge cases
Think aloud; interviewers watch process.
Double Tap ♥️ For More
Post #2771
1.56K
- ❤ 4