Skip to main content

Posts

Top 15 Real SQL Queries Asked in Backend Developer Interviews

Top 15 Real SQL Queries Asked in Backend Developer Interviews If you're preparing for a backend developer interview, SQL is one skill you can’t afford to ignore. Whether it's a startup or a product-based company like Amazon, Swiggy, or Paytm, SQL queries are commonly asked to test your data handling and logic-building ability. Here's a list of 15 real-world SQL queries that interviewers ask again and again — with sample table references and expected outputs. 1. Find the second highest salary from the Employee table. SELECT MAX(salary) AS Second_Highest_Salary FROM employee WHERE salary < (SELECT MAX(salary) FROM employee); 2. Retrieve employee details who have the highest salary in each department. SELECT * FROM employee e WHERE salary = ( SELECT MAX(salary) FROM employee WHERE department_id = e.department_id ); 3. Write a query to fetch duplicate records from a table. SELECT name, COUNT(*) FROM employee GROUP BY name HAVING COUNT(*) > 1; 4. Get emp...

Top 15 Java Multithreading Interview Questions – With Real-Life Examples

Top 15 Java Multithreading Interview Questions – With Real-Life Examples Multithreading is a powerful feature in Java that allows concurrent execution of two or more threads. It helps in maximizing CPU utilization and building high-performance applications. In backend interviews, especially for product-based companies, questions related to Java concurrency and multithreading are asked frequently. Here are 15 top multithreading questions with real-world examples and answers you must prepare for interviews in 2025. 1. What is the difference between a process and a thread? Process: A process is an independent program in execution with its own memory space and resources. Thread: A thread is a lightweight sub-process. Multiple threads of a process share the same memory and can communicate easily with each other. 2. How do you create a thread in Java? There are two common ways: // 1. Extending Thread class class MyThread extends Thread { public void run() { System.out...

Spring Security Explained in Simple Words – JWT, OAuth2, Role-Based Access

Spring Security Explained in Simple Words – JWT, OAuth2, Role-Based Access Introduction: Why Spring Security Matters When you're building a real-world application in Java using Spring Boot, security is not optional . You want to make sure only the right users access the right features. That’s where Spring Security comes in. But let’s be honest – most tutorials are too complex. So, in this post, let’s simplify Spring Security — including JWT , OAuth2 , and Role-Based Access Control (RBAC) — in plain language. 1. What is Spring Security? Spring Security is a powerful and customizable framework for securing Java applications. It provides: Authentication: Who are you? Authorization: What are you allowed to do? It acts as a security filter in your application and works well with: Spring MVC Spring Boot REST APIs 2. How Authentication Works in Spring Security Let’s say a user tries to log in: The user submits a login request ( username , password ) Spring Se...