Tag Archives: data structure

30 most common SQL queries with examples

By | March 18, 2025

Here are the 30 common SQL queries with examples. These cover a wide range of database operations from basic to more advanced. Basic SELECT Queries Filtering and Conditions Aggregations and Grouping Joins Subqueries Data Modification Advanced Queries These queries cover the most common operations you’ll need when working with SQL databases. Each example can be… Read More »

Problem: There are N prisoners standing in a circle, waiting to be executed…

By | June 27, 2023

There are N prisoners standing in a circle, waiting to be executed. The executions are carried out starting with the kth person, and removing every successive kth person going clockwise until there is no one left. Given N and k, write an algorithm to determine where a prisoner should stand in order to be the… Read More »