javinpaul.bsky.social
@javinpaul.bsky.social
33 followers 1 following 1.8K posts
Posts Media Videos Starter Packs
Review — Is Generative AI System Design Interview Book by ByteByteGo Worth It?
Review — Is Generative AI System Design Interview Book by ByteByteGo Worth It? Is Generative AI System Design Interview book by by Ali Aminian and Hao Sheng on ByteByteGo worth it Hello guys, Generative AI is no longer just a buzzword — it’s quickly becoming one of the most sought-after skills in tech. From ChatGPT to image generation systems like DALL·E and video synthesis tools, companies are racing to build products powered by large language models (LLMs) and other GenAI technologies. With FAANG and top startups adding Generative AI System Design to their interview loops, preparing for these interviews can feel overwhelming. This is where the new book Generative AI System Design Interview by Ali Aminian and Hao Sheng comes in. This book aims to provide a structured, practical guide for engineers and ML practitioners preparing for GenAI interviews. Generative AI System Design Interview The authors previously co-wrote the popular Machine Learning System Design Interview, a trusted resource for ML interview prep. Now, they’ve brought that same clarity and depth to the exciting new world of generative AI systems. Machine Learning System Design Interview By the way, if you don’t know, both #books are published under ByteByteGo umbrella and they are also available on ByteByteGo website. If you are preparing for tech interview then ByteByteGo is one of the most popular resource and I highly recommend it. If always wanted to join then now is the best time as they are also offering 50% discount on their annual and lifetime plan, which makes them even more valuable. System Design · Coding · Behavioral · Machine Learning Interviews But is this book really worth adding to your prep list? Let’s take a deep dive. What does Generative AI System Design Book Covers? The Generative AI System Design Interview books is designed to help readers think like an interviewer while tackling the unique challenges of GenAI design problems. It’s not just about theory — it focuses on actionable frameworks, real-world case studies, and clear diagrams to help you master complex concepts. Here’s what you’ll find inside: * A 7-step framework to approach any GenAI system design interview question with confidence. * 10 real-world GenAI system design questions, each explained in detail with complete solutions. * 280+ diagrams that break down complicated architectures, making even the most advanced concepts digestible. * Insider insights into what interviewers are looking for and how to structure your answers. These all are must prepare topic for any tech interview where Generative AI is required skills. I also suggest you to checkout their full table of content on Amazon to find out more. Generative AI System Design Interview Sample Chapters and Topics The book takes you through a variety of end-to-end generative AI systems, including: * Gmail Smart Compose — Designing intelligent text suggestion systems. * Google Translate — Building scalable multilingual translation using neural networks. * ChatGPT (Personal Assistant Chatbot) — Architecting large language model–based conversational AI. * Image Captioning — Bridging computer vision and natural language processing. * Retrieval-Augmented Generation (RAG) — Combining search and LLMs to build knowledge-grounded AI. * Text-to-Image and Text-to-Video Generation — Designing systems like DALL·E, Stable Diffusion, and Sora. * Realistic Face Generation & High-Resolution Image Synthesis — Handling high-performance GPU pipelines and safety constraints. This blend of interview-ready frameworks and state-of-the-art GenAI topics is exactly what modern interviews demand. Generative AI System Design Interview Why This Book Stands Out? Apart from the fact that the book is created by FAANG experts here are a couple of reasons why I think this book stands out: * Practical, Interview-Focused Approach While research papers and online tutorials often dive deep into theory, this book is tailored to interview scenarios. Each chapter teaches you how to communicate system design trade-offs, scalability considerations, and model choices in a way that resonates with hiring managers. * Real-World Case Studies From ChatGPT to personalized headshot generation, the examples are drawn directly from the systems powering today’s AI revolution. This makes the content both engaging and directly applicable to questions you might face at FAANG, OpenAI, Anthropic, or other cutting-edge AI teams. * Visual Learning with 280+ Diagrams Designing generative systems often involves complex workflows — model pipelines, retrieval systems, GPU clusters, and more. The extensive diagrams make these concepts far easier to grasp compared to plain text. * Strong Continuation of the ML System Design Series If you’ve read Machine Learning System Design Interview, you’ll immediately feel at home. The structure is familiar: concise frameworks, well-chosen case studies, and actionable takeaways. You can get the book here on Amazon — Generative AI System Design Interview How It Fits Into Your Interview Prep? If you’re targeting AI/ML roles at companies like Google, Microsoft, OpenAI, Anthropic, or top startups, GenAI design questions are increasingly common. Both, Recruiters and hiring managers expect candidates to understand: * LLM architecture and how to scale training and inference. * Serving pipelines for real-time text, image, or video generation. * Data considerations like prompt engineering, synthetic data generation, and safety. * Trade-offs between cost, latency, and model performance. This book gives you a step-by-step toolkit to confidently address these challenges. You’ll learn not only how to design systems but also how to communicate your design decisions — a skill that often separates successful candidates from the rest. As I said, this book is part of ByteByteGo and you can also read the free sample chapter on Machine Learning algorithms here Who Should Read This Book? This book is ideal for ML Engineers who are preparing for top AI/ML roles at FAANG and other top tech companies but apart from that following set of people can also benefit from this book: * Machine Learning Engineers preparing for FAANG or top AI startup interviews. * Software Engineers pivoting into AI roles and needing a crash course in GenAI system design. * Data Scientists looking to strengthen their systems knowledge for technical interviews. * Students and New Grads aiming to get ahead in a field where GenAI knowledge is becoming essential. If you’re already comfortable with basic ML concepts and want to focus specifically on generative AI architectures, this book is a perfect next step. And, if you have ByteByteGo membership then you can read this book for free here. If you don’t have ByteByteGo membership you can also get it now for 50% discount as they are running a launch sale. System Design · Coding · Behavioral · Machine Learning Interviews Complementing Other Resources While Generative AI System Design Interview is excellent for system design preparation, you’ll still want to practice coding, ML fundamentals, and traditional system design to be fully ready for FAANG-level interviews. This is where the ByteByteGo platform shines. Founded by Alex Xu (author of System Design Interview — An Insider’s Guide), ByteByteGo offers: * System Design courses covering everything from classic distributed systems to cutting-edge GenAI topics. * Coding interview practice for algorithms and data structures. * Machine Learning System Design content (including this book) all in one place. * Generative AI interview prep, including RAG, LLM serving, and scalable architectures. Right now, ByteByteGo is offering a 50% discount on both their annual and lifetime plans, making it an incredible value for anyone preparing for technical interviews. Here is the link to get discount — Join ByteByteGo now for 50% OFF Verdict — Is Generative AI System Design Interview Worth It? Absolutely. If you’re serious about breaking into AI or advancing your career in this fast-growing space, this book is one of the best investments you can make. It combines: * A proven interview framework to handle GenAI design questions. * Real-world examples of systems you’ll actually encounter in interviews. * Visual explanations that make even the most advanced architectures understandable. Whether you’re preparing for a FAANG ML Engineer role, a startup AI architect position, or simply want to stay ahead in the AI revolution, Generative AI System Design Interview provides the clarity and depth you need. Pair it with the ByteByteGo platform (now at 50% off) and you’ll have a complete toolkit for mastering everything from system design to machine learning and generative AI. System Design · Coding · Behavioral · Machine Learning Interviews Final Recommendation If you’re preparing for GenAI-focused interviews or want to understand how modern LLM systems are built and scaled, grab this book and start reading. And for a more holistic prep experience, consider the ByteByteGo lifetime plan while the discount lasts — it’s the one-stop solution for system design, coding, ML design, GenAI, and OOP design that today’s FAANG interviews demand. Other System Design and Coding Interview and Resources you may like * Is OOP Design Interview — An Insider Guide worth it? * ByteByteGo vs Udemy? Which is better for System Design inteviews? * 16 Best Resources for System Design Interview Prep * ByteByteGo 50% OFF? Should you Join? * Is ByteByteGo a good place to learn Software Architecture? * Should you join ByteByteGo to learn System Design? * Is System Design Interview RoadMap by DesignGurus worth it? * Is Exponent’s System Design Course worth it? * Is DesignGuru’s System Design Course worth it * Why AlgoMonster is best platform for DSA Prepration in 2025 * ByteByteGo vs NeetCode vs Educative? which one is better? * DesignGurus.io Review 2025 — Is it worth it? * Is ByteByteGo a good place for Coding interviews? * 3 Free Books and Courses for System Design Interviews * ByteBytego vs Exponent? which one is better? * Is ByteByteGo enough to crack FAANG interviews? * Is Exponent Good Place for Coding Interview Prep? * ByteByteGo vs Udemy? Which one is better for System Design? * 6 Best System Design and API Design Interactive Courses * Top 5 System Design YouTube Channels for Engineers * How to prepare for DSA for coding interviews? * Data Intensive Application vs System Design Insider Guide? All the best for your Generative AI System Design interview preparation and learning journey , if you have any doubts or questions, feel free to ask in the comments. P. S. — If you just want to do one thing at this moment, join ByteByteGo and start learning software architecture fundamentals and you will thank me later. It’s one of the most comprehensive resource for Gen AI System Design interview now. System Design · Coding · Behavioral · Machine Learning Interviews --- Review — Is Generative AI System Design Interview Book by ByteByteGo Worth It? was originally published in Javarevisited on Medium, where people are continuing the conversation by highlighting and responding to this story.
dlvr.it
Deepavali Deals for Developers: Best Time to Level Up and Crack FAANG Interviews (Up to 70% OFF!)
Learning discounts and #offers for developers and engineers to level up and prepare for coding interviews. credit — ByteByteGo Hello guys, the festive season is not just about lights, sweets, and celebrations — it’s also the perfect time to invest in yourself. If you’ve been dreaming of cracking FAANG interviews, mastering System Design, or upgrading your AI and coding skills, this Deepavali brings a golden opportunity. Some of the most trusted tech learning platforms are offering massive discounts — up to 70% OFF — for a limited time only. In this post, I’ve rounded up the best Deepavali deals and evergreen deals you can buy on this Deepavali for developers in 2025 that you simply shouldn’t miss. Whether you’re a beginner or an experienced engineer preparing for top tech interviews, these platforms can accelerate your growth like nothing else. 1. ByteByteGo Lifetime Plan — 50% OFF 👉 Grab Lifetime Access Here If you’re serious about System Design, ByteByteGo by Alex Xu and team needs no introduction. Their platform has become the go-to place for mastering scalable system design, architecture, and design patterns used at top tech companies. The ByteByteGo Lifetime Plan gives you access to everything — courses, video lessons, case studies, and all future updates — for a one-time fee. And right now, they’re offering a massive 50% OFF on their lifetime plan. Perfect for engineers who want to go beyond “Design Instagram” or “Build Uber” and actually understand the principles behind distributed systems, caching, messaging queues, and API design. Why it’s great: * Learn from FAANG engineers * Deep-dive into real-world systems * Constantly updated with new content * One-time payment, lifetime learning Here is the link to get discount — Join ByteByteGo now for 50% OFFcredit — ByteByteGo 2. Codemia.io Lifetime Plan — 60% OFF 👉 Get Lifetime Access Here If you want to master System Design interviews through real-world examples, Codemia.io is the hidden gem you’ve been waiting for. It’s a hands-on platform created by experienced software engineers, focusing on practical, interview-ready explanations. Their lifetime access plan covers everything from System Design fundamentals to Scalability, Load Balancing, Databases, Caching, and Distributed Systems. And this Deepavali, Codemia is offering an incredible 60% OFF on their lifetime plan — making it one of the best-value investments for FAANG aspirants. Why it’s great: * Focused entirely on interview success * Real-world projects and architecture walkthroughs * Clear, concise, and beginner-friendly * Lifetime access with all updates Here is the link to get discount — Join Codemia.io for 60% OFF 3. Exponent Annual Plan — 70% OFF 👉 Upgrade Now Exponent is your all-in-one interview prep platform — used by engineers from Google, Amazon, Meta, and startups alike. It offers video courses, mock interviews, and coaching sessions across System Design, Data Structures, and Behavioral Interviews. You’ll also find detailed video answers to hundreds of real FAANG questions. Now, Exponent is offering a jaw-dropping 70% OFF on their Annual Plan, unlocking full access to all courses, community mock interviews, and expert tips. Why it’s great: * Real FAANG interview question library * Mock interviews with feedback * Expert-designed course content * Unbeatable 70% OFF this Deepavali Here is the link to get discount — Join Exponent for 70% OFF 4. Educative Premium Plus — 55% OFF 👉 Join Educative.io with 55% OFF Educative.io remains one of the best platforms for interactive coding and system design learning — with text-based lessons, built-in coding environments, and curated learning paths. From Grokking Modern System Design Interview to Grokking the Coding Interview and LLM Engineer Skill Paths, Educative covers it all. Their Premium Plus subscription gives full access to over 1,200+ courses, covering everything from AI/ML to Cloud Architecture. Now, Educative is giving a huge 55% OFF on their yearly plan — a no-brainer if you want an all-access learning pass for 2025. Why it’s great: * 1200+ hands-on interactive courses * No setup required — learn directly in browser * Perfect for self-paced learners * Great value with 55% OFF Here is the link to get discount — Join Educative.io for 55% OFF 5. DesignGurus All Course Bundle — 30% OFF 👉 Check Offer Here If you’ve been following DesignGurus.io, you know their “Grokking” series helped define how developers prepare for interviews. Courses like Grokking the System Design Interview, Grokking the Advanced System Design Interview, and Grokking the Machine Learning Interview are now classics. Their All Course Bundle gives access to every “Grokking” course for one discounted price — and this Deepavali, you can get 30% OFF. Why it’s great: * Proven “Grokking” format loved by FAANG engineers * Covers system design, ML, DSA, and beyond * Real-world problems with practical insights * Discounted bundle = long-term value Here is the link to get discount — Get All Course Bundle for 35% OFF 6. Everything Java Interview Bundle — 50% OFF 👉 Get the Bundle Here If you’re a Java developer targeting backend, full-stack, or cloud roles — this is your all-in-one interview companion. The Everything Java Interview Bundle includes all of my grokking books and interview prep materials covering Java, Spring, REST APIs, and Microservices. It’s a lifetime resource pack designed to help you master both Java and Spring Boot as well as to prepare for Java and Spring framework certification Why it’s great: * Perfect for Java backend developers * Covers Java 17+, Spring Boot, and REST * Lifetime access with future updates * 50% OFF this Deepavali just use code friends50 on checkout Here is the link to get your discount — 50% OFF on Everything Bundle. Why Deepavali Is the Best Time to Invest in Yourself? The tech job market is evolving fast — and developers who continuously learn new tools, frameworks, and design principles stay ahead. Deepavali is not just about lighting diyas — it’s about igniting your career. These limited-time discounts make it easier than ever to get world-class learning resources without breaking your budget. If you’ve been putting off buying a course or upgrading your plan, now is the time. Once the offers are gone, they’re gone for good. For example the ByteByteGo offer is one of the rare one as I have known them for last 4 years and this is only the second time I am seeing them offering discount. If you want to just grab one learning #deal, I highly recommend you to join ByteByteGo lifetime plan now. This will give you access to all the System Design and Coding interview material which you can use every time you look for change. Here is the link to get discount — Join ByteByteGo now for 50% OFFcredit — ByteByteGo Final Thoughts Each of these platforms brings something unique — * ByteByteGo and Codemia.io are perfect for System Design mastery. * Exponent offers mock interviews and real FAANG questions. * Educative and DesignGurus give you structured, self-paced learning. * Everything Java Interview Bundle ties it all together for backend engineers. Don’t miss these Deepavali deals for developers — your future self will thank you when you ace your next big interview. To celebrate the occasion, I am also giving 35% discount on paid membership of my substack newsletter. Here are the benefits you unlock with a paid subscription: * Get access to paid subscribers posts. * Full archive of 235+ posts on System Design, Java, AI, and LLM Many expense it with team’s learning budget — Get 35% OFF NOW Other System Design and Coding Interview and Resources you may like * 16 Best Resources for System Design Interview Prep * How Codemia.io helped me to learn System Design better? * Is Generative AI System Design Interview — Insider Guide worth it? * 10 Reasons to join Codemia.io for System Design Interview? * Is DesignGuru’s System Design Course worth it * I found Codemia.io — LeetCode for System Design? * Why ByteByteGo is the best website for Coding interview in 2025? * Why AlgoMonster is best platform for DSA Prepration in 2025 * Is Exponent’s System Design Course worth it? * Is OOP Design Interview — An Insider Guide worth it? * ByteBytego vs Exponent? which one is better? * 10 Best Places to Learn System Design in 2025 * Is Codemia.io 65% discount worth it? * Is Exponent Good Place for Coding Interview Prep? * 6 Best System Design and API Design Interactive Courses * Top 5 System Design YouTube Channels for Engineers * How to prepare for DSA for coding interviews? * 3 Places to Practice System Design Mock interviews * Is Designing Data-intensive application book worth reading? All the best for your Mobile System design and OOP Design Interviews, if you have any doubts or questions, feel free to ask in the comments.P. S. — If you just want to do one thing at this moment, join ByteByteGo and start learning software architecture fundamentals and you will thank me later. It’s one of the most comprehensive resource for coding interview now. System Design · Coding · Behavioral · Machine Learning Interviews --- 🎆 Deepavali Deals for Developers: Best Time to Level Up and Crack FAANG Interviews (Up to 70% OFF!) was originally published in Javarevisited on Medium, where people are continuing the conversation by highlighting and responding to this story.
dlvr.it
The Database Administrator RoadMap
As the digital realm continues to advance at a rapid pace, the role of a Database Administrator (DBA) becomes increasingly vital in ensuring the seamless management, security, and efficiency of data systems. This Database Administrator roadmap is tailored to equip both aspiring and seasoned DBAs with the knowledge, skills, and strategies needed to thrive in the dynamic world of database management . From fundamental concepts to emerging technologies, we will explore the key areas that define the modern database administration landscape. Whether you are seeking to enhance your existing expertise or embark on a new career path, this roadmap will be your trusted companion in mastering the latest tools, best practices, and industry trends shaping the field of database administration and beyond. The Database Administrator RoadMap The year 2023 has unfurled its sails, and as a seasoned database administrator, I'm setting my course to explore the ever-expansive ocean of data management. Join me on this voyage, where we'll embark on an exciting journey through the 2023 Database Administrator Roadmap. Just as a skilled navigator relies on charts and stars to guide their ship, I'll be sharing my insights and strategies for navigating the database seas this year. From mastering the intricacies of the cloud to harnessing the power of AI, this roadmap is packed with practical advice, navigational tips, and a few data treasure chests along the way. So, fellow sailors of the data seas, hoist your virtual anchors and prepare to embark on a journey filled with data discoveries and navigational wisdom. Let's set sail on the Database Administrator's Roadmap for 2023! 1. Embrace the Cloud The cloud is no longer just a buzzword—it's the beating heart of modern data management. In 2023, I'm diving deeper into cloud-based databases, like AWS RDS, Azure SQL Database, and Google Cloud SQL. These platforms offer scalability, reliability, and the freedom to focus on database design rather than server maintenance. As a database administrator, I'm exploring the nuances of managing data in the cloud, including data migration strategies, disaster recovery, and optimizing costs. Cloud-native databases like Amazon Aurora and Azure Cosmos DB are on my radar because they're designed to leverage the full potential of the cloud. 2. Database as Code (DaC) Database as Code (DaC) is my north star this year. It's a paradigm shift that treats databases like software code, bringing version control, automation, and reproducibility to the database world. Tools like Flyway and Liquibase are my allies on this journey. I'm scripting database changes, making them repeatable and trackable. DaC also streamlines collaboration between developers and DBAs, as everyone works with a shared set of scripts. This ensures that changes are tested and deployed consistently, reducing the risk of data mishaps. 3. Containers & Orchestration Containers, led by Docker, have revolutionized how we package and deploy software. In 2023, I'm delving into containerization and orchestration tools like Kubernetes. Containers provide a consistent environment for databases, making it easier to spin up copies for development, testing, and production. Kubernetes, the orchestration maestro, helps manage the scaling, resilience, and failover of containerized databases. It's like having a team of sorcerers to ensure that your database always stays responsive and available. 4. Data Privacy & Compliance Data privacy and compliance are top priorities this year. Regulations like GDPR and CCPA have raised the bar for safeguarding personal information. I'm brushing up on data masking techniques to protect sensitive data during non-production activities. Encryption, both in transit and at rest, is becoming standard practice. I'm exploring encryption options offered by cloud providers and database systems to keep data safe from prying eyes. Auditing tools are also crucial for maintaining compliance and tracking data access. 5. Machine Learning & AI AI and Machine Learning (ML) are no longer distant dreams; they're practical tools for enhancing data management. In 2023, I'm diving into ML frameworks like TensorFlow and PyTorch to harness predictive analytics and automate routine tasks. AI-powered chatbots are becoming handy assistants for users with database queries. These bots can answer questions, provide insights, and even assist in troubleshooting database issues, making life easier for both DBAs and end-users. 6. Data Integration & ETL Data integration is the backbone of modern data ecosystems. This year, I'm exploring modern ETL (Extract, Transform, Load) platforms like Apache NiFi and Talend. They streamline data movement, transformation, and loading, ensuring that data flows seamlessly across the organization. Data pipelines are the lifeblood of ETL processes. I'm investing in tools that allow me to create, monitor, and optimize these pipelines for better data quality and performance. 7. Database Security Security is a never-ending quest. I'm enhancing database security by implementing practices like vulnerability assessments, penetration testing, and role-based access control. Regular security audits are essential to identify and patch vulnerabilities. Continuous monitoring is my shield against threats. Tools that provide real-time monitoring and alerting help me stay one step ahead of potential security breaches. 8. Performance Tuning Optimizing database performance remains a core focus. I'm delving deeper into query optimization, indexing strategies, and database tuning. Understanding execution plans and profiling queries helps me pinpoint bottlenecks and fine-tune for maximum efficiency. 9. Database Automation Automation is my secret sauce for efficiency. I'm automating routine tasks such as backups, patching, and monitoring using scripts and specialized tools. Database automation not only reduces manual work but also minimizes the risk of human error. 10. Continuous Learning In the world of databases, learning is a never-ending adventure. I'm investing time in online courses, webinars, and industry conferences to stay updated with the latest trends and technologies. Sharing knowledge within my team and the broader community is equally important; it fosters a culture of continuous improvement. 11. Team Collaboration As a database administrator, I'm part of a dynamic data team. Collaboration is key to our success. We're not just managing databases; we're collaborating on data-driven initiatives. Sharing insights, challenges, and solutions ensures that our data ship sails smoothly. 12. Documentation & Knowledge Sharing Documenting processes, best practices, and architectural decisions is a habit I'm nurturing. These documents serve as valuable references for my team and help newcomers onboard smoothly. Knowledge sharing sessions and brown bag meetings foster a culture of learning and collaboration within the organization. 13. Mentorship Mentorship is a two-way street. As an experienced DBA, I'm mentoring junior team members, sharing my knowledge, and helping them navigate the complexities of database administration. It's a rewarding experience that contributes to the growth of our data team. 14. Adaptability & Resilience In the unpredictable world of technology, adaptability is a superpower. I'm prepared to pivot and adapt to new challenges, whether it's sudden database scaling, data migration, or unforeseen security threats. Resilience and quick thinking are my allies in navigating the unexpected. Quiz Time What is the primary role of a Database Administrator (DBA)? A) Writing application code.B) Managing and maintaining database systems.C) Designing user interfaces.D) Handling network security. Which of the following is a fundamental skill for a Database Administrator? A) Graphic design.B) Data analysis.C) Mechanical engineering.D) Marketing strategy. What is one of the key responsibilities of a DBA when it comes to database security? A) Developing new software applications.B) Ensuring data is backed up regularly.C) Conducting market research.D) Designing product packaging. Conclusion As we conclude "The Database Administrator RoadMap," we hope this comprehensive guide has served as a valuable resource in your journey toward mastering the evolving domain of database administration. In a rapidly changing technological landscape, staying ahead requires continuous learning and adaptation.  Whether you are an experienced Database Administrator refining your skills or someone new to the field, the roadmap has covered essential concepts, tools, and trends that define the current state of database administration. From foundational principles to cutting-edge technologies, the roadmap aimed to equip you with the knowledge and capabilities needed to excel in managing data systems effectively.  As you continue your exploration of databases and beyond, remember that learning is a dynamic process, and staying curious and adaptable will be key to your success. Embrace the challenges, stay informed about emerging technologies, and apply your skills with creativity and innovation.  May your journey in the realm of database administration be both fulfilling and forward-looking, as you contribute to the ever-evolving landscape of data management. Other SQL articles you may like: * Difference between UNION and UNION ALL in SQL * 10 Examples of ALTER command in SQL * MySQL vs NoSQL comparison * Difference between Self and Equi join in SQL * What are T-SQL Window Functions?
dlvr.it
Top 50 #Java Thread and #Concurrency Interview Questions Answers for 2 to 5 Years Experienced…
Top 50 #Java Thread and #Concurrency Interview Questions Answers for 2 to 5 Years Experienced Developers Frequently asked Java Thread and Concurrency Interview Questions with Answers for 3 to 5 years experienced developers You go to any Java interview, senior or junior, experience or freshers, you are bound to see a couple of questions from the thread, concurrency, and multi-threading. In fact, this built-in concurrency support is one of the strongest points of the Java #programming language and helped it to gain popularity among the enterprise world and programmers equally. Most of the lucrative Java developer position on big investment banks and insurance companies demands excellent core Java multi-threading skills and experience in developing, debugging, and tuning high-performance low latency concurrent Java applications. This is the reason, it is one of the most important topics in Java interviews. #Multithreading and concurrency are also hard to master the concept and only good developers with solid experience can effectively deal with concurrency issues. In a typical Java interview, the Interviewer slowly starts from basic concepts of Thread by asking questions like, why you need threads, how to create threads, which one is a better way to create threads like by extending thread class or implementing Runnable, and then slowly goes into Concurrency issues, challenges faced during the development of concurrent Java applications. Java memory model, higher-order concurrency utilities introduced in JDK 1.5, principles and design patterns of concurrent Java applications, classical multithreading problems like producer-consumer, dining philosopher, reader-writer, or simply bounded buffer problems. Since it’s also not enough just to know the basics of threading, you must know how to deal with concurrency problems like deadlock, race conditions, memory inconsistency, and various thread safety-related issues. These skills are thoroughly get tested by presenting various multi-threading and concurrency problems. Many Java developers are used to only looking and reading interview questions before going for the interview, which is not bad but you should not be too far away. Also collecting questions and going through the same exercise is too time-consuming, that’s why I have created this list of the top 50 Java multi-threading and concurrency-related questions, collected from various interviews. I am only going to add new and recent interview questions as and when I am going to discover them. Though you need good knowledge and solid experience to do well on Java interviews focused on advanced multithreading and concurrency skill, I strongly recommend Java programmers to read Effective Java and Java Concurrency in Practice twice before going to an interview. They do not only help you to answer questions better but also help you to present your idea clearly. And, if you are serious about mastering Java multi-threading and concurrency then I also suggest you take a look at this Concurrency, Multithreading and Parallel Computing in Java course on Udemy. And, if you are serious about cracking your next Java interview and need resources, you can also checkout my books like Grokking the Java Interview and Grokking the Spring Boot Interview on Gumroad. * Grokking the Java Interview - Volume 2 * Everything Bundle (Java + Spring Boot + SQL Interview + Certification) These books will guide you on your preparation topic by topic and you will also find a lot of frequently asked questions from past Java interviews. You can also use code friends20 to get 20% discount. 50 Interview questions from Java Multithreading and Concurrency with Answers Here is our list of top questions from Java thread, concurrency, and multi-threading. You can use this list to prepare well for your Java interview. By the way, I have not provided answers to some questions here, Why? because I expect most Java developers to know the answers to this question and if not, also answers are widely available by using Google. If you don’t find the answer to any particular question, you can always ask me in the comments section. You can even find answers to a few questions on the link provided or my earlier post Top 12 Java Thread Questions with Answers. 1) What is Thread in Java? (answer) The thread is an independent path of execution. It’s a way to take advantage of multiple CPUs available on a machine. By employing multiple threads you can speed up CPU-bound tasks. For example, if one thread takes 100 milliseconds to do a job, you can use 10 threads to reduce that task into 10 milliseconds. Java provides excellent support for multithreading at the language level, and it’s also one of the strong selling points. 2) What is the difference between Thread and Process in Java? (answer) The thread is a subset of Process, in other words, one process can contain multiple threads. Two processes run on different memory spaces, but all threads share the same memory space. Don’t confuse this with stack memory, which is different for the different threads and used to store local data to that thread. For more detail see the answer. 3) How do you implement Thread in Java? (answer) At the language level, there are two ways to implement Thread in Java. An instance of java.lang.Thread represents a thread but it needs a task to execute, which is an instance of interface java.lang.Runnable. Since the Thread class itself implement Runnable, you can override the run() method either by extending the Thread class or just implementing the Runnable interface. For a detailed answer and discussion see this article. 4) When to use Runnable vs Thread in Java? (answer) This is a follow-up to a previous multi-threading interview question. As we know we can implement thread either by extending the Thread class or implementing Runnable interface, the question arises, which one is better and when to use one? This question will be easy to answer if you know that the Java programming language doesn’t support multiple inheritances of class, but it allows you to implement multiple interfaces. This means it’s better to implement Runnable than extend Thread if you also want to extend another class e.g. Canvas or CommandListener. For more points and discussion you can also refer to this post. 6) What is the difference between the start() and run() method of the Thread class? (answer) One of trick Java questions from early days, but still good enough to differentiate between shallow understanding of Java threading model start() method is used to start a newly created thread, while start() internally calls run() method, there is difference calling run() method directly. When you invoke run() as a normal method, it’s called in the same thread, no new thread is started, which is the case when you call the start() method. Read this answer for a much more detailed discussion. 7) What is the difference between Runnable and Callable in Java? (answer) Both Runnable and Callable represent task which is intended to be executed in a separate thread. Runnable is there from JDK 1.0 while Callable was added on JDK 1.5. The main difference between these two is that Callable’s call() method can return value and throw Exception, which was not possible with Runnable’s run() method. Callable return Future object, which can hold the result of the computation. See my blog post on the same topic for a more in-depth answer to this question. Top 5 Difference Between Callable and Runnable Interface in Java 8) What is the difference between CyclicBarrier and CountDownLatch in Java? (answer) Though both CyclicBarrier and CountDownLatch wait for a number of threads on one or more events, the main difference between them is that you can not re-use CountDownLatch once the count reaches to zero, but you can reuse the same CyclicBarrier even after the barrier is broken. See this answer for a few more points and a sample code example. Difference between CyclicBarrier and CountDownLatch in Java? 9) What is the Java Memory model? (answer) Java Memory model is a set of rules and guidelines which allows Java programs to behave deterministically across multiple memory architecture, CPU, and operating systems. It’s particularly important in the case of multi-threading. Java Memory Model provides some guarantee on which changes made by one thread should be visible to others, one of them is the happens-before relationship. This relationship defines several rules which allow programmers to anticipate and reason the behavior of concurrent Java programs. For example, happens-before relationship guarantees : * Each action in a thread happens-before every action in that thread that comes later in the program order, this is known as the program order rule. * An unlock on a monitor lock happens before every subsequent lock on that same monitor lock, also known as the Monitor lock rule. * A write to a volatile field happens before every subsequent read of that same field, known as the Volatile variable rule. * A call to Thread.start on a thread happens-before any other thread detects that thread has terminated, either by successfully returning from Thread.join() or by Thread.isAlive() returning false, also known as Thread start rule. * A thread calling interrupt() on another thread happens before the interrupted thread detects the interrupt( either by having InterruptedException thrown, or invoking interrupted or interrupted), popularly known as the Thread Interruption rule. * The end of a constructor for an object happens before the start of the finalizer for that object is known as the Finalizer rule. * If A happens before B, and B happens before C, then A happens-before C, which means happens-before guarantees Transitivity. I strongly suggest reading Chapter 16 of Java Concurrency in Practice to understand the Java Memory model in more detail. 10) What is a volatile variable in Java? (answer) volatile is a special modifier, which can only be used with instance variables. In concurrent Java programs, changes made by multiple threads on instance variables are not visible to others in absence of any synchronizers like synchronized keywords or locks. Volatile variable guarantees that a write will happen before any subsequent read: as stated: “volatile variable rule” in the previous question. Read this answer to learn more about volatile variables and when to use them. 11) What is thread-safety? is Vector a thread-safe class? (Yes, see details) Thread safety is a property of an object or code which guarantees that if executed or used by multiple threads in any manner e.g. read vs writing it will behave as expected. For example, a thread-safe counter object will not miss any count if the same instance of that counter is shared among multiple threads. Apparently, you can also divide collection classes into two categories, thread-safe and non-thread-safe. Vector is indeed a thread-safe class and it achieves thread-safety by synchronizing methods that modify the state of Vector, on the other hand, its counterpart ArrayList is not thread-safe. 12) What is a race condition in Java? Given one example? (answer) Race conditions are caused by some subtle programming bugs when Java programs are exposed to a concurrent execution environment. As the name suggests, a race condition occurs due to race between multiple threads, if a thread that is supposed to execute first lost the race and is executed second, the behavior of code changes, which surface as non-deterministic bugs. This is one of the hardest bugs to find and re-produce because of the random nature of racing between threads. One example of race conditions is out-of-order processing, see this answer for some more examples of race conditions in Java programs. What is Race Condition in Java Multithreading? Examples 13) How to stop a thread in Java? (answer) I always said that Java provides rich APIs for everything but ironically Java doesn’t provide a sure-shot way of stopping the thread. There were some control methods in JDK 1.0 e.g. stop(), suspend(), and resume() which were deprecated in later releases due to potential deadlock threats, then Java API designers have not made any effort to provide a consistent, thread-safe, and elegant way to stop threads. Programmers mainly rely on the fact that thread stops automatically as soon as they finish execution of run() or call() method. To manually stop, programmers either take advantage of volatile boolean variables and check in every iteration if the run method has loops or interrupt threads to abruptly cancel tasks. See this tutorial for a sample code of stopping thread in Java. 14) What happens when an Exception occurs in a thread? (answer) This is one of the good tricky Java questions I have seen in interviews. In simple words, If not caught thread will die, if an uncaught exception handler is registered then it will get a callback. The Thread.UncaughtExceptionHandler is an interface, defined as a nested interface for handlers invoked when a Thread abruptly terminates due to an uncaught exception. When a thread is about to terminate due to an uncaught exception the Java Virtual Machine will query the thread for its UncaughtExceptionHandler using Thread.getUncaughtExceptionHandler() and will invoke the handler’s uncaughtException() method, passing the thread and the exception as arguments. 15) How do you share data between two threads in Java? (answer) You can share data between threads by using shared objects, or concurrent data structures like BlockingQueue. See this tutorial to learn inter-thread communication in Java. It implements the Producer consumer pattern using wait and notify methods, which involves sharing objects between two threads. 16) What is the difference between notify and notifyAll in Java? (answer) This is another tricky question from core Java interviews since multiple threads can wait on a single monitor lock, Java API designer provides a method to inform only one of them or all of them, once the waiting condition changes, but they provide the half implementation. There notify() method doesn’t provide any way to choose a particular thread, that’s why it’s only useful when you know that there is only one thread is waiting. On the other hand, notifyAll() sends a notification to all threads and allows them to compete for locks, which ensures that at least one thread will proceed further. See my blog post on a similar topic for a more detailed answer and code example. 17) Why wait, notify, and notifyAll are not inside the thread class? (answer) This is a design-related question, which checks what the candidate thinks about the existing system or does he ever thought of something which is so common but looks inappropriate at first. In order to answer this question, you have to give some reasons why it makes sense for these three methods to be in the Object class, and why not on Thread class. One reason which is obvious is that Java provides lock at the object level, not at the thread level. Every object has a lock, which is acquired by a thread. Now if the thread needs to wait for a certain lock it makes sense to call wait() on that object rather than on that thread. Had wait() method declared on Thread class, it was not clear for which lock thread was waiting. In short, since wait, notify and notifyAll operate at lock level, it makes sense to define it on object class because the lock belongs to object. You can also see this article for a more elaborate answer to this question. 18) What is the ThreadLocal variable in Java? (answer) ThreadLocal variables are a special kind of variable available to Java programmers. Just like instance, the variable is per instance, ThreadLocal variable is per thread. It’s a nice way to achieve thread-safety of expensive-to-create objects, for example, you can make SimpleDateFormat thread-safe using ThreadLocal. Since that class is expensive, it’s not good to use it in local scope, which requires separate instances on each invocation. By providing each thread their own copy, you shoot two birds with one arrow. First, you reduce the number of instances of expensive objects by reusing a fixed number of instances, and Second, you achieve thread safety without paying the cost of synchronization or immutability. Another good example of a thread-local variable is ThreadLocalRandom class, which reduces the number of instances of expensive-to-create Random objects in a multi-threading environment. See this answer to learn more about thread-local variables in Java. 19) What is FutureTask in Java? (answer) FutureTask represents a cancellable asynchronous computation in concurrent Java applications. This class provides a base implementation of Future, with methods to start and cancel a computation, query to see if the computation is complete and retrieve the result of the computation. The result can only be retrieved when the computation has been completed; the get methods will block if the computation has not yet been completed. A FutureTask object can be used to wrap a Callable or Runnable object. Since FutureTask also implements Runnable, it can be submitted to an Executor for execution. 20) What is the difference between the interrupted() and isInterrupted() method in Java? (answer) The main difference between interrupted() and isInterrupted() is that the former clears the interrupt status while the latter does not. The interrupt mechanism in Java multi-threading is implemented using an internal flag known as the interrupt status. Interrupting a thread by calling Thread.interrupt() sets this flag. When interrupted thread checks for an interrupt by invoking the static method Thread.interrupted(), interrupt status is cleared. The non-static isInterrupted() method, which is used by one thread to query the interrupt status of another, does not change the interrupt status flag. By convention, any method that exits by throwing an InterruptedException clears interrupt status when it does so. However, it’s always possible that interrupt status will immediately be set again, by another thread invoking interrupt 21) Why wait and notify methods are called from the synchronized block? (answer) The main reason for calling the wait and notify method from either synchronized block or method is that it is made mandatory by Java API. If you don’t call them from a synchronized context, your code will throw IllegalMonitorStateException. A more subtle reason is to avoid the race condition between wait and notify calls. To learn more about this, check my similarly titled post here. 22) Why should you check the condition for waiting in a loop? (answer) It’s possible for a waiting thread to receive false alerts and spurious wake-up calls, if it doesn’t check the waiting condition in a loop, it will simply exit even if the condition is not met. As such, when awaiting thread wakes up, it cannot assume that the state it was waiting for is still valid. It may have been valid in the past, but the state may have been changed after the notify() method was called and before the waiting thread woke up. That’s why it is always better to call the wait() method from a loop, you can even create a template for calling wait and notify in Eclipse. To learn more about this question, I would recommend you to read Effective Java items on thread and synchronization. 23) What is the difference between synchronized and concurrent collection in Java? (answer) Though both synchronized and concurrent collection provides thread-safe collection suitable for multi-threaded and concurrent access, later is more scalable than former. Before Java 1.5, Java programmers only had synchronized collection which becomes a source of contention if multiple threads access them concurrently, which hampers the scalability of the system. Java 5 introduced concurrent collections like ConcurrentHashMap, which not only provides thread safety but also improves scalability by using modern techniques like lock stripping and partitioning internal tables. See this answer for more differences between synchronized and concurrent collection in Java. 24) What is the difference between Stack and Heap in Java? (answer) Why does someone this question as part of multi-threading and concurrency? because Stack is a memory area that is closely associated with threads. To answer this question, both stack and heap are specific memories in Java applications. Each thread has its own stack, which is used to store local variables, method parameters, and call stack. Variable stored in one Thread’s stack is not visible to other. On another hand, the heap is a common memory area that is shared by all threads. Objects whether local or at any level is created inside the heap. To improve performance thread tends to cache values from the heap into their stack, which can create problems if that variable is modified by more than one thread, this is where volatile variables come into the picture. volatile suggest threads read the value of variable always from main memory. See this article for learning more about stack and heap in Java to answer this question in greater detail. 25) What is a thread pool? Why should you thread pool in Java? (answer) Creating a thread is expensive in terms of time and resources. If you create a thread at the time of request processing it will slow down your response time, also there is only a limited number of threads a process can create. To avoid both of these issues, a spool of threads is created when the application starts up and threads are reused for request processing. This pool of thread is known as “thread pool” and threads are known as a worker thread. From JDK 1.5 release, Java API provides Executor framework, which allows you to create different types of thread pools e.g. single thread pool, which processes one task at a time, fixed thread pool (a pool of fixed number of threads), or cached thread pool (an expandable thread pool suitable for applications with many short-lived tasks). See this article to learn more about thread pools in Java to prepare a detailed answer to this question. 26) Write code to solve Producer Consumer problems in Java? (answer) Most of the threading problems you solved in the real world are of the category of Producer consumer pattern, where one thread is producing a task and another thread is consuming that. You must know how to do inter-thread communication to solve this problem. At the lowest level, you can use wait and notify to solve this problem, and at a high level, you can leverage Semaphore or BlockingQueue to implement a Producer consumer pattern, as shown in this tutorial. 27) How do you avoid deadlock in Java? Write Code? (answer) Deadlock is a condition in which two threads wait for each other to take action which allows them to move further. It’s a serious issue because when it happens your program hangs and doesn’t do the task it is intended for. In order for the deadlock to happen, the following four conditions must be true: * Mutual Exclusion: At least one resource must be held in a non-shareable mode. Only one process can use the resource at any given instant of time. * Hold and Wait: A process is currently holding, at least, one resource and requesting additional resources which are being held by other processes. * No Pre-emption: The operating system must not de-allocate resources once they have been allocated; they must be released by the holding process voluntarily. * Circular Wait: A process must be waiting for a resource that is being held by another process, which in turn is waiting for the first process to release the resource. The easiest way to avoid deadlock is to prevent Circular wait, and this can be done by acquiring locks in a particular order and releasing them in reverse order so that a thread can only proceed to acquire a lock if it held the other one. Check this tutorial for the actual code example and detailed discussion on techniques for avoiding deadlock in Java. 28) What is the difference between livelock and deadlock in Java? (answer) This question is an extension of the previous interview question. A livelock is similar to a deadlock, except that the states of the threads or processes involved in the livelock constantly change with regard to one another, without anyone progressing further. Livelock is a special case of resource starvation. A real-world example of livelock occurs when two people meet in a narrow corridor, and each tries to be polite by moving aside to let the other pass, but they end up swaying from side to side without making any progress because they both repeatedly move the same way at the same time. In short, the main difference between livelock and deadlock is that in the former state of process change but no progress is made. 29) How do you check if a thread holds a lock or not? (answer) I didn’t even know that you can check if a Thread already holds a lock before this question hits me in a telephonic round of Java interviews. There is a method called holdsLock() on java.lang.Thread, it returns true if and only if the current thread holds the monitor lock on the specified object. You can also check this article for a more detailed answer. 30) How do you take thread dump in Java? (answer) There are multiple ways to take a thread dump of the Java process depending upon the operating system. When you take thread dump, JVM dumps the state of all threads in log files or standard error console. In windows, you can use Ctrl + Break key combination to take thread dump, on Linux you can use the kill -3 command for the same. You can also use a tool called jstack for taking thread dump, it operates on process id, which can be found using another tool called jps. 31) Which JVM parameter is used to control the stack size of a thread? (answer) This is the simple one, -Xss parameter is used to control the stack size of Thread in Java. You can see this list of JVM options to learn more about this parameter. 32) What is the difference between synchronized and ReentrantLock in Java? (answer) There were days when the only way to provide mutual exclusion in Java was via synchronized keyword, but it has several shortcomings e.g. you can not extend lock beyond a method or block boundary, you can not give up trying for a lock, etc. Java 5 solves this problem by providing more sophisticated control via the Lock interface. ReentrantLock is a common implementation of the Lock interface and provides re-entrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor lock accessed using synchronized methods and statements, but with extended capabilities. See this article to learn about those capabilities and some more differences between synchronized vs ReentrantLock in Java. 33) There are three threads T1, T2, and T3? How do you ensure sequence T1, T2, T3 in Java? (answer) Sequencing in multi-threading can be achieved by different means but you can simply use the join() method of thread class to start a thread when another one has finished its execution. To ensure three threads execute you need to start the last one first e.g. T3 and then call join methods in reverse order e.g. T3 calls T2. join and T2 calls T1.join, these ways T1 will finish first and T3 will finish last. To learn more about the join method, see this tutorial. 34) What does the yield method of the Thread class do? (answer) The yield method is one way to request the current thread to relinquish CPU so that other threads can get a chance to execute. Yield is a static method and only guarantees that the current thread will relinquish the CPU but doesn’t say anything about which other thread will get CPU. It’s possible for the same thread to get the CPU back and start its execution again. See this article to learn more about the yield method and to answer this question better. 35) What is the concurrency level of ConcurrentHashMap in Java? (answer) ConcurrentHashMap achieves its scalability and thread-safety by partitioning the actual map into a number of sections. This partitioning is achieved using a concurrency level. Its optional parameter of ConcurrentHashMap constructor and its default value is 16. The table is internally partitioned to try to permit the indicated number of concurrent updates without contention. To learn more about concurrency level and internal resizing, see my post How ConcurrentHashMap works in Java. 36) What is Semaphore in Java? (answer) Semaphore in Java is a new kind of synchronizer. It’s a counting semaphore. Conceptually, a semaphore maintains a set of permits. Each acquire() blocks if necessary until a permit is available and then takes it. Each release() adds a permit, potentially releasing a blocking acquirer. However, no actual permit objects are used; the Semaphore just keeps a count of the number available and acts accordingly. Semaphore is used to protect an expensive resource that is available in fixed numbers e.g. database connection in the pool. See this article to learn more about counting Semaphore in Java. 37) What happens if you submit a task when the queue of the thread pool is already filled? (answer) This is another tricky question on my list. Many programmers will think that it will block until a task is cleared but it’s true. ThreadPoolExecutor’s submit() method throws RejectedExecutionException if the task cannot be scheduled for execution. 38) What is the difference between the submit() and execute() method thread pool in Java? (answer) Both methods are ways to submit a task to thread pools but there is a slight difference between them. execute(Runnable command) is defined in Executor interface and executes given task in future, but more importantly, it does not return anything. Its return type is void. On other hand submit() is an overloaded method, it can take either Runnable or Callable task and can return Future object which can hold the pending result of the computation. This method is defined on ExecutorService interface, which extends Executor interface, and every other thread pool class e.g. ThreadPoolExecutor or ScheduledThreadPoolExecutor gets these methods. To learn more about thread pools you can check this article. 39) What is the blocking method in Java? (answer) A blocking method is a method that blocks until the task is done, for example, accept() method of ServerSocket blocks until a client is connected. here blocking means control will not return to the caller until the task is finished. On the other hand, there is an asynchronous or non-blocking method that returns even before the task is finished. To learn more about the blocking method see this answer. 40) Is Swing thread-safe? What do you mean by Swing thread-safe? (answer) You can simply this question as No, Swing is not thread-safe, but you have to explain what you mean by that even if the interviewer doesn’t ask about it. When we say swing is not thread-safe we usually refer to its component, which can not be modified in multiple threads. All updates to GUI components have to be done on the AWT thread, and Swing provides synchronous and asynchronous callback methods to schedule such updates. You can also read my article to learn more about swing and thread safety to better answer this question. Even next two questions are also related to this concept. 41) What is the difference between invokeAndWait and invokeLater in Java? (answer) These are two methods Swing API provides Java developers for updating GUI components from threads other than the Event dispatcher thread. InvokeAndWait() synchronously update GUI component. For example, a progress bar, once progress is made, the bar should also be updated to reflect that change. If progress is tracked in a different thread, it has to call invokeAndWait() to schedule an update of that component by the Event dispatcher thread. On another hand, invokeLater() is an asynchronous call to update components. You can also refer to this answer for more points. 42) Which method of Swing API is thread-safe in Java? (answer) This question is again related to swing and thread-safety though components are not thread-safe there is a certain method that can be safely called from multiple threads. I know about repaint(), and revalidate() being thread-safe but there are other methods on different swing components e.g. setText() method of JTextComponent, insert() and append() method of JTextArea class. 43) How to create an Immutable object in Java? (answer) This question might not look related to multi-threading and concurrency, but it is. Immutability helps to simplify already complex concurrent code in Java. Since immutable objects can be shared without any synchronization it’s very dear to Java developers. Core value object, which is meant to be shared among threads should be immutable for performance and simplicity. Unfortunately, there is no @Immutable annotation in Java, which can make your object immutable, hard work must be done by Java developers. You need to keep basics like initializing state in the constructor, no setter methods, no leaking of reference, keeping a separate copy of the mutable object to create an Immutable object. For step by step guide see my post, how to make an object Immutable in Java. This will give you enough material to answer this question with confidence. How to create Immutable Class and Object in Java - Tutorial Example 44) What is ReadWriteLock in Java? (answer) In general, the read-write lock is the result of the lock stripping technique to improve the performance of concurrent applications. In Java, ReadWriteLock is an interface that was added in Java 5 release. A ReadWriteLock maintains a pair of associated locks, one for read-only operations and one for writing. The read lock may be held simultaneously by multiple reader threads, so long as there are no writers. The write lock is exclusive. If you want you can implement this interface with your own set of rules, otherwise you can use ReentrantReadWriteLock, which comes along with JDK and supports a maximum of 65535 recursive write locks and 65535 read locks. 45) What is a busy spin in multi-threading? (answer) Busy spin is a technique that concurrent programmers employ to make a thread wait on certain conditions. Unlike traditional methods e.g. wait(), sleep(), or yield() which all involve relinquishing CPU control, this method does not relinquish CPU, instead, it just runs the empty loop. Why would someone do that? to preserve CPU caches. In a multi-core system, it’s possible for a paused thread to resume on a different core, which means rebuilding the cache again. To avoid the cost of rebuilding cache, programmers prefer to wait for a much smaller time doing busy spin. You can also see this answer to learn more about this question. 46) What is the difference between the volatile and atomic variables in Java? (answer) This is an interesting question for Java programmers, at first, volatile and atomic variables look very similar, but they are different. A volatile variable provides you happens-before guarantee that a write will happen before any subsequent write, it doesn’t guarantee atomicity. For example, the count++ operation will not become atomic just by declaring the count variable as volatile. On the other hand, AtomicInteger class provides an atomic method to perform such compound operation atomically e.g. getAndIncrement() is the atomic replacement of increment operator. It can be used to atomically increment the current value by one. Similarly, you have an atomic version for other data types and reference variables as well. 47) What happens if a thread throws an Exception inside a synchronized block? (answer) This is one more tricky question for the average Java programmer if he can bring the fact about whether the lock is released or not is a key indicator of his understanding. To answer this question, no matter how you exist synchronized block, either normally by finishing execution or abruptly by throwing an exception, the thread releases the lock it acquired while entering that synchronized block. This is actually one of the reasons I like synchronized block over lock interface, which requires explicit attention to release lock, generally, this is achieved by releasing the lock in a finally block. 48) What is double-checked locking of Singleton? (answer) This is one of the very popular questions on Java interviews, and despite its popularity, the chances of candidates answering this question satisfactory is only 50%. Half of the time, they failed to write code for double-checked locking, and half of the time they failed how it was broken and fixed on Java 1.5. This is actually an old way of creating a thread-safe singleton, which tries to optimize performance by only locking when the Singleton instance is created the first time, but because of complexity and the fact it was broken for JDK 1.4, I personally don’t like it. Anyway, even if you do not prefer this approach it’s good to know from an interview point of view. Since this question deserves a detailed answer, I have answered in a separate post, you can read my post how double-checked locking on Singleton works to learn more about it. 49) How to create thread-safe Singleton in Java? (answer) This question is actually a follow-up to the previous question. If you say you don’t like double-checked locking then the Interviewer is bound to ask about alternative ways of creating a thread-safe Singleton class. There is actually man, you can take advantage of class loading and static variable initialization feature of JVM to create an instance of Singleton, or you can leverage powerful enumeration type in Java to create Singleton. I actually preferred that way, you can also read this article to learn more about it and see some sample code. 50) List down 3 multi-threading best practices you follow? (answer) This is my favorite question because I believe that you must follow certain best practices while writing concurrent code which helps in performance, debugging, and maintenance. Following are three best practices, I think an average Java programmer should follow: * Always give a meaningful name to your thread This goes a long way to find a bug or trace execution in concurrent code. OrderProcessor, QuoteProcessor, or TradeProcessor is much better than Thread-1. Thread-2 and Thread-3. The name should say about task done by that thread. All major frameworks and even JDK follow this best practice. * Avoid locking or Reduce scope of Synchronization Locking is costly and context switching is even costlier. Try to avoid synchronization and locking as much as possible and at a bare minimum, you should reduce critical sections. That’s why I prefer synchronized block over synchronized method because it gives you absolute control over the scope of locking. * Prefer Synchronizers over wait and notify Synchronizers like CountDownLatch, Semaphore, CyclicBarrier or Exchanger simplify coding. It’s very difficult to implement complex control flow right using wait and notify. Secondly, these classes are written and maintained by the best in business and there is a good chance that they are optimized or replaced by better performance code in subsequent JDK releases. By using higher-level synchronization utilities, you automatically get all these benefits. * Prefer Concurrent Collection over Synchronized Collection This is another simple best practice that is easy to follow but reap good benefits. Concurrent collections are more scalable than their synchronized counterpart, that’s why it’s better to use them while writing concurrent code. So next time if you need a map, think about ConcurrentHashMap before thinking Hashtable. See my article Concurrent Collections in Java, to learn more about modern collection classes and how to make best use of them. 51) How do you force to start a thread in Java? (answer) This question is like how do you force garbage collection in Java, there is no way though you can make a request using System.gc() but it’s not guaranteed. On Java multi-threading there is absolutely no way to force start a thread, this is controlled by thread scheduler and Java exposes no API to control thread scheduling. This is still a random bit in Java. 52) What is the fork-join framework in Java? (answer) The fork-join framework, introduced in JDK 7 is a powerful tool available to Java developers to take advantage of multiple processors of modern-day servers. It is designed for work that can be broken into smaller pieces recursively. The goal is to use all the available processing power to enhance the performance of your application. One significant advantage of The fork/join framework is that it uses a work-stealing algorithm. Worker threads that run out of things to do can steal tasks from other threads that are still busy. See this article for a much more detailed answer to this question. Difference between Executor Framework and Fork Join Pool in Java? 53) What is the difference between the calling wait() and sleep() method in Java multi-threading? (answer) Though both wait and sleep introduce some form of pause in Java applications, they are tools for different needs. The wait method is used for inter-thread communication, it relinquishes lock if waiting for a condition is true and waits for notification when due to an action of another thread waiting condition becomes false. On the other hand sleep() method is just to relinquish CPU or stop the execution of the current thread for a specified time duration. The calling sleep method doesn’t release the lock held by the current thread. You can also take look at this article to answer this question with more details. Difference between Wait and Sleep, Yield in Java? Example That’s all on this list of top 50 Java multi-threading and concurrency interview questions. I have not shared answers to all the questions but provided enough hints and links to explore further and find answers by yourself. As I said, let me know if you don’t find an answer to any particular question and I will add an answer here. You can use this list not only to prepare for your core Java and programming interviews but also to check your knowledge about the basics of threads, multi-threading, concurrency, design patterns, and threading issues like race conditions, deadlock, and thread-safety problems. My intention is to make this list of questions as the mother of all list of Java Multi-threading questions, but this can not be done without your help. You can also share any question with us, which has been asked to you or any question for which you have yet to find an answer. This master list is equally useful to Java developers of all levels of experience. You can read through this list even if you have 2 to 3 years of working experience as a junior developer or 5 to 6 years as a senior developer. It’s even useful for freshers and beginners to expand their knowledge. I will add new and latest multi-threading questions as and when I come across them, and I request you all to ask, share and answer questions via comments to keep this list relevant to all Java programmers. In case you don’t know, I have also written a book for Java interviews, Grokking the Java Interview, and Grokking the Spring Boot Interview, where I have shared tips, tricks and frequently asked Java questions from different topics. You can read the book to better prepare for your Java interviews. You can also use the code — friends20 to get a 20% discount because you are already my reader. * Grokking the Java Interview - Volume 2 * Grokking the Spring Boot Interview Other Java Interview Questions list you may want to check * 50 Java Programs from Coding Interviews (list) * 15 Spring Boot Interview Questions with answers (spring boot questions) * 21 Java ArrayList Interview Questions with Answers (list) * 21 String Coding Problems for Java Programmers (string questions) * 21 Java Final modifier Interview Questions (list) * 19 Java Overloading and Overriding Interview Questions (list) * 15 Java NIO and Networking Interview Questions with Answers (see here) * 21 Java Inheritance Interview Questions with Answers (list) * 75 Coding Interview Questions for Programmers (questions) * 21 String Algorithms Questions from Interviews (questions) * 20+ binary tree Coding problems from Interviews (questions) * 10 Date, Time, and Calendar based Interview Questions with Answers (list) * 5 main() method interview questions (list) * 25 Software Design Interview Questions for programmers (questions) * 15 Java Enum based Interview Questions (list) * 21 HashMap Interview Questions for Java developers (answers) * 15 SQL and UNIX questions from Java Interviews (list) * 22 array concept interview questions from Java (list) * 25 Spring Security Interview Question with Answers (spring security questions) * 15 Microservice Interview Questions with answers (microservice questions) These questions will not only help you to understand multithreading and concurrency in Java better but also encourage you to find out more about Thread and various related classes and concurrency design patterns. If you have any other Thread or Concurrency based Java questions, which were asked to you in an interview, feel free to share with us.P. S. — If you are preparing for Java Interviews and looking for some interesting questions for practice, then you can also check out these best Java Interview online courses, and books that contain more than 200+ real-world questions from Java interviews and their explanation.And now, over to you, what was the last question you were asked on Thread or concurrency in Java? --- Top 50 Java Thread and Concurrency Interview Questions Answers for 2 to 5 Years Experienced… was originally published in Javarevisited on Medium, where people are continuing the conversation by highlighting and responding to this story.
dlvr.it
2 Ways to remove duplicate rows in SQL? Example Tutorial
Hello guys, if you are wondering how to remove duplicate rows in SQL and looking for solutions on different databases like SQL Server, MySQL, and Oracle then you have come to the right place. In this article, I am going to share 2 ways to remove duplicate rows from SQL, first by using GROUP BY and HAVING clause and second by using the RANK function which works on most of the databases.  You can use any of the approaches to remove duplicates from tables using SQL. This is also one of the popular SQL Interview Questions so knowing how to solve this problem will also give you an edge on interviews.  Why is deleting duplicate rows necessary? When developing SQL Server objects, we should adhere to specific best practices. To maintain data integrity and performance, a table should include primary keys, identity columns, clustered and non-clustered indexes, and constraints.  Even if we follow best practices, we may encounter problems such as duplicate rows. We may also get these data in interim tables during data import, and we'll want to eliminate duplicate entries before inserting them into production tables. Let's say you have duplicate rows in your SQL database and you want to get rid of them. We have to deal with these challenges on a regular basis. However, if we already have duplicate rows in the database, it is a recommended practice to utilize the relevant keys and constraints to eliminate the risk of duplicate rows.  To clear up duplicate data, we must use certain procedures. The methods for removing duplicate data from a SQL table are discussed in this article. Setting up Data Before we can solve this problem, we'll need some example data to help us visualize it. Let's make an employee table with some data. The following query will be used.CREATE TABLE Employee (id int(50) primary key, name varchar(80), salary int(50)); Now, Insert some data into this table. I have inserted some data as below. Have included some famous names for some excitement :p Hope you guys like cricket! We are using the same table we used in finding the Nth highest salary article. But, we will add a few duplicates. The updated table looks something like this :  As you can see, it is clearly visible we have duplicate records, as the ID is the primary key and usually has business logic of auto-increment, we can safely ignore it here. SQL DELETE using GROUP BY and HAVING clause The SQL GROUP BY clause is used in this approach to find duplicate entries. The COUNT function may be used to examine the occurrence of a row using the Group By clause, which organizes data according to the provided columns. For example, if we run the following query, we'll obtain all of the records in the Employee database that have an incidence larger than one. SELECT name, salary, COUNT(*) AS CNT FROM Employee GROUP BY name, salary HAVING COUNT(*) > 1; The result of the following query is as shown below :  We need to preserve only one row and get rid of the duplicates. Only duplicate rows in the table need to be removed. The Emp Virat and Chahal occur twice in the table, for example. We simply want to get rid of one instance of it. To compute the maximum id of each data row, we utilize the SQL MAX function. SELECT * FROM Employee WHERE id NOT IN ( SELECT MAX(id) FROM Employee GROUP BY name, salary ); The result of the above query is something like below :  We can see that the Select line above leaves out the maximum ID value for each duplicate row, leaving only the minimum ID value. Replace the first Select with the SQL delete statement as shown in the following query to eliminate this data. DELETE FROM Employee WHERE id NOT IN ( SELECT MAX(id) FROM Employee GROUP BY name, salary ); Perform a select on an Employee table after executing the delete statement, and you'll obtain the following entries that don't have any duplicate rows. 2. SQL DELETE using RANK function We may also utilize the SQL RANK function to get rid of the duplicate rows. Regardless of duplicate rows, the SQL RANK function returns a unique row ID for each row. The PARTITION BY clause is used with the RANK function in the following query. The PARTITION BY clause divides the data into subsets for the provided columns and assigns a rating to each partition. DELETE E FROM Employee E JOIN ( SELECT *, RANK() OVER(PARTITION BY name, salary ORDER BY id) rank FROM Employee ) T ON E.ID = T.ID; The results we would get are similar to the previous one. All the duplicates would be removed. The method is a bit more complex than the previous one as you can see but provides a better way to rank the columns and check. You can replace the DELETE keyword with SELECT and by selecting the appropriate columns, you would be able to see the ranks of the columns and the output. Conclusion That's all about how to delete or remove duplicate rows from a table in SQL. In this post, we looked at 2 ways to delete duplicate rows in SQL using a variety of methods, including SQL functions. You are free to utilize whatever way makes you feel most at ease. However, I would advise against immediately implementing these techniques and packaging on production data. You should do your tests in a less demanding environment. Other SQL and Database Articles you may like: * Difference between UNION and UNION ALL in SQL * 10 Examples of ALTER command in SQL * MySQL vs NoSQL comparison * 4 Examples of CASE expression in SQL Server * How to create and rollback transaction in database? * Difference between Self and Equi join in SQL * What are T-SQL Window Functions? * How to use Stored Procedure in SQL? * How to convert String to Date in SQL? * How to use WHERE and HAVING clause in SQL * How to find top 10 Records in SQL * Difference between Truncate, Drop, and Delete in SQL If you have any questions or feedback please feel free to ask in comments, I would be happy to clear any doubt you may have. 
dlvr.it
Is ByteByteGo Enough to Crack a FAANG Interview? A Complete 2025 Review
Is ByteByteGo a good place for FAANG Interview Preparation in 2025 Hello guys, breaking into FAANG (Facebook/Meta, Amazon, Apple, Netflix, Google) or other top-tier tech companies has become one of the most competitive challenges in software engineering. Candidates face multiple rounds of coding challenges, system design interviews, machine learning design discussions, and increasingly even Generative AI and OOP design problems. With stakes this high, it’s no surprise that countless prep platforms, books, and courses promise to help you land the job. Among them, ByteByteGo — created by Alex Xu (author of System Design Interview — An Insider’s Guide) — has rapidly emerged as one of the most popular and trusted resources. The big question is: Is ByteByteGo enough to crack a FAANG interview on its own? Let’s dive deep into what the platform offers, how it compares to other resources, and whether it can realistically take you from candidate to FAANG engineer. System Design · Coding · Behavioral · Machine Learning Interviews 1. What ByteByteGo Is? ByteByteGo started as a newsletter and video series focused on system design. Over the years, it has grown into a comprehensive interview-prep platform covering nearly every topic a top tech company might test: * System Design — From fundamentals to advanced case studies like designing Twitter, YouTube, or payment systems. * Coding Interviews — Data structures, algorithms, and problem-solving strategies. * Machine Learning System Design — Real-world ML cases, model serving, data pipelines, and metrics. * Generative AI & LLMs — New content on designing and scaling AI systems powered by large language models. * Object-Oriented Design — Classic OO principles, design patterns, and architecture best practices. This expansion has turned ByteByteGo into a one-stop shop for FAANG interview preparation. And with a 50% lifetime discount currently available, it’s an appealing alternative to juggling multiple courses and platforms. 👉 Check out ByteByteGo’s Lifetime Plan with 50% Off 2. Why ByteByteGo Stands Out for FAANG Interview Preparation? Well, here are the top reasons why ByteByteGo is considered a good resource for FAANG interview preparation in 2025. a) Expert-Led Content The platform is led by Alex Xu, who authored one of the best-selling system design interview books. He brings first-hand FAANG interview experience, ensuring that the content aligns with what real hiring managers expect. ByteByteGo’s content is not just theoretical — it reflects current industry practices, which is crucial in a rapidly evolving tech landscape and most of their books and courses are designed by ex-FAANG engineers as shown below b) Depth + Practicality Unlike some resources that only scratch the surface or dump endless problems without context, ByteByteGo balances conceptual depth with practical examples. Each topic — whether it’s designing a scalable database or deploying an ML pipeline — is broken into digestible lessons with clear trade-offs, diagrams, and frameworks you can use in interviews. c) Coverage of Emerging Topics FAANG interviews are evolving. In 2025, it’s not enough to know standard system design. You might face questions on machine learning systems, event-driven architectures, or even LLM-powered applications. ByteByteGo stays ahead of the curve with weekly updates and new courses on Generative AI, making it one of the few platforms to cover these cutting-edge areas. d) Structured Learning Paths ByteByteGo organizes content into structured tracks for: * Coding interviews (data structures & algorithms) * System design (from beginner to advanced) * Machine learning & AI design * Object-oriented design and patterns This structure makes it easy to plan your prep, track progress, and avoid getting lost in a sea of random problems. By the way, if you are preparing for FAANG or MAANG then I highly recommend you to join ByteByteGo, where you will not just get this book but also volume 2 and Alex’s other books on Object Oriented Design, Machine Learning System Design and Generative AI System Design. They are also offering 50% discount now on lifetime plan which offer best value. I just bought it and recommend same plan to you. Once you got that, you are set for any interview prep. System Design · Coding · Behavioral · Machine Learning Interviews 3. Comparing ByteByteGo to Other Prep Options Now, let’s compare ByteByteGo to other popular platforms and resources for preparing for tech interviews in 2025 1. Books (like System Design Interview or Cracking the Coding Interview) Books like System Design Interview — An Insider’s Guide: Volume 1 and 2 are fantastic for structured learning and deep dives, but they’re static. Interviews and technologies evolve, and books can’t update weekly with new topics like Generative AI or emerging system patterns. ByteByteGo provides ongoing updates, in-depth explanations, and real-time community Q&A, which books can’t match. System Design Interview - An Insider's Guide: Volume 2 2. Platforms like LeetCode or HackerRank LeetCode is the gold standard for coding practice, but it focuses almost entirely on algorithmic coding questions. ByteByteGo covers coding as well, but also includes system design, ML design, and OOP design — areas LeetCode doesn’t touch. Many successful candidates use both: LeetCode for brute-force coding practice, ByteByteGo for holistic interview coverage. 3. Courses on Udemy or Coursera You can piece together individual courses for system design, ML design, and OOP patterns on platforms like Udemy or Coursera. While this can work, it often requires subscribing to multiple courses and filtering content to match FAANG interviews. ByteByteGo consolidates all these topics into a single subscription, saving time and effort. System Design · Coding · Behavioral · Machine Learning Interviews 4. Live Coaching Platforms (Exponent, InterviewKickstart) Live coaching platforms provide 1:1 mock interviews and feedback but are far more expensive — often thousands of dollars. ByteByteGo is a fraction of the cost (especially with the lifetime deal) while still offering expert guidance and mock case studies. 4. Strengths That Make ByteByteGo FAANG-Ready Based on community feedback and my own review of the content, here are ByteByteGo’s biggest strengths: * Comprehensive Coverage — From coding to system design to ML/AI, it covers every major interview category under one roof. * Realistic Case Studies — Detailed walk-throughs of real-world systems like Netflix, WhatsApp, and ChatGPT give you a competitive edge. * Constant Updates — New lessons and diagrams are added weekly, keeping pace with the latest technologies. * Lifetime Access (with Discount) — The 50% lifetime deal means a one-time payment grants permanent access to all current and future content. * Community Support — A growing community of engineers, mock interview partners, and Q&A forums helps reinforce learning. 5. Potential Limitations to Consider No platform is perfect, and ByteByteGo is no exception. Here are a few points to keep in mind: * Coding Depth: While it covers coding interviews, hardcore algorithm practice still benefits from platforms like LeetCode for sheer volume and variety of problems. * No Live Coaching: Unlike expensive coaching programs, ByteByteGo doesn’t offer live mock interviews with hiring managers (though it provides frameworks to self-practice). * Self-Discipline Required: With lifetime access comes the temptation to procrastinate. You’ll need to set a study schedule and stick to it. These are not deal-breakers, but it’s worth supplementing ByteByteGo with daily coding practice and, if needed, a few live mock interviews. 6. How to Use ByteByteGo to Prepare for a FAANG Interview Here’s a step-by-step roadmap to maximize ByteByteGo if you’re aiming for a FAANG offer: Step 1: Assess Your Timeline * 3–6 months away: Balance coding (LeetCode) with ByteByteGo’s system design and ML tracks and ByteByteGo 101, a list of question based upon popular coding interview patterns. * 1–3 months away: Focus on ByteByteGo’s coding and system design crash courses. * Less than 1 month: Prioritize mock interviews and ByteByteGo’s condensed frameworks. Step 2: Follow the Structured Tracks * Coding: Refresh fundamentals, solve curated problems, and review patterns. * System Design: Work through beginner cases before tackling advanced scenarios like global-scale social networks. * ML Design & Gen AI: Cover trending topics to stand out in 2025 interviews. Step 3: Diagram and Explain Practice sketching architecture diagrams for every case study. ByteByteGo provides reference diagrams, but you should practice explaining trade-offs aloud — just like in a real interview. Step 4: Combine with Daily Coding Even with ByteByteGo’s coding lessons, daily LeetCode practice ensures your algorithmic reflexes stay sharp. Aim for at least one coding problem per day. Step 5: Mock Interviews Use ByteByteGo’s frameworks to run mock interviews with peers. Practicing live communication is key to FAANG success. 7. ByteByteGo + Lifetime Deal: A Smart Investment One of ByteByteGo’s biggest advantages right now is its 50% lifetime discount. Instead of paying monthly or yearly, you pay once and gain permanent access to all current and future content. For engineers targeting FAANG roles — or those who plan to grow into staff or principal positions — this is a bargain. Interviews aren’t just a one-time event; promotions and job switches mean you’ll revisit these skills throughout your career. A lifetime subscription ensures you’re always interview-ready without ongoing costs. 👉 Grab the 50% Lifetime Plan Here 8. Is ByteByteGo Enough on Its Own? The honest answer: Almost. ByteByteGo provides everything you need for system design, ML design, Generative AI, and even OOP design. For coding interviews, it covers the core patterns but is best paired with daily practice on a problem bank like LeetCode. Add a few live mocks with peers or mentors, and you have a complete preparation strategy. For most candidates, ByteByteGo can serve as the central hub of interview prep — something no single book, course, or coding site can claim. System Design · Coding · Behavioral · Machine Learning Interviews 9. Final Verdict If I were preparing for a FAANG interview in 2025, ByteByteGo would be my primary resource. It consolidates everything — system design, machine learning system design, coding patterns, OOP design, and even Generative AI — into one platform, updated weekly by industry experts. With the current 50% lifetime discount, it’s not only a powerful preparation tool but also an outstanding long-term investment in your engineering career. My recommended strategy: * Use ByteByteGo as your main guide for system design, ML design, OOP, and AI topics. * Supplement coding with daily practice on LeetCode for breadth. * Add a few peer mock interviews to sharpen communication skills. Follow this plan, and ByteByteGo provides everything you need to confidently tackle FAANG interviews — and to keep your skills sharp long after you land the job. 👉 Join ByteByteGo with 50% Lifetime Access System Design · Coding · Behavioral · Machine Learning Interviews Bottom line: ByteByteGo won’t just help you crack your next FAANG interview — it will help you grow into the kind of engineer who thrives at that level for years to come. Other System Design and Coding Interview and Resources you may like * Is OOP Design Interview — An Insider Guide worth it? * ByteByteGo vs Udemy? Which is better for System Design inteviews? * 16 Best Resources for System Design Interview Prep * ByteByteGo 50% OFF? Should you Join? * Is ByteByteGo a good place to learn Software Architecture? * Should you join ByteByteGo to learn System Design? * Is System Design Interview RoadMap by DesignGurus worth it? * Is Exponent’s System Design Course worth it? * Is DesignGuru’s System Design Course worth it * Why AlgoMonster is best platform for DSA Prepration in 2025 * ByteByteGo vs NeetCode vs Educative? which one is better? * DesignGurus.io Review 2025 — Is it worth it? * Is ByteByteGo a good place for Coding interviews? * 3 Free Books and Courses for System Design Interviews * ByteBytego vs Exponent? which one is better? * Is Exponent Good Place for Coding Interview Prep? * ByteByteGo vs Udemy? Which one is better for System Design? * 6 Best System Design and API Design Interactive Courses * Top 5 System Design YouTube Channels for Engineers * How to prepare for DSA for coding interviews? * Data Intensive Application vs System Design Insider Guide? All the best for your System Design interview preparation and leanring journey , if you have any doubts or questions, feel free to ask in the comments. P. S. — If you just want to do one thing at this moment, join ByteByteGo and start learning software architecture fundamentals and you will thank me later. It’s one of the most comprehensive resource for coding interview now. System Design · Coding · Behavioral · Machine Learning Interviews --- Is ByteByteGo Enough to Crack a FAANG Interview? A Complete 2025 Review was originally published in Javarevisited on Medium, where people are continuing the conversation by highlighting and responding to this story.
dlvr.it
#Review — Is Mobile System Design Interview: An Insider’s Guide book by ByteByteGo Worth it?
#Review — Is Mobile System Design Interview: An Insider’s Guide book by ByteByteGo Worth it? Finally — a system design book that focuses on mobile apps. Here’s why ByteByteGo’s latest release deserves a spot on every engineer’s shelf. credit — ByteByteGo Hello guys, If you have been giving interviews recently then you may know that the System design interviews are no longer limited to backend engineers. With the rise of complex, large-scale mobile applications — from TikTok to Uber — mobile engineers today are expected to reason about architecture, scalability, and data flow just as deeply as their backend counterparts. That’s where Mobile System Design Interview: An Insider’s Guide book by ByteByteGo truly shines. If you don’t know ByteByteGo is a leading platform for coding and System design interview preparation which is created by Alex Xu, author of popular System Design Interview: An Insider’s Guide series of #books. After the success of his System Design books, he partnered with many other authors and FAANG experts to create many more books covering Generative AI System Design, ML System Design, and Object Oriented System Design. This is ByteByteGo’s latest release which is focused on System Design of Mobile applications. Written by Manuel Vicente Vivo, this book aims to fill the gap between mobile app development and system design thinking. Vivo, who brings years of Android experience and real-world architectural insights, takes the mystery out of mobile system design interviews and helps developers approach them with structure and confidence. By the way, if you don’t know, both books are published under ByteByteGo umbrella and they are also available on ByteByteGo website. If you are preparing for tech interview then ByteByteGo is one of the most popular resource and I highly recommend it. If always wanted to join then now is the best time as they are also offering 50% discount on their annual and lifetime plan, which makes them even more valuable. System Design · Coding · Behavioral · Machine Learning Interviews But is this book really worth adding to your prep list? Let’s take a deep dive. What does the Mobile System Design Interview Book Covers? The book is more than just theory — it’s a hands-on, structured guide for tackling tough interview questions like “Design YouTube,” “Build a chat app,” or “Create a stock trading platform.” It introduces a five-step framework that works for both Android and iOS engineers, helping readers break down open-ended design questions into understandable chunks. Each chapter walks you through realistic scenarios and end-to-end solutions. Here’s what makes this book stand out: * A step-by-step interview framework for designing mobile systems * Seven detailed case studies, including Chat App, YouTube, and Google Drive * 24 deep dives into mobile performance, offline sync, and scalable architecture * Over 175 technical topics covering the entire spectrum of mobile system design You’ll find not just high-level designs, but detailed discussions of trade-offs — data synchronization, caching, pagination, client-server communication, and network reliability. It’s the kind of content that turns an average app developer into a well-rounded mobile architect. If you’d like to grab a copy, you can check on Amazon here: Mobile System Design Interview: An Insider’s Guide Mobile System Design Interview: An Insider's Guide Who This Book Is For? This book is ideal for: * Mobile engineers preparing for system design interviews at FAANG and top startups * Senior developers or tech leads wanting to understand mobile architecture deeply * Engineering managers and CTOs who want to mentor or assess mobile teams effectively Even if you’re not interviewing right now, it’s a great resource for improving your understanding of mobile scalability and performance optimization. If you are an App developer and preparing for FAANG interviews then I highly recommend you to read this book. Alternatively you can also join ByteByteGo platform where you can not just get all the content of this book but all of the ByteByteGo books on System Design Coding interview. The best thing is that they are also offering 50% discount now for a limited time. Here is the link — Join ByteByteGo now for 50% OFF Why You Should Read It (and Why ByteByteGo Makes It Even Better) What makes Mobile System Design Interview: An Insider’s Guide even more valuable is that it comes from ByteByteGo — the same creators behind System Design Interview — An Insider’s Guide and Machine Learning System Design Interview. * Machine Learning System Design Interview * System Design Interview - An Insider's Guide: Volume 2 The ByteByteGo team has become the gold standard for system design education. Their platform offers in-depth courses, visual explanations, and new learning paths on OOP Design, Machine Learning System Design, and AI System Design — all presented in the same clear, visual-first style as their books. If you prefer interactive learning, you can explore these topics directly on the ByteByteGo platform — and right now, they’re offering an incredible 50% discount on both their lifetime and annual plans. That gives you full access to all their premium books, visual guides, and video-based courses for one price. Whether you’re preparing for your next mobile system design interview or want to master architecture across web, backend, and AI systems, ByteByteGo provides everything under one roof. 👉 You can check out the Lifetime Plan here on ByteByteGo. Compared to the annual subscriptions that add up over time, this one-time purchase makes sense for anyone who is serious about long-term career growth. Final Verdict If you’re a mobile engineer serious about cracking system design interviews or simply want to think more architecturally about your apps, Mobile System Design Interview: An Insider’s Guide is absolutely worth it. It brings clarity to a subject that most developers find intimidating and gives you a mental framework you can reuse across problems and platforms. Combine it with the ByteByteGo platform’s broader ecosystem of resources, and you have a complete learning toolkit for 2025 and beyond. So yes — this book isn’t just worth it; it’s one of the smartest investments you can make in your mobile engineering career. 👉 Get Mobile System Design Interview: An Insider’s Guide on Amazon 👉 You can explore the Lifetime Plan here: ByteByteGo System Design Platform. System Design · Coding · Behavioral · Machine Learning Interviews If you’re serious about cracking Mobile App system design interviews — or simply becoming a better engineer — it’s an investment that will pay dividends for years to come. Other System Design and Coding Interview and Resources you may like * 16 Best Resources for System Design Interview Prep * How Codemia.io helped me to learn System Design better? * Is Generative AI System Design Interview — Insider Guide worth it? * 10 Reasons to join Codemia.io for System Design Interview? * Is DesignGuru’s System Design Course worth it * I found Codemia.io — LeetCode for System Design? * Why ByteByteGo is the best website for Coding interview in 2025? * Why AlgoMonster is best platform for DSA Prepration in 2025 * Is Exponent’s System Design Course worth it? * Is OOP Design Interview — An Insider Guide worth it? * ByteBytego vs Exponent? which one is better? * 10 Best Places to Learn System Design in 2025 * Is Codemia.io 65% discount worth it? * Is Exponent Good Place for Coding Interview Prep? * 6 Best System Design and API Design Interactive Courses * Top 5 System Design YouTube Channels for Engineers * How to prepare for DSA for coding interviews? * 3 Places to Practice System Design Mock interviews * Is Designing Data-intensive application book worth reading? All the best for your Mobile System design and OOP Design Interviews, if you have any doubts or questions, feel free to ask in the comments.P. S. — If you just want to do one thing at this moment, join ByteByteGo and start learning software architecture fundamentals and you will thank me later. It’s one of the most comprehensive resource for coding interview now. System Design · Coding · Behavioral · Machine Learning Interviews --- Review — Is Mobile System Design Interview: An Insider’s Guide book by ByteByteGo Worth it? was originally published in Javarevisited on Medium, where people are continuing the conversation by highlighting and responding to this story.
dlvr.it
Stop Using Shared Mutable State — Embrace Immutability for Safer Code
Stop Using Shared Mutable State — Embrace Immutability for Safer Code Why shared mutable state causes subtle bugs — and how immutability (and tools like CodeRabbit) help you write safer, cleaner code. Hello guys, if you’ve ever spent hours debugging a concurrency issue or chasing down a mysterious side effect in production, chances are you’ve run into the consequences of shared mutable state. It’s one of those subtle #programming hazards that seems harmless — until your codebase grows and you realize you’re juggling landmines. In complex systems, especially those involving threads, asynchronous tasks, or reactive flows, shared mutable state is the silent killer of predictability.The same variable being read and modified by different parts of your system means you’re no longer in control of when or how its value changes. The result? Bugs that are hard to reproduce, harder to test, and sometimes nearly impossible to explain. That’s why developers across all ecosystems — from #Java and Kotlin to Python, Rust, and JavaScript — are turning to a more reliable paradigm: immutability. Why Shared Mutable State Is Dangerous? The phrase “shared mutable state” simply means a piece of data that: * Can be changed (mutable). * Is accessible from multiple parts of your program (shared). The combination creates chaos. Imagine multiple threads updating the same object at different times — one overwrites the other’s progress, unexpected side effects ripple through the system, and suddenly your logs look like a conspiracy theory. Even in single-threaded environments like JavaScript, shared mutable state can cause trouble when asynchronous operations mutate global or external state between callbacks. In short: mutable + shared = unpredictable. Embrace Immutability: A Safer Default Immutability means that once an object is created, it can’t be changed. Instead of modifying existing data, you create new instances with the updated values. This may sound inefficient at first, but modern languages and runtimes optimize immutable data structures heavily. The benefits far outweigh the cost: * Predictable behavior — No unexpected side effects. * Easier debugging — State transitions are explicit. * Thread safety — Immutable objects can be safely shared across threads. * Simpler testing — You can trust your data not to mutate mid-test. In functional programming languages like Haskell, Clojure, and Elixir, immutability is baked into the core philosophy. But even in OOP-heavy environments, you can apply the same principles. 4 Practical Steps to Move Toward Immutability You don’t need to rewrite your entire codebase in a purely functional style. Start small with these practices: 1. Prefer final or Const Declarations Mark variables as final (Java/Kotlin) or const (JavaScript/TypeScript) wherever possible. This signals intent and prevents accidental reassignment.final List users = List.of("Alice", "Bob", "Charlie"); // users.add("Eve"); // Compilation error – immutable list By marking variables final, you make sure they always point to the same reference, reducing the chances of accidental mutation 2. Use Immutable Data Structures Many libraries provide built-in immutable collections. * Java: List.of(), Map.of(), or Collections.unmodifiableList() * JavaScript: Libraries like Immutable.js or Immer * Python: Use frozenset or namedtuples for simple immutable types. Example:import java.util.*; public class ImmutableExample { public static void main(String[] args) { List names = List.of("Alice", "Bob", "Charlie"); // names.add("David"); // UnsupportedOperationException } } These built-in methods prevent modifications and are ideal for sharing state safely across threads. 3. Favor Pure Functions Over Side Effects Instead of modifying objects inside a method, return new objects with the desired changes.public record User(String name, int age) {} public class ImmutableUserExample { public static User celebrateBirthday(User user) { return new User(user.name(), user.age() + 1); } public static void main(String[] args) { User original = new User("Alice", 30); User updated = celebrateBirthday(original); System.out.println(original); // User[name=Alice, age=30] System.out.println(updated); // User[name=Alice, age=31] } } Records in Java 17+ are naturally immutable, making them perfect for this kind of design. 4. Avoid Global or Static Mutable State Global variables are a breeding ground for shared state issues. Instead, encapsulate state inside objects or pass it as parameters.public class Counter { private final int value; public Counter(int value) { this.value = value; } public Counter increment() { return new Counter(value + 1); } public int value() { return value; } } Each call to increment() returns a new Counter object—no mutation, no hidden side effects. Use Tools Like CodeRabbit to Detect Unsafe Mutations? Even with best intentions, it’s easy for mutable state to sneak into your code. That’s where AI-powered code review tools like CodeRabbit come in handy. CodeRabbit automatically reviews your pull requests, spots potential issues like unsafe state mutations, and even suggests refactors toward safer, immutable patterns. Instead of waiting for a production bug or a teammate to catch your mistake, CodeRabbit acts as your always-on pair programmer — helping you maintain clean, predictable, and maintainable codebases. It’s especially useful for teams adopting functional programming practices or modern architectural styles like event-driven systems, where data immutability plays a central role. If your team works with languages like Java, TypeScript, or Python, adding CodeRabbit to your workflow can drastically improve code quality while keeping reviews fast and consistent. The Bigger Picture: Immutability Leads to Stability The shift toward immutability is more than a #coding preference — it’s a mindset change. By designing software around immutable data, you reduce the complexity of reasoning about your system. Every state transition becomes explicit, testable, and auditable. And when you pair that with smart tools like CodeRabbit, you not only write safer code — you scale that safety across your entire team. So next time you’re tempted to reuse that mutable variable or tweak a shared object in place, pause. Instead of patching the symptom, embrace immutability — and you’ll find your codebase becomes more robust, reliable, and easier to evolve. All the best with your coding journey. !! --- Stop Using Shared Mutable State — Embrace Immutability for Safer Code was originally published in Javarevisited on Medium, where people are continuing the conversation by highlighting and responding to this story.
dlvr.it
Designing Data-Intensive Applications vs System Design Interview — An Insider’s Guide by Alex Xu?
Designing Data-Intensive Applications vs System Design Interview — An Insider’s Guide by Alex Xu? Which One Should You Read for Your System Design Interview? Hello guys, preparing for a system design interview can feel overwhelming as its very vast topic with no ends. Whether you’re aiming for a FAANG role or any company with large-scale distributed systems, you need more than coding skills — you need to show that you can architect real-world systems that scale, stay reliable, and meet evolving business requirements. And, when it comes to mastering System Design, two of the most recommended resources are Designing Data-Intensive Applications (DDIA) by Martin Kleppmann and System Design Interview — An Insider’s Guide (SDI) by Alex Xu. Both are widely praised, but they serve different purposes. If you’re pressed for time, which one should you pick? And how do they fit into a complete preparation strategy? Let’s break it down. * Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems * System Design Interview - An insider's guide 1. What Each Book Is About? Before going anywhere, let’s try to understand what’s each book is about? Which one is better to learn System Design fundamentals and which one is suited for System Design Interview preparation in short time. Designing Data-Intensive Applications (DDIA) Martin Kleppmann’s Designing Data-Intensive Applications is often called the “Bible of distributed systems.” It dives deep into how data systems — databases, caches, queues, streams — work under the hood. It explores consistency, replication, partitioning, fault tolerance, and the trade-offs that modern large-scale systems must navigate. Strength: Rigorous explanations of concepts like consensus algorithms, distributed transactions, and storage engines. Focus: Real-world data engineering and distributed systems fundamentals. Use Case: Perfect for engineers who want to understand the theory behind scalable systems and build long-term knowledge. You can grab it here: Designing Data-Intensive Applications (Amazon) I have also written a detailed review of this book which you can read here. System Design Interview — An Insider’s Guide (SDI) Alex Xu’s System Design Interview is laser-focused on interview preparation. Instead of deep theory, it provides a structured framework for answering open-ended system design questions, plus detailed walkthroughs of real interview problems like designing Twitter, Dropbox, or a URL shortener. It’s also a two part book where volume 1 covers fundamentals and frequently asked System Design questions and second part built upon that and cover more advanced concepts Strength: Clear step-by-step frameworks and practical examples that map directly to interview settings. Focus: Communication, trade-offs, and interview-ready designs. Use Case: Ideal for candidates who need to perform in an interview and want concrete strategies. You can find it here: System Design Interview — An Insider’s Guide (Amazon) By the way, if you are interested in this book then I highly recommend you to join ByteByteGo, where you will not just get this book but also volume 2 and Alex’s other #books on Object Oriented Design, Machine Learning System Design and Generative AI System Design. They are also offering 50% discount now on lifetime plan which offer best value. I just bought it and recommend same plan to you. Once you got that, you are set for any interview prep. System Design · Coding · Behavioral · Machine Learning Interviews 2. How They Differ in Approach Although both are great books for anyone who want to learn System Design and Software architecture, they differ significantly on what they teaches and how they teaches Goal * DDIA: Teaches deep distributed systems theory for long-term understanding. * SDI: Focuses on helping you ace system design interviews. Style * DDIA: Textbook-like, detailed, and concept-heavy. * SDI: Playbook style with clear, step-by-step frameworks. Learning Curve * DDIA: High — requires patience and some background in distributed systems. * SDI: Moderate — accessible to most engineers. Practical Exercises * DDIA: None; purely theoretical. * SDI: Includes interview-style case studies and example solutions. Time to Value * DDIA: Takes weeks or months to fully absorb and apply. * SDI: Delivers actionable preparation within days to weeks. Key takeaway If you have several months before your interviews, DDIA builds durable knowledge that will benefit your career. But if your interview is just weeks away, SDI offers fast, practical preparation. You can learn more about these books here * Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems * System Design Interview - An insider's guide 3. Which Book Should You Read First? The answer depends on your timeline and goals: * Short Timeline (Interview in 1–2 months): Start with System Design Interview. It’s tailored to interviews, helps you quickly structure answers, and covers the most frequently asked problems. * Long Timeline (Interview in 6+ months or career growth): Begin with Designing Data-Intensive Applications to master core concepts, then move to System Design Interview to learn how to communicate those concepts in interviews. * Ideal Strategy: Read SDI first to get comfortable with interview expectations, then gradually work through DDIA to deepen your understanding for future growth. Here is the link to get the SDI book — System Design Interview 4. Why You Still Need Practice Beyond Books Both System Design books are excellent, but reading alone is not enough. System design interviews are as much about communication and trade-off reasoning as technical knowledge. You’ll need to practice: * Explaining architecture diagrams on a whiteboard or shared doc * Estimating scale (requests/sec, storage needs, bandwidth) * Handling vague requirements and changing constraints This is where an interactive learning platform like Codemia.io and Bugfree.ai adds huge value. They provide platforms and tools so that you can practice System design questions live online and also sharpen your System design skills. * Master System Design Interviews Through Active Practice * Master System Design & Behavioral Interviews Like Leetcode 5. ByteByteGo — A Complete System Design Prep Platform If you want a structured, end-to-end solution, ByteByteGo is one of the best investments you can make. Co-founded by Alex Xu (the author of System Design Interview), ByteByteGo combines: * A complete courses on system design, distributed systems, and machine learning system design * Weekly deep dives with fresh case studies (covering new tech like LLMs, event-driven architecture, and real production systems) * Frameworks and mock interview guides to bridge the gap between theory and real interviews Right now, they’re offering an exclusive 50% discount on their annual and lifetime plan, making it a one-time investment for ongoing content updates. For anyone preparing for FAANG or senior engineering roles, this is arguably the most cost-effective and complete package available. 👉 Check out ByteByteGo’s Lifetime Plan (50% Off) 6. Final Recommendation If your main goal is to crack an upcoming system design interview, start with System Design Interview — An Insider’s Guide. It gives you a clear framework, dozens of practical examples, and the confidence to perform well under pressure. If you have the time and want to build long-term mastery, read Designing Data-Intensive Applications. It’s more challenging, but it will transform how you think about distributed systems and make you a stronger engineer beyond the interview. For most candidates, the winning combination looks like this: * Read SDI to learn interview techniques. * Practice on ByteByteGo to reinforce concepts with real examples and mock interviews. * Study DDIA when you want to go deeper and stand out as a systems expert. By blending these resources, you’ll cover both short-term performance and long-term career growth — and with ByteByteGo’s 50% lifetime offer, you can get everything you need in one place. Quick Links: * Designing Data-Intensive Applications (Amazon) * System Design Interview — An Insider’s Guide (Amazon) * ByteByteGo Platform — Lifetime Plan 50% Off In summary: read Alex Xu’s book to win the interview, read Kleppmann’s book to build enduring expertise, and use ByteByteGo to practice like you’re already in the interview room. System Design · Coding · Behavioral · Machine Learning Interviews Other System Design and Coding Interview and Resources you may like * Is OOP Design Interview — An Insider Guide worth it? * ByteByteGo vs Udemy? Which is better for System Design inteviews? * 16 Best Resources for System Design Interview Prep * ByteByteGo 50% OFF? Should you Join? * Is ByteByteGo a good place to learn Software Architecture? * Should you join ByteByteGo to learn System Design? * Is System Design Interview RoadMap by DesignGurus worth it? * Is Exponent’s System Design Course worth it? * Is DesignGuru’s System Design Course worth it * Why AlgoMonster is best platform for DSA Prepration in 2025 * ByteByteGo vs NeetCode vs Educative? which one is better? * DesignGurus.io Review 2025 — Is it worth it? * Is ByteByteGo a good place for Coding interviews? * 3 Free Books and Courses for System Design Interviews * ByteBytego vs Exponent? which one is better? * Is Exponent Good Place for Coding Interview Prep? * ByteByteGo vs Udemy? Which one is better for System Design? * 6 Best System Design and API Design Interactive Courses * Top 5 System Design YouTube Channels for Engineers * How to prepare for DSA for coding interviews? All the best for your System Design interview preparation and leanring journey , if you have any doubts or questions, feel free to ask in the comments. P. S. — If you just want to do one thing at this moment, join ByteByteGo and start learning software architecture fundamentals and you will thank me later. It’s one of the most comprehensive resource for coding interview now. System Design · Coding · Behavioral · Machine Learning Interviews --- Designing Data-Intensive Applications vs System Design Interview — An Insider’s Guide by Alex Xu? was originally published in Javarevisited on Medium, where people are continuing the conversation by highlighting and responding to this story.
dlvr.it
4 Examples of CASE expression in SQL
What is CASE and where is it used? When a condition is met, the CASE statement evaluates different conditions and returns a scalar value. The phrase from the ELSE block will be returned if none of the conditions are evaluated to TRUE. The ELSE block, however, is optional. Above all, the CASE statement has two formats Simple CASE & Searched CASE. The Searched CASE statement is highlighted in this post. To get the results, you'll need to use search and pattern matching. 4 CASE statement usages ane Examples Now let's see different types of CASE statement and their example to understand this key SQL concept in detail. 1. Simple CASE statement We may use a simple CASE expression to compare various expressions instead of creating stacked IF statements. A basic CASE expression compares the first expression to the WHEN clause expression in this way.  If there is a match, the expression following THEN is evaluated; otherwise, the expression in the ELSE block is evaluated. It's worth noting that the ELSE block is optional. A simple CASE statement has the below-given syntax : CASE WHEN condition1 THEN result1 WHEN condition2 THEN result2 WHEN conditionN THEN resultN ELSE result END; Now, let's work on a real-time example. Let's create a table named Customers with the following sample data as shown below :  Now, let's write a CASE statement and demonstrate how and why it is used. let's write a CASE statement by filtering countries. Let's do it for 2 countries Germany, Mexico, and the rest. The Query would be like something below :  SELECT CustomerID, CustomerName, City, CASE WHEN Country = 'Germany' THEN 'German it is sire!' WHEN Country = 'Mexico' THEN 'The country of Pablo!' ELSE 'None other matters' END AS CountryDescription FROM Customers; The result of the above query would be something like this :  2. searched CASE CASE was searched, and SIMPLE was expanded. This analyses a collection of boolean expressions, such as pattern matching and range comparisons. If any of the boolean expressions is TRUE, then the expression after THEN is evaluated. If none of the boolean expressions after WHEN evaluate to TRUE, the ELSE block is evaluated. Economy class is defined as a wage that is higher than 500 but less than 2000. Furthermore, a salary of more than $2,000 is classified as a premium. If the salary falls outside of a set range, an ELSE block with no travel is provided. The query for the same will be :  SELECT ID, Name, Gender, Salary, CASE WHEN Salary >= 500 AND Salary < 2000 THEN 'Economy Class' WHEN Salary >= 2000 THEN 'Premium Class' ELSE 'No Travel' END TravelMode FROM (VALUES (1,'Vish', 'M', 100) ,(2,'Atul', 'M', 200) ,(3,'Vishal','M', 500) ,(4,'Kasturi','F',2000) ,(5,'Belinda','F',5000)) as Emp(Id, Name, Gender, Salary); The resultant would look like below :  ID Name Gender Salary TravelMode ----------- ------- ------ ----------- ------------- 1 Vish M 100 No Travel 2 Atul M 200 No Travel 3 Vishal M 500 Economy Class 4 Kasturi F 2000 Premium Class 5 Belinda F 5000 Premium Class 3. Searched CASE with IN, OR and, LIKE operator This example shows how to utilise CASE expressions with various clauses and operators. The IN, OR, and LIKE operators are used for pattern matching and comparison in the query below. In this situation, the IN and OR operators are practically identical. LIKE allows us to use pattern matching with ease. The query would look like this :  SELECT ID, Name, Gender, Salary, CASE WHEN Name IN ('Atul', 'Belinda') THEN 'Class 1' WHEN Name LIKE 'K%' THEN 'Class 2' WHEN (NAME = 'Vish' OR Name = 'Vishal') THEN 'Class 3' ELSE 'No Class' END as ClassInfo FROM (VALUES (1,'Vish', 'M', 100) ,(2,'Atul', 'M', 200) ,(3,'Vishal','M', 500) ,(4,'Kasturi','F',2000) ,(5,'Belinda','F',5000) ,(5,'Simona','M',5000)) as Emp(Id, Name, Gender, Salary); The answer we get from the above query would look like below :  4. Searched CASE Expression with CHARINDEX & PATINDEX Similarly, with the searched CASE, use the CHARINDEX and PATINDEX functions. The following example shows how to use the CHARINDEX function to determine if a character occurs in any given name. Pattern matching with PATINDEX to see if (Underscore) appears anywhere in the name column. The query would look like this :  SELECT ID, Name, Gender, Salary, CASE WHEN CHARINDEX('s', Name) > 0 THEN 'Contains char s' WHEN PATINDEX('%_%',Name) > 0 THen 'Underscore Exists' ELSE 'Optional' END as ClassInfo FROM (VALUES (1,'Vish', 'M', 100) ,(2,'Atul_', 'M', 200) ,(3,'Vishal','M', 500) ,(4,'Kasturi','F',2000) ,(5,'Belinda_','F',5000) ,(5,'Simona','M',5000)) as Emp(Id, Name, Gender, Salary); The answer we get from the above query would look like below :  ID Name Gender Salary ClassInfo ----------- -------- ------ ----------- ----------------- 1 Vish M 100 Contains char s 2 Atul_ M 200 Underscore Exists 3 Vishal M 500 Contains char s 4 Kasturi F 2000 Contains char s 5 Belinda_ F 5000 Underscore Exists 5 Simona M 5000 Contains char s Conclusion That's all about the CASE expression in SQL. In this tutorial, you have learned about the Searched CASE expression in this post. The two most popular forms are simple and searched cases. In comparison to Simple, we can accomplish more with Searched case thanks to extended pattern machining and the usage of functions. Furthermore, the majority of the functions interact with Searched CASE in order to do more. My Other SQL Articles and Tutorials you may like * Difference between DDL and DML commands in SQL * How to remove duplicate rows in SQL * How to concatenate columns in SQL * How to find Nth Highest salary in SQL * How to use Cross Join in SQL * How to use ORDER BY in SQL with example * How to use row_number function in SQL * 15 SQL Interview Questions with Answers * How to use LEFT, RIGHT, and SELF JOIN * What is a Virtual column in MySQL? Example * How to do pagination in SQL with Examples * How to transpose data in SQL with examples Thanks for reading this article so far. If you like these common examples of CASE expression in SQL  then please share it with your friends and colleagues. If you have any questions or feedback then please drop a note. 
dlvr.it
Top 30 MySQL Interview Questions for 2 to 3 Years Experienced Developers
Hello guys, if you are preparing for MySQL interviews or you are preparing for a tech interviews where MySQL skills are needed and you are looking for MySQL questions then you have come to the right place. Earlier, I have shared 15 SQL queries from interviews and 30 Database Interview Questions and in this article, I am going to share 50+ MySQL questions which you can practice before interviews. These MySQL question touches many different topics on MySQL like Database and SQL related as well MySQL engine specific questions like MyISAM vs InnoDB etc. 15 Common MySQL Concepts Questions for Interviews Here are some common MySQL questions that you may encounter in a job interview: 1. What is MySQL and how does it differ from other relational databases?MySQL is an open-source relational database management system known for its speed, reliability, and ease of use. It stands out with widespread community support, making it a popular choice for developers. Its versatility and scalability distinguish it from other relational databases, offering a robust solution for various applications. 2. What are the main features of MySQL?MySQL's main features include open-source availability, user-friendly setup and management, scalability for growing datasets, and high reliability with strong data integrity. It ensures high performance, supports multiple operating systems, incorporates robust security measures, and benefits from a vibrant community for ongoing support and development. 3. What are the benefits and drawbacks of using MySQL?Benefits of MySQL include open-source flexibility, ease of use, scalability, and strong community support. Drawbacks may involve potential performance issues with complex queries, limited support for some advanced features compared to enterprise databases, and the need for proper configuration to handle large datasets efficiently. 4. How do you design and implement a MySQL database? Designing and implementing a MySQL database involves several key steps. First, define the database requirements, including data entities, relationships, and constraints. Create a conceptual data model and then transform it into a logical model, specifying tables, columns, and primary/foreign keys. Normalize the database to minimize redundancy and ensure data integrity. Choose appropriate data types and set up indexing for performance optimization. Implement the database using SQL statements to create tables, views, and stored procedures.  Regularly back up the database to prevent data loss, and consider scalability aspects for future growth. Testing and refining the database design as needed is crucial to ensure efficiency and meet application requirements. 5. How do you optimize the performance of a MySQL database?You can optimize MySQL performance by indexing frequently queried columns, using appropriate data types, caching queries, and optimizing SQL queries. Regularly analyze and optimize database schema, implement proper normalization, and consider denormalization for read-heavy workloads. You can also utilize MySQL's built-in performance tuning tools, monitor server resources, and adjust configuration parameters such as buffer sizes and caching settings. Regularly update statistics, optimize storage engines, and consider partitioning large tables. 6. What is data consistency and data integrity in MySQL?Data consistency in MySQL ensures that data is accurate and reliable throughout the database. It involves maintaining a uniform and valid state of data. Data integrity, on the other hand, ensures that data is accurate and conforms to defined rules and constraints, such as primary key uniqueness and foreign key relationships. In MySQL, constraints, transactions, and normalization are mechanisms used to enforce data integrity and consistency. 7. What is data replication and data partitioning in MySQL?Data replication in MySQL involves creating and maintaining multiple copies of the same data on different database servers. It enhances fault tolerance, enables load balancing, and supports disaster recovery. MySQL provides various replication methods, including master-slave and master-master configurations. Data partitioning in MySQL involves dividing large tables into smaller, more manageable partitions based on certain criteria such as range, list, or hash. This can improve query performance, simplify data management, and enhance parallelism in data processing. Each partition operates independently, allowing for more efficient storage and retrieval of specific subsets of data. 8. How do you handle data backups and data recovery in MySQL?You can handle data backups in MySQL by regularly using the mysqldump tool or MySQL Enterprise Backup for logical and physical backups, respectively. You an also implement a schedule for automated backups and store them in a secure location.  Consider using binary logs for point-in-time recovery. For data recovery, restore from the latest backup using mysql or MySQL Workbench. Monitor and test the backup and recovery processes to ensure reliability in case of data loss or system failures 9. What is data security and data encryption in MySQL? 10.What is data migration and data integration in MySQL? 11. How do you handle data modeling and data normalization in MySQL? 12. How to handle data indexing and data querying in MySQL?For data indexing in MySQL, identify frequently queried columns and create indexes on them using appropriate types (e.g., B-tree or full-text indexes). Strike a balance between indexing for improved query performance and avoiding over-indexing, which can impact write operations. Regularly analyze query execution plans to identify optimization opportunities. When handling data querying, optimize SQL queries by using proper indexing, avoiding SELECT * when unnecessary, and limiting the use of wildcards in WHERE clauses. Optimize complex queries by understanding and leveraging MySQL's query optimization features, such as the EXPLAIN statement. Monitor and tune the database server's performance parameters to ensure efficient data retrieval. 13. What is data monitoring and data troubleshooting in MySQL? 14. How do you handle data scalability and data partitioning in MySQL?You can handle data scalability in MySQL by considering techniques like horizontal partitioning and sharding. Horizontal partitioning involves distributing rows of a table across multiple servers, while sharding involves distributing different tables or databases across servers.  Use tools like MySQL Cluster or MySQL Router to manage a sharded environment. Additionally, optimize queries, utilize caching mechanisms, and consider read replicas to distribute read workload. For data partitioning, leverage MySQL's built-in features like RANGE, LIST, or HASH partitioning to divide large tables into smaller, manageable partitions. This can enhance query performance, simplify data management, and improve parallelism in data processing. Each partition operates independently, allowing for efficient storage and retrieval of specific data subsets. Regularly monitor and adjust partitioning strategies as data grows. 15. How do you handle data governance and data lifecycle management in MySQL? 16. Can you explain how MySQL Database work?Here is a diagram which explains logical architecture of MySQL database with key components like query cache, parser and storage It's also worth noting that these MySQL questions are just examples and you may nor may not get these questions. In fact questions that you may encounter in an interview will depend on the company, the job, and the specific requirements of the project. It's important to prepare and understand the concepts and best practices of MySQL and to be able to demonstrate your experience and skills in this area. 15 MySQL Command Interview Questions So far, we have seen theory based MySQL questions and now its time to see essential MySQL commands that you may be asked about in a job interview: 1. How do you connect to a MySQL server? 2. Write SQL query to create a new database and a new table in MySQL?To create a new database and a new table in MySQL, you can use the following SQL queries: Create a new database: $ CREATE DATABASE IF NOT EXISTS Trade; Switch to the newly created database: $ Use Trade Now, Create a new table within the database: CREATE TABLE IF NOT EXISTS Futures (    column1 datatype1,    column2 datatype2,    column3 datatype3,    -- add more columns as needed    PRIMARY KEY (column1)); 3. How do you insert, update, and delete data in a MySQL table? 4. How do you select data from a MySQL table? 5. How to use SQL joins to retrieve data from multiple tables? 6. How do you create and drop indexes in MySQL? Give Exampleshint - Here is the command to create index in MySQL 7. Can you please explain transactions and locking in MySQL? 8. How do you use stored procedures and functions in MySQL? 9. How do you use views and triggers in MySQL? 10. What is constraints and foreign keys in MySQL? 11. How to use backup and restore commands in MySQL? 12. What is LIMIT keyword in MySQL? how to use it? In MySQL, the LIMIT keyword is used in a SELECT query to restrict the number of rows returned by the query. It is particularly useful when dealing with large datasets or when you only need a specific subset of rows. The basic syntax is as follows: SELECT column1, column2, ...FROM your_tableLIMIT number_of_rows; Here's a brief explanation of how to use the LIMIT keyword: Example 1: Retrieve the first N rows: SELECT * FROM your_tableLIMIT 10; This query retrieves the first 10 rows from the specified table. Example 2: Retrieve a specific range of rows: SELECT * FROM your_tableLIMIT 20, 10; This query skips the first 20 rows and then retrieves the next 10 rows, useful for paginating results. The LIMIT clause takes one or two arguments. If one argument is provided, it specifies the maximum number of rows to return. If two arguments are provided, the first one specifies the starting point (offset) and the second one specifies the number of rows to return. Keep in mind that the order of rows is important when using LIMIT, and you may want to use an ORDER BY clause to ensure the desired order of results. 13. How do you find the Nth highest salary in MySQL? 14. How to find the second highest salary in MySQL? 15. How do you use the command line client to administer a MySQL server? 16. How do you use the SHOW and EXPLAIN commands to troubleshoot and optimize queries? 17. Explain GRANT and REVOKE commands to manage user permissions? 18. How do you use the OPTIMIZE and ANALYZE table commands to improve performance? That's all about 30 MySQL questions for practice. If you have worked in MySQL database then you can easily answer these questions but if you haven't then you need to prepare. These questions will also give you idea about which topic to prepare and which concepts are important from an interview point of view. All the best for you interview and if you have any doubt feel free to ask in comments.  Other SQL and Database Articles you may like: * Difference between UNION and UNION ALL in SQL * 10 Examples of ALTER command in SQL * MySQL vs NoSQL comparison * Difference between Self and Equi join in SQL * What are T-SQL Window Functions? * How to use Stored Procedure in SQL? * 4 Examples of CASE expression in SQL Server * How to create and rollback transaction in database? * How to convert String to Date in SQL? * How to use WHERE and HAVING clause in SQL * How to find top 10 Records in SQL * Difference between Truncate, Drop, and Delete in SQL Thanks for reading this article so far. If you have any questions or doubt feel free to ask. 
dlvr.it
Review — Is Educative a Good Place to Learn #AI and #LLM Engineering?
Review — Is Educative a Good Place to Learn #AI and #LLM Engineering? My favorite Artificial Intelligence, Gen AI and LLM courses on Educative.io Hello guys, Artificial Intelligence is no longer a futuristic concept — it’s a cornerstone of modern software development, product strategy, and innovation. From large language models (LLMs) to AI-powered tools, understanding how AI works and knowing how to build with it has become essential for developers, product managers, and tech leaders alike. With so many online learning platforms, it can be overwhelming to pick the right one. That’s where Educative.io stands out as a highly practical, developer-friendly option for mastering AI in 2026. I’ve explored dozens of AI courses, and if your goal is to become an LLM engineer, AI architect, or a tech leader fluent in AI, these five Educative courses are among the best resources to prepare for 2025 and beyond. And at the end, I’ll explain why Educative Unlimited is the smartest choice if you want full access to these courses and many more. Educative Unlimited: Excel with AI-Powered Learning My Favorite Educative Courses to Learn AI and LLM Engineering in 2025 Here are the top Educative courses for AI and LLM engineering — interactive, project-driven, and designed for real-world application. I’ve also included skill paths that help you become an Agentic AI Engineer or an LLM Engineer. 1. Become an LLM Engineer (Skill Path | Best for Engineers & Developers) This flagship Skill Path takes you from the basics of generative AI and prompt engineering all the way to building production-grade AI applications. You will learn LangChain workflows, RAG systems, fine-tuning with LoRA/QLoRA, and AI agent creation with CrewAI. Highlights: * Prompt engineering & OpenAI API usage * Vector databases for RAG workflows * Fine-tuning techniques with LoRA & QLoRA * AI Agent creation with CrewAI Ideal for: Engineers who want to go beyond prompts to build real-world GenAI applications. Join here — Become an LLM Engineer Become an LLM Engineer - AI-Powered Learning for Developers 2. Grokking AI for Engineering & Product Managers (Best for Tech Leads & PMs) Not everyone building AI products needs to code AI models. This course is tailored for product managers, tech leads, and founders who want a solid understanding of AI, ML, ethical design, and real-world applications. Learn: * Core AI and ML concepts (no coding required) * AI algorithms and evaluation metrics * Ethical AI design and risk mitigation * Real-world case studies for product strategy Ideal for: Tech leaders and decision-makers in AI-driven organizations. Join here — Grokking AI for Engineering & Product Managers Grokking AI for Engineering & Product Managers - AI-Powered Course 3. Generative AI Essentials (Best for Beginners & Tech Enthusiasts) Want a clear, practical introduction to GenAI? This course covers the evolution of AI, multimodal applications, and how large language models power tools like ChatGPT. Highlights: * Pretraining, fine-tuning, and foundation models * Sequence models, transformers, and attention mechanisms * Multi-modal AI: vision, audio, and text Ideal for: Beginners looking to grasp AI concepts and practical applications. Join here — Generative AI Essentials Generative AI Essentials - AI-Powered Course 4. Master GitHub Copilot (Best for Everyday Coders & AI-Assisted Development) GitHub Copilot is transforming the way developers write code. This course teaches integration techniques, debugging, AI-assisted pull requests, and responsible AI use in coding. Learn: * Copilot prompting and workflow optimization * AI-assisted testing and debugging * Integrating AI into GitHub workflows Ideal for: Developers who want to work faster and smarter using AI. Join here — Master GitHub Copilot Master GitHub Copilot - AI-Powered Course 5. Code Smarter with Cursor AI Editor (Best for VS Code Users & Productivity-Focused Developers) Cursor AI is an AI-first IDE, and this course teaches how to use it for natural language code navigation, debugging, and building projects like a Django Wordle clone. Highlights: * Setup and efficient usage of Cursor IDE * AI-assisted project management and code generation * Debugging, testing, and full-stack project building Ideal for: Developers wanting AI-assisted productivity without leaving VS Code. Join here — Code Smarter with Cursor AI Editor Learn Cursor AI: Code Smarter and Build Anything with AI 6. Become an Agentic AI Expert For those fascinated by AI agents that can make decisions and work autonomously, this Skill Path is essential. Learn multi-agent systems, prompt engineering, and RAG-powered AI workflows. Join here — Become an Agentic AI Expert Become an Agentic AI Expert - AI-Powered Learning for Developers Why Educative.io is Perfect for Learning AI & LLM Engineering ? Educative stands out because of its text-based, interactive learning platform. Unlike video-heavy platforms, you can learn hands-on without juggling IDEs or local setups. Benefits: * Real-world AI/LLM use cases * Project-based hands-on labs * Structured learning paths curated by experts * Measurable takeaways for career growth And with Educative Unlimited, you get full access to 1200+ courses, including all AI resources, at a fraction of the cost of individual courses. Right now, Educative offers a huge 55% discount on yearly subscriptions, making it an ideal time to invest in your AI career. Here is the link to get discount — Educative.io Unlimited 55% OFF With this subscription model, you can now just pay once and get a full access to every course on Educative. Conclusion AI and LLMs are shaping the future of technology, from development workflows to product strategy. Whether you’re a developer, product manager, or tech leader, mastering AI is no longer optional — it’s essential. Educative.io provides a practical, project-driven learning path to stay ahead of the curve. With its interactive courses, structured skill paths, and the Unlimited subscription, Educative is one of the smartest places to learn AI in 2026. Start your AI journey today — Educative Unlimited Educative Unlimited: Excel with AI-Powered Learning Other Awesome Resources from Educative.io You may like * 5 Best Courses and Projects to Learn AI and ML in 2025 * 5 Projects You can Build to become an AI Engineer * 5 Educative Courses to learn AI and LLM Engineering? * Top 5 Programming Language to Learn in 2025 * 10 Best Tech Interview Prep resources for developers * 10 Best Educative Courses for Software Engineers * 10 Best AWS Labs You can do to Learn Cloud Better * Is Educative Unlimited worth hit? Review * Top 5 Grokking Courses on Educative.io for Cracking Coding Interviews * Top 5 Educative Courses to Take in 2025 * 5 Best Educative.io Courses to Learn Generative AI and ChatGPT in 2024 * 5 Best Educative.io Courses to Learn Cloud Computing in 2025 Thanks for reading this article so far. If you like these AI, ML and LLM Engineering resources from Educative then please share with your friends and colleagues. If you have any questions or suggestions feel free to leave a comment. P. S. — If you are new to AI and LLM Engineering worth then I also suggest you to go through this Machine Learning Handbook and Generative AI Handbook, both are great resources for any who want to learn Artificial Intelligence in depth. Machine Learning Handbook - Free AI-Powered Course --- Review — Is Educative a Good Place to Learn AI and LLM Engineering? was originally published in Javarevisited on Medium, where people are continuing the conversation by highlighting and responding to this story.
dlvr.it