Home/Blog
// Blog
Answers you can run
The errors and how-tos people search for, answered plainly. Every example on these pages runs in your browser on the same engines as our free compilers, and every one was run before the post went live.
- SQLFind users who logged in on consecutive days in SQLFind users who logged in on N consecutive days in SQL with the date minus ROW_NUMBER trick, handle repeat logins, use LAG, and get each user's longest streak.
- SQLWindow function vs GROUP BY in SQL: when to use eachWindow function vs GROUP BY in SQL: GROUP BY folds rows into one per group, a window function keeps every row. Runnable examples of both, and both together.
- SQLBest sites to practice SQL for interviews, compared by roleThe best sites to practice SQL for interviews: DataLemur, StrataScratch and HackerRank, what each has free and who each suits, checked 16 Nov 2026.
- JavaScriptCannot read properties of undefined (reading 'map'): the fixWhy JavaScript says it cannot read properties of undefined (reading 'map'), the four places the missing array comes from, and how to fix each one.
- SQLTop N per group in SQL: ROW_NUMBER, ties, LATERAL and no windowGet the top N rows per group in SQL with ROW_NUMBER and PARTITION BY, keep ties with RANK, use LATERAL or DISTINCT ON, and do it without window functions.
- SQLLeetCode SQL alternatives for interview practice, comparedLeetCode SQL alternatives: DataLemur, StrataScratch and HackerRank, what each has free, what each costs and who each suits, checked 9 Nov 2026.
- SQLRunning total in SQL: SUM OVER, ties, groups and monthly resetsCalculate a running total in SQL with SUM() OVER, fix repeated totals on tied dates, restart it per group or month, and do it without window functions.
- PythonIndexError: list assignment index out of range in Python: the fixWhy Python says list assignment index out of range on an empty list, in a for loop or a 2D list, and how append, [None] * n or a dict fixes it.
- SQLSecond highest salary in each department in SQL, with tiesFind the second highest salary in each department with DENSE_RANK and PARTITION BY, without window functions, and with NULL for one-salary departments.
- SQLDataLemur alternatives for SQL interview practice, comparedDataLemur alternatives for SQL interviews: StrataScratch, LeetCode and HackerRank, what each has free and who each suits, checked 30 Oct 2026.
- SQLHow to find duplicate rows in SQL and see every copyFind duplicate rows in SQL with GROUP BY and HAVING, list every copy with its id, match on several columns, and pick the extra rows to delete.
- SQLRANK vs DENSE_RANK vs ROW_NUMBER in SQL, explained with tiesHow RANK, DENSE_RANK and ROW_NUMBER number tied rows, and which one to use for top N, one row per group and the Nth highest value, with runnable SQL.
- SQLStrataScratch vs LeetCode: which to use for SQL interviewsStrataScratch vs LeetCode for SQL and data interviews: what each covers, how many questions are free, and which fits your role, checked 19 Oct 2026.
- SQLSecond highest salary in SQL: queries that handle tiesFour ways to find the second highest salary in SQL, the tie that breaks LIMIT 1 OFFSET 1, returning NULL when there is none, and the Nth highest.
- SQLIs DataLemur free? What you get without payingWhich DataLemur questions are free, what Premium costs and adds, and when the free tier is enough for SQL interview prep, checked 14 Oct 2026.
- Godeclared and not used in Go: why it fails and how to fix itWhy Go refuses to compile a local variable or an import you never use, the cases that cause it, and the fixes for each, with examples you can run.
- JavaScriptTypeError: Cannot read properties of undefined, and the fixWhy JavaScript cannot read a property of undefined or null, the places that value comes from, and how to fix each one, with examples you can run.
- CArray index out of bounds in C: why there is no errorWhy C reads and writes past the end of an array without an error or a segfault, what it breaks, and the compiler flags that name the exact line.
- SQLColumn must appear in the GROUP BY clause: the PostgreSQL fixWhat PostgreSQL means by a column that must appear in the GROUP BY clause, four fixes you can run, and how to get the whole top row in each group.
- PythonIndexError: list index out of range in Python, and how to fix itWhat Python's list index out of range error means, why a for loop causes it, the tuple and pop versions, and the fix for each, with examples you can run.
- PythonTypeError: 'NoneType' object is not subscriptable, and the fixWhy Python says None is not subscriptable, where the None comes from, including sort(), recursion and pandas inplace=True, and how to fix each one.
// How these posts are made
How we write and test these posts
Each post answers one error or one task, the way someone stuck would search for it. An AI writer drafts the post, and nothing goes live until every example in it has run: a check opens the built page in a browser, under the same settings as this site, presses Run on each example twice, and compares what it printed with the output shown under it. A post whose code does not print what its text says is not published.
The examples run on the compiler pages you can use yourself, and every post says which language version ran them and on what day. Where our compiler words an error differently from the tool you use, the post says so. Claims about other tools that no example can show are kept to what we are sure of.
Spotted a wrong output or a claim that does not hold? Tell us at info@prepshotz.com and we will fix the post and date the change.