Coding Interview Resources
52.1K subscribers
817 photos
7 files
502 links
This channel contains the free resources and solution of coding problems which are usually asked in the interviews.

Managed by: @love_data
Download Telegram
๐Ÿง  SQL Interview Question (Moderateโ€“Tricky & Duplicate Transaction Detection)
๐Ÿ“Œ

transactions(transaction_id, user_id, transaction_date, amount)

โ“ Ques :

๐Ÿ‘‰ Find users who made multiple transactions with the same amount consecutively.

๐Ÿงฉ How Interviewers Expect You to Think

โ€ข Sort transactions chronologically for each user
โ€ข Compare the current transaction amount with the previous one
โ€ข Use a window function to detect consecutive duplicates

๐Ÿ’ก SQL Solution

SELECT
user_id,
transaction_date,
amount
FROM (
SELECT
user_id,
transaction_date,
amount,
LAG(amount) OVER (
PARTITION BY user_id
ORDER BY transaction_date
) AS prev_amount
FROM transactions
) t
WHERE amount = prev_amount;

๐Ÿ”ฅ Why This Question Is Powerful

โ€ข Tests understanding of LAG() for row comparison
โ€ข Evaluates ability to identify patterns in sequential data
โ€ข Reflects real-world use cases like detecting suspicious or duplicate transactions

โค๏ธ React if you want more tricky real interview-level SQL questions ๐Ÿš€
โค5
๐Ÿš€ ๐—ง๐—–๐—ฆ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ โ€“ ๐—˜๐—ป๐—ฟ๐—ผ๐—น๐—น ๐—ก๐—ผ๐˜„!

TCS iON is offering FREE certification courses to help students, freshers & professionals build job-ready skills from home ๐ŸŒ

โœ… 100% Free Online Courses
โœ… Free Verified Certificates
โœ… Self-Paced Learning
โœ… Beginner-Friendly Programs
โœ… Learn from TCS Industry Experts

๐Ÿ”— ๐—˜๐—ป๐—ฟ๐—ผ๐—น๐—น ๐—™๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜๐Ÿ‘‡:

https://pdlink.in/4nTGSDh

๐Ÿ”ฅ Excellent opportunity to gain valuable certifications from one of Indiaโ€™s top IT companies completely FREE.
โœ… Coding Interview Prep Guide ๐Ÿ’ป๐Ÿ”ฅ

1๏ธโƒฃ Core Programming Fundamentals
โ€ข Variables, data types, operators
โ€ข Control flow (loops, conditions)
โ€ข Functions recursion
โ€ข Time space complexity basics
โ€ข Debugging mindset

2๏ธโƒฃ Data Structures (High Priority)
โ€ข Arrays Strings
โ€ข Linked Lists
โ€ข Stacks Queues
โ€ข HashMaps / Dictionaries
โ€ข Trees Binary Trees
โ€ข Heaps Priority Queues
โ€ข Graphs (BFS, DFS)

3๏ธโƒฃ Algorithms You MUST Know
โ€ข Searching (Binary Search)
โ€ข Sorting (Quick, Merge, Heap)
โ€ข Recursion Backtracking
โ€ข Greedy algorithms
โ€ข Dynamic Programming
โ€ข Sliding Window
โ€ข Two Pointers
โ€ข Prefix Sum

4๏ธโƒฃ Problem-Solving Patterns
โ€ข Brute force โ†’ optimized approach
โ€ข Hashing for lookups
โ€ข Divide and conquer
โ€ข Recursion โ†’ DP conversion
โ€ข Spaceโ€“time tradeoffs

5๏ธโƒฃ Language-Specific Prep
โ€ข Python / Java / C++ fundamentals
โ€ข Built-in data structures
โ€ข Edge cases constraints
โ€ข Writing clean, readable code
โ€ข Input/output handling

6๏ธโƒฃ Coding Interview Expectations
โ€ข Explain approach before coding
โ€ข Write code step-by-step
โ€ข Handle edge cases
โ€ข Analyze time space complexity
โ€ข Optimize if asked

7๏ธโƒฃ Common Interview Questions
โ€ข Reverse a string / array
โ€ข Find duplicates
โ€ข Two Sum / Subarray problems
โ€ข Palindrome checks
โ€ข Tree traversal
โ€ข LRU Cache
โ€ข Longest substring problems

8๏ธโƒฃ Where to Practice
โ€ข LeetCode (Top priority)
โ€ข HackerRank
โ€ข Codeforces
โ€ข CodeChef
โ€ข GeeksforGeeks

9๏ธโƒฃ Mock Interview Focus
โ€ข Think out loud
โ€ข Donโ€™t panic on hard questions
โ€ข Ask clarifying questions
โ€ข Partial solutions still matter
โ€ข Correct approach > perfect code

๐Ÿ”Ÿ Pro Tips
โœ”๏ธ Master patterns, not random problems
โœ”๏ธ Revise mistakes weekly
โœ”๏ธ Practice writing code without IDE help
โœ”๏ธ Speed improves with consistency
โœ”๏ธ Interviews test thinking, not memory

Double Tap โ™ฅ๏ธ For More