Day 20 / 90 — Software Engineering Challenge Today was focused on understanding bit manipulation and binary operations. DSA Practice (Bit Manipulation) Solved problems on: • Check if the i-th bit is set or not • Check if a number is odd or even • Check if a number is a power of 2 • Count the number of set bits • Set/Unset the rightmost unset bit • Swap two numbers using XOR • Divide two numbers without using multiplication or division Bitwise operations can significantly optimize computations XOR has unique properties useful for swapping and comparisons Checking powers of 2 becomes simple using bit tricks Binary representation helps in understanding how data is processed at a low level Bit manipulation may look simple, but it’s extremely powerful for writing efficient code. Exploring deeper into how things work at the binary level. #90DaysOfCode #DSA #BitManipulation #SoftwareEngineering #LearningInPublic
Day 20: Mastering Bit Manipulation for Efficient Code
More Relevant Posts
-
Day 19 / 90 — Software Engineering Challenge Today was focused on revising important problem-solving patterns and strengthening understanding. DSA Practice Revisited: • Largest Subarray with Sum 0 • Count Subarrays with XOR = K • Merge Overlapping Intervals • Merge Two Sorted Arrays (without extra space) Key learnings: • Prefix sum + hashmap is powerful for subarray problems • XOR helps solve problems efficiently with unique properties • Interval problems require sorting + careful merging logic • In-place operations help optimize space complexity Focusing more on understanding patterns deeply rather than just solving new problems. #90DaysOfCode #DSA #ProblemSolving #SoftwareEngineering #LearningInPublic
To view or add a comment, sign in
-
🎯 MY APPROACH 1️⃣ Here, first of all I check whether a number n is positive or not if it is positive then we can proceed. 2️⃣ In the next expression, we simply check whether it is the power of two or not. 3️⃣ Then I combine both the expression by using logical AND operator. 4️⃣ To check whether a number is power of two or not. We simply anding a number n with the very number decrement by one and check if it returns 0 as an output then it is power of two otherwise not. 5️⃣ Atlast, we return the combined expression. #LeetCode #cp_sheet #BitManipulation #LeetcodeSolution #ProblemSolving #Consistency
To view or add a comment, sign in
-
-
🚀 Just published my Unified Memory Debugger – a production‑inspired C++ memory debugging suite. It combines three integrated components: (i) Raw allocator tracker (global new/delete override) (ii) Logical dataset tracker (named objects + age) (iii) Smart pointer connection pool (RAII) 🎯 The goal: Provide a plug‑and‑play memory debugging tool for large‑scale scientific software like GROMACS, which has known memory leak and excessive consumption issues. 📂 Project is still in progress – but the current code is ready to test. 🔗 GitHub: https://lnkd.in/dTt4tiYA Feedback, issues, and contributions welcome! 🙏 #Cpp #MemoryManagement #Debugging #HighPerformanceComputing #GROMACS #OpenSource
To view or add a comment, sign in
-
Hi folks, I was building a personal project this weekend and ended up using a lot of smart pointers in C++. Ive noticed that many people find them confusing at first, so here’s a simple way I think about them: 1. std::unique_ptr Use this when there is clear, single ownership. The object’s lifetime is tied to one owner, and ownership can be transferred using std::move. 2. std::shared_ptr Use this when multiple parts of your system need to share ownership of an object. The object lives until the last reference is released, preventing premature deletion. Be careful though cyclic references can lead to memory leaks. 3. std::weak_ptr A non-owning reference to an object managed by shared_ptr. It does not affect the object’s lifetime and is mainly used to break cyclic dependencies. Still exploring more real-world patterns around this. Would love to hear how others approach this. #cpp #multithreading #systemsprogramming
To view or add a comment, sign in
-
The Spring 2026 release of Boost comes with upgrades to 25+ libraries and the new Boost.Decimal, of particular interest to quants and numerical programmers. https://lnkd.in/gM72sRje We've had a small repo reorganization (StaticAssert moved into Config) and there's been some exciting activity related to C++20 modules (LexicalCast) and C++26 reflection (PFR). Take a look at the release notes, experiment with the new features and tell us what you think!
To view or add a comment, sign in
-
-
Thanks to Boost.org for releasing1.91.0 of their excellent C++ libraries. This version add support for building with the latest MSVC toolset (v145 -VS2026) out of the box. I heartily recommend all C++ programmers look at Boost.
The Spring 2026 release of Boost comes with upgrades to 25+ libraries and the new Boost.Decimal, of particular interest to quants and numerical programmers. https://lnkd.in/gM72sRje We've had a small repo reorganization (StaticAssert moved into Config) and there's been some exciting activity related to C++20 modules (LexicalCast) and C++26 reflection (PFR). Take a look at the release notes, experiment with the new features and tell us what you think!
To view or add a comment, sign in
-
-
During Long-horizon coding, Kimi K2.6 autonomously overhauled exchange-core, an 8-year-old open-source financial matching engine. Over a 13-hour execution, the model iterated through 12 optimization strategies, initiating over 1,000 tool calls to precisely modify more than 4,000 lines of code. Acting as an expert systems architect, Kimi K2.6 analyzed CPU and allocation flame graphs to pinpoint hidden bottlenecks and boldly reconfigured the core thread topology (from 4ME+2RE to 2ME+1RE). Despite the engine already operating near its performance limits, Kimi K2.6 extracted a 185% medium throughput leap (from 0.43 to 1.24 MT/s) and a 133% performance throughput gain (soaring from 1.23 to 2.86 MT/s).
To view or add a comment, sign in
-
-
🔍 One interesting pattern I keep seeing in large C++ systems: Performance regressions that initially look algorithmic. Teams suspect: 💡 a slow container 💡 a suboptimal algorithm 💡 too much locking But after profiling, the root cause often ends up somewhere else entirely. A few examples I've seen: ⏳ unexpected allocations in hot paths ⏳ cache-unfriendly data layouts ⏳ logging frameworks doing hidden work ⏳ thread contention in utility layers The difficult part is that these problems rarely show up in small tests. They only appear under real production workloads. Curious if others working on large C++ systems have encountered similar patterns. #cpp #softwareengineering
To view or add a comment, sign in
-
Of course, this isn’t an STL bug. It’s normal behaviour. A simple solution is to use indices and `size()` instead of iterators. This approach will work even if the vector or other container is reallocated, and will have virtually no impact on the programme’s performance.
To view or add a comment, sign in
-
I used to add std::move everywhere to "optimise" my C++. Turns out... I was sometimes making things slower. Two surprising cases: 1. It can block compiler optimisations. For instance, this: return std::move(local); can prevent Named Return Value Optimisation (NRVO/RVO) because it forces the compiler to treat local as an rvalue, preventing it from eliding the copy/move entirely. So instead of zero-cost, I was forcing an extra move. 2. It is pointless for small types. For trivially copyable types, moving is effectively the same as copying. Example: struct Point { int x,y; } Point a{1,2}; Point b = std::move(a); //no real gain since a is effectively copied We are not saving anything here; in fact, it could potentially add extra noise. One big takeaway for me is: std::move is not an optimisation, it is more of a signal. It tells the compiler "I am done with the object, you can steal its resources". So now, I only use it when it actually matters, such as types that own heap memory. What surprised you most about std::move when you learned it properly? #CPlusPlus #optimization #moderncpp
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