🚨 Interview Experience Today 👇 Problem: Input: [0,1,0,3,12] Output: [1,3,12,0,0] ⚠️ Constraint: Do not create new/another list ⸻ 💭 My attempt (under time pressure): print(f”[{nums[1]}, {nums[3]}, {nums[4]}, {nums[0]}, {nums[0]}]”) Output: [1, 3, 12, 0, 0] ❌ Rejected ⸻ 💡 Approach shared after: nums = [num for num in nums if num != 0] + [0] * nums.count(0) print(nums) 🤔 I pointed out that this still creates a new list ⸻ 🧠 My Question: 👉 Would this still be considered valid given the constraint? 👉 Or should the expectation strictly be an in-place solution? ⸻ 💬 Curious to hear how you would approach this! #InterviewExperience #Python #CodingInterview #DataStructures #Learning #BackendDevelopment #SoftwareEngineering
In-place List Rearrangement Challenge
More Relevant Posts
-
Got asked this in my interview — "Find the missing number in an array of 1 to N" Simple question, but interviewers use it to test your math intuition and whether you know an O(n) solution. Here's what you should know: 👉 The idea : 🔹 Sum of 1 to N = N*(N+1)/2 — subtract the actual array sum. The difference is the missing number. #Python #DSA #CodingInterview #InterviewPrep #PlacementPrep
To view or add a comment, sign in
-
-
Learning never stops when you're preparing for interviews. But most candidates prepare answers. Top candidates prepare how to think. Part 7 of the Interview Questions series focuses on what interviewers actually test — problem-solving, clarity, and real-world thinking. Sharing a few important questions that can really help you think better and stay confident. Save this before your next interview. You’ll thank yourself later. #DataScience #InterviewPrep #CareerGrowth #MachineLearning #DataAnalytics #TechCareers #Learnbay
The interviewer asked one question. "𝗪𝗵𝗲𝗻 𝘄𝗼𝘂𝗹𝗱 𝘆𝗼𝘂 𝘂𝘀𝗲 𝗥𝗮𝗻𝗱𝗼𝗺 𝗙𝗼𝗿𝗲𝘀𝘁 𝗼𝘃𝗲𝗿 𝗮 𝗗𝗲𝗰𝗶𝘀𝗶𝗼𝗻 𝗧𝗿𝗲𝗲?" Most candidates fumbled. The one who got the offer answered in 30 seconds. 10 ML algorithm questions from real interviews - with clean answers. • 𝗛𝗼𝘄 𝗹𝗶𝗻𝗲𝗮𝗿 𝗿𝗲𝗴𝗿𝗲𝘀𝘀𝗶𝗼𝗻 𝘄𝗼𝗿𝗸𝘀 • 𝗟𝗼𝗴𝗶𝘀𝘁𝗶𝗰 𝗿𝗲𝗴𝗿𝗲𝘀𝘀𝗶𝗼𝗻 𝘃𝘀 𝗹𝗶𝗻𝗲𝗮𝗿 • 𝗗𝗲𝗰𝗶𝘀𝗶𝗼𝗻 𝘁𝗿𝗲𝗲𝘀 𝗲𝘅𝗽𝗹𝗮𝗶𝗻𝗲𝗱 • 𝗥𝗮𝗻𝗱𝗼𝗺 𝗳𝗼𝗿𝗲𝘀𝘁 • 𝗞𝗡𝗡 · 𝗦𝗩𝗠 · 𝗡𝗮𝗶𝘃𝗲 𝗕𝗮𝘆𝗲𝘀 • 𝗘𝗻𝘀𝗲𝗺𝗯𝗹𝗲 𝗺𝗲𝘁𝗵𝗼𝗱𝘀 • 𝗛𝘆𝗽𝗲𝗿𝗽𝗮𝗿𝗮𝗺𝗲𝘁𝗲𝗿 𝘁𝘂𝗻𝗶𝗻𝗴 Swipe. Save. Thank yourself before your next interview. 𝗖𝗼𝗺𝗺𝗲𝗻𝘁 𝗗𝗦 𝗤𝗻𝗔 👇 for all 7 parts. #DataScience #MachineLearning #InterviewTips #MLInterview #Python #DataScienceCareers #CareerGrowth
To view or add a comment, sign in
-
One simple question can decide your interview. It’s not about long answers, but clear understanding. These questions help you prepare better. #MLInterviewPrep #DataScienceJobs #LearnML
The interviewer asked one question. "𝗪𝗵𝗲𝗻 𝘄𝗼𝘂𝗹𝗱 𝘆𝗼𝘂 𝘂𝘀𝗲 𝗥𝗮𝗻𝗱𝗼𝗺 𝗙𝗼𝗿𝗲𝘀𝘁 𝗼𝘃𝗲𝗿 𝗮 𝗗𝗲𝗰𝗶𝘀𝗶𝗼𝗻 𝗧𝗿𝗲𝗲?" Most candidates fumbled. The one who got the offer answered in 30 seconds. 10 ML algorithm questions from real interviews - with clean answers. • 𝗛𝗼𝘄 𝗹𝗶𝗻𝗲𝗮𝗿 𝗿𝗲𝗴𝗿𝗲𝘀𝘀𝗶𝗼𝗻 𝘄𝗼𝗿𝗸𝘀 • 𝗟𝗼𝗴𝗶𝘀𝘁𝗶𝗰 𝗿𝗲𝗴𝗿𝗲𝘀𝘀𝗶𝗼𝗻 𝘃𝘀 𝗹𝗶𝗻𝗲𝗮𝗿 • 𝗗𝗲𝗰𝗶𝘀𝗶𝗼𝗻 𝘁𝗿𝗲𝗲𝘀 𝗲𝘅𝗽𝗹𝗮𝗶𝗻𝗲𝗱 • 𝗥𝗮𝗻𝗱𝗼𝗺 𝗳𝗼𝗿𝗲𝘀𝘁 • 𝗞𝗡𝗡 · 𝗦𝗩𝗠 · 𝗡𝗮𝗶𝘃𝗲 𝗕𝗮𝘆𝗲𝘀 • 𝗘𝗻𝘀𝗲𝗺𝗯𝗹𝗲 𝗺𝗲𝘁𝗵𝗼𝗱𝘀 • 𝗛𝘆𝗽𝗲𝗿𝗽𝗮𝗿𝗮𝗺𝗲𝘁𝗲𝗿 𝘁𝘂𝗻𝗶𝗻𝗴 Swipe. Save. Thank yourself before your next interview. 𝗖𝗼𝗺𝗺𝗲𝗻𝘁 𝗗𝗦 𝗤𝗻𝗔 👇 for all 7 parts. #DataScience #MachineLearning #InterviewTips #MLInterview #Python #DataScienceCareers #CareerGrowth
To view or add a comment, sign in
-
Most array interview questions come down to just 5 techniques. 🧩 I've seen hundreds of developers struggle on LeetCode - not because they lack intelligence, but because no one taught them the patterns. Here are the 5 array techniques that show up in 80% of interviews: 1️⃣ HashMap / Frequency Count → Turn O(n²) brute force into O(n) with a dictionary → Use for: duplicates, anagrams, top-K elements 2️⃣ Two Pointers → Left & right pointers moving inward on a sorted array → Use for: pair sums, palindromes, reversing in-place 3️⃣ Sliding Window → Maintain a subarray and slide it across → Use for: max/min subarray of size k, longest subarray with condition 4️⃣ Prefix Sum → Precompute cumulative sums for O(1) range queries → Use for: multiple range sum queries, subarray sum = target 5️⃣ Binary Search → Halve the search space each step - O(log n) → Use for: sorted/rotated arrays and search on answer problems The secret? You don't need to memorize 500 LeetCode problems. You need to recognize which pattern fits. At AlgoNur, we teach these patterns with step-by-step animated visualizations so you actually SEE what's happening, not just memorize code. 🔗 Free. No login required. Try it at https://lnkd.in/dF-zfi4r Swipe through the carousel above to see each technique with code examples. ↑ ♻️ Repost if this helps someone you know preparing for interviews. #DSA #LeetCode #CodingInterview #DataStructures #Algorithms #SoftwareEngineering #Programming #AlgoNur
To view or add a comment, sign in
-
If you are preparing for an interview, You do not need more problems in short time, You need better patterns. I structured the 10 most important DSA patterns for interviews — with curated LeetCode problems, reusable code templates, and key concepts for each. Here is the full breakdown: 1. Sliding Window — 3, 76, 424, 904 For longest/shortest subarray problems. One template covers 80% of these. 2. Two Pointers — 11, 15, 167, 42 Array must be sorted. Left and right converge. Eliminates the nested loop. 3. Binary Search — 33, 153, 875, 1011 Not just for sorted arrays. Binary search on the answer space is a game changer. 4. Hashing + Prefix Sum — 1, 49, 560, 128 Prefix sum + hashmap solves subarray sum = k in O(n). Memorise this template. 5. Monotonic Stack — 739, 503, 84, 901 Next greater element, largest rectangle. Pop when the monotonic order breaks. 6. Heap (Top K) — 215, 347, 973, 703 Maintain a min-heap of size K. The answer sits at heap[0]. 7. Intervals — 56, 435, 57, 252 Always sort by start time. Two intervals overlap if start2 is less than or equal to end1. 8. BFS / DFS — 200, 994, 102, 133 BFS for shortest path. DFS for components, cycles, and topological sort. 9. Trees — 104, 236, 543, 124 The function returns what the parent needs. A global variable tracks the cross-node answer. 10. DP Basics — 70, 198, 322, 300 Start with recursion + memoization. Convert to tabulation once the recurrence is clear. The strategy that works: Do 2 to 3 problems per pattern. Write the template from memory. Then speedrun the variants. I turned this into a clean PDF — each pattern has a code template, a problem table with difficulty levels, and an interview insight. Save this post. It is worth revisiting before every interview. #DSA #LeetCode #DataStructures #Algorithms #CodingInterview #SoftwareEngineering #Python #DataScience #CareerDevelopment #TechInterview
To view or add a comment, sign in
-
🚀 My Interview Preparation Journey Most people *memorize* star patterns. Today, I tried to **understand the logic behind them.** Here’s what I learned 👇 ✨ Golden Rules: • Rows decide the height (i controls lines) • Columns depend on pattern type → Fixed: j ≤ n → Increasing: j ≤ i → Decreasing: j ≤ n - i ✨ Pyramid Pattern Logic: • Spaces = n - i • Stars = 2*i - 1 ✨ Real Skill (Important 🔥) Whenever you see a pattern, ask: 1. How many rows? 2. What changes per row? 3. How many spaces? 4. Are stars increasing or decreasing? This completely changed how I approach problems. 📌 Sharing my handwritten notes for better understanding. Consistency > Perfection. Let’s grow step by step. 🚀 #learninginpublic #dsa #javascript #python #coding #programming #interviewpreparation #100daysofcode
To view or add a comment, sign in
-
-
One SQL mistake can change the entire interview. Not tools. Not experience. Just this: 👉 SQL 👉 Python 👉 How you think under pressure That’s what Data Engineering interviews really test. Mistakes in interviews are costly. Once you lose an opportunity, it may become someone else’s opportunity. Be prepared before you attend. Don’t attend interviews just to test your luck. We spend months chasing tools… But fundamentals are what actually decide the result. Are we preparing the right way? #DataEngineering #SQL #Python #InterviewPrep #TechCareers #Learning #CareerGrowth #Engineers #RealTalk
To view or add a comment, sign in
-
🚀 𝗚𝗿𝗼𝘂𝗽 𝗔𝗻𝗮𝗴𝗿𝗮𝗺𝘀 – 𝗙𝗿𝗼𝗺 𝗕𝗿𝘂𝘁𝗲 𝗙𝗼𝗿𝗰𝗲 𝘁𝗼 𝗢𝗽𝘁𝗶𝗺𝗮𝗹 (𝗗𝗦𝗔 𝗝𝗼𝘂𝗿𝗻𝗲𝘆) Grouping anagrams is one of the most common interview problems — and a great way to understand hashmaps, strings, and optimization. Let’s break it down step by step 👇 🔗 𝗚𝗶𝘁𝗛𝘂𝗯 𝗖𝗼𝗱𝗲: https://lnkd.in/g5pP4F4j 🔴 𝗕𝗿𝘂𝘁𝗲 𝗙𝗼𝗿𝗰𝗲 𝗔𝗽𝗽𝗿𝗼𝗮𝗰𝗵 👉 Compare each word with every other word 👉 Use character frequency to check anagrams 📌 Time Complexity: O(n² * k) 💡 Good for understanding logic, but not efficient 🟡 𝗕𝗲𝘁𝘁𝗲𝗿 𝗔𝗽𝗽𝗿𝗼𝗮𝗰𝗵 (𝗖𝗵𝗮𝗿𝗮𝗰𝘁𝗲𝗿 𝗖𝗼𝘂𝗻𝘁) 👉 Use a 26-length array (a–z) 👉 Convert it into a tuple as hashmap key 📌 Time Complexity: O(n * k) 💡 Faster and interview-friendly 🟢 𝗢𝗽𝘁𝗶𝗺𝗮𝗹 𝗔𝗽𝗽𝗿𝗼𝗮𝗰𝗵 (𝗦𝗼𝗿𝘁𝗶𝗻𝗴) 👉 Sort each word and use it as key Example: eat → aet tea → aet ate → aet 📌 Time Complexity: O(n * k log k) 💡 Clean, simple, and widely used ⚡ 𝗞𝗲𝘆 𝗟𝗲𝗮𝗿𝗻𝗶𝗻𝗴𝘀 ✅ Anagrams share the same sorted form ✅ Hashmaps are powerful for grouping ✅ Always think about time complexity ✅ Start with brute → then optimize 💬 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄 𝗧𝗶𝗽 If interviewer asks: 👉 “Can you optimize further?” → Use character count 👉 “Can you simplify?” → Use sorting approach 🔥 Practicing these patterns daily helps you crack coding interviews faster! #DSA #Python #CodingInterview #SoftwareEngineering #LeetCode #100DaysOfCode #Developers #Programming
To view or add a comment, sign in
-
-
Most candidates prepare 1000+ Python interview questions… and still get rejected. Why? Because interviews don’t test memory—they test understanding. If you can’t explain why your code works, you won’t clear the interview. Focus on: ✔ Core concepts ✔ Clear explanation ✔ Logical thinking Not just answers. I’ve compiled a concise Python interview guide focused on concept clarity over memorization. Master the concept → Crack any question. #Python #PythonDeveloper #CodingInterview #TechInterview #SoftwareEngineering #Programming #Developer #LearnToCode #CodingTips #CareerGrowth #JobPreparation #InterviewPrep #TechCareers #DataEngineering #BackendDevelopment #ProblemSolving #CodeNewbie #100DaysOfCode
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development