<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by RamkumarMrj on Medium]]></title>
        <description><![CDATA[Stories by RamkumarMrj on Medium]]></description>
        <link>https://medium.com/@RamkumarMrj?source=rss-b98930cfd831------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Kn3dsBWLQkXk336YXb5liw.jpeg</url>
            <title>Stories by RamkumarMrj on Medium</title>
            <link>https://medium.com/@RamkumarMrj?source=rss-b98930cfd831------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 21:16:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@RamkumarMrj/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Stacks and Queues in Python: LIFO, FIFO, and Real-World Examples]]></title>
            <link>https://medium.com/@RamkumarMrj/stacks-and-queues-in-python-lifo-fifo-and-real-world-examples-cbabe12cde90?source=rss-b98930cfd831------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbabe12cde90</guid>
            <category><![CDATA[queue]]></category>
            <category><![CDATA[dsa-problem]]></category>
            <category><![CDATA[stacks-queues]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[RamkumarMrj]]></dc:creator>
            <pubDate>Sat, 28 Mar 2026 19:33:39 GMT</pubDate>
            <atom:updated>2026-03-28T19:33:39.542Z</atom:updated>
            <content:encoded><![CDATA[<h3>From undo/redo to message queues — with priority queues and interview patterns</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Br1K7POlPKP1sfR2Y7ZlCw.png" /><figcaption>DSA Series #3 of 19</figcaption></figure><p><em>Building the Foundations of Programming · DSA Series by RamkumarMrj</em></p><blockquote><em>📚 </em><strong><em>This is Part 3 of 19</em></strong><em> in the complete DSA series — from beginner to expert. Start at Part 1 if you’re new: </em><a href="#"><em>Blog 1 — Introduction to DSA</em></a></blockquote><h3>Introduction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*osYYB80POjO-0KMv0SuUhw.png" /></figure><p>Two of the most interview-tested data structures are stacks and queues. If you have ever pressed Ctrl+Z to undo something, or waited in a booking queue, you have already used these in real life.</p><h3>What is a Stack?</h3><p>A stack follows <strong>LIFO — Last In, First Out</strong>. Think of a stack of plates: you always add and remove from the top.</p><p><strong>Core operations:</strong></p><ul><li>push(item) — add to top: O(1)</li><li>pop() — remove from top: O(1)</li><li>peek() — view top without removing: O(1)</li><li>is_empty() — check if stack is empty: O(1)</li></ul><pre>class Stack:<br>    def __init__(self):<br>        self.stack = []</pre><pre>    def push(self, item):<br>        self.stack.append(item)</pre><pre>    def pop(self):<br>        if not self.is_empty():<br>            return self.stack.pop()<br>        return &#39;Stack is empty&#39;</pre><pre>    def peek(self):<br>        if not self.is_empty():<br>            return self.stack[-1]<br>        return &#39;Stack is empty&#39;</pre><pre>    def is_empty(self):<br>        return len(self.stack) == 0</pre><pre>    def size(self):<br>        return len(self.stack)</pre><pre>s = Stack()<br>s.push(10)<br>s.push(20)<br>s.push(30)<br>print(s.peek())   # 30<br>print(s.pop())    # 30<br>print(s.peek())   # 20<br>print(s.size())   # 2</pre><h3>Real-world example: Undo/Redo system</h3><pre>class TextEditor:<br>    def __init__(self):<br>        self.content = &#39;&#39;<br>        self.undo_stack = Stack()<br>        self.redo_stack = Stack()</pre><pre>    def type(self, text):<br>        self.undo_stack.push(self.content)  # save current state<br>        self.redo_stack = Stack()            # clear redo history<br>        self.content += text</pre><pre>    def undo(self):<br>        if not self.undo_stack.is_empty():<br>            self.redo_stack.push(self.content)<br>            self.content = self.undo_stack.pop()</pre><pre>    def redo(self):<br>        if not self.redo_stack.is_empty():<br>            self.undo_stack.push(self.content)<br>            self.content = self.redo_stack.pop()</pre><pre>editor = TextEditor()<br>editor.type(&#39;Hello&#39;)<br>editor.type(&#39; World&#39;)<br>print(editor.content)   # Hello World<br>editor.undo()<br>print(editor.content)   # Hello<br>editor.redo()<br>print(editor.content)   # Hello World</pre><blockquote><em>💡 Every text editor, IDE, design tool, and browser uses this exact pattern internally. The call stack in Python itself is a stack — that is why you see “stack trace” when there’s an error.</em></blockquote><h3>What is a Queue?</h3><p>A queue follows <strong>FIFO — First In, First Out</strong>. Think of a coffee shop queue: the first person in line is served first.</p><p><strong>Core operations:</strong></p><ul><li>enqueue(item) — add to back: O(1)</li><li>dequeue() — remove from front: O(1)</li><li>front() — view front item: O(1)</li><li>is_empty() — check if empty: O(1)</li></ul><pre>from collections import deque</pre><pre>class Queue:<br>    def __init__(self):<br>        self.queue = deque()</pre><pre>    def enqueue(self, item):<br>        self.queue.append(item)          # add to back</pre><pre>    def dequeue(self):<br>        if not self.is_empty():<br>            return self.queue.popleft()  # remove from front — O(1)<br>        return &#39;Queue is empty&#39;</pre><pre>    def front(self):<br>        return self.queue[0] if not self.is_empty() else None</pre><pre>    def is_empty(self):<br>        return len(self.queue) == 0</pre><pre>    def size(self):<br>        return len(self.queue)</pre><pre>q = Queue()<br>q.enqueue(&#39;Alice&#39;)<br>q.enqueue(&#39;Bob&#39;)<br>q.enqueue(&#39;Charlie&#39;)<br>print(q.front())      # Alice<br>print(q.dequeue())    # Alice<br>print(q.front())      # Bob</pre><blockquote><em>💡 </em><strong><em>Always use </em></strong><strong><em>collections.deque for queues</em></strong><em> — never </em><em>list. Using </em><em>list.pop(0) to dequeue is O(n) because it shifts every element. </em><em>deque.popleft() is O(1).</em></blockquote><h3>Variations you must know</h3><h4>Priority Queue — highest priority served first</h4><pre>import heapq</pre><pre># Smallest number = highest priority (min-heap)<br>pq = []<br>heapq.heappush(pq, (3, &#39;Low priority task&#39;))<br>heapq.heappush(pq, (1, &#39;Critical bug fix&#39;))<br>heapq.heappush(pq, (2, &#39;Feature request&#39;))</pre><pre>while pq:<br>    priority, task = heapq.heappop(pq)<br>    print(f&#39;[{priority}] {task}&#39;)</pre><pre># Output:<br># [1] Critical bug fix<br># [2] Feature request<br># [3] Low priority task</pre><h4>Double-ended Queue (Deque) — add/remove from both ends</h4><pre>from collections import deque</pre><pre>dq = deque()<br>dq.append(10)        # add right<br>dq.appendleft(5)     # add left<br>print(dq)            # deque([5, 10])<br>dq.pop()             # remove right → 10<br>dq.popleft()         # remove left → 5</pre><h4>Complexity summary</h4><p><strong>Stack:</strong></p><ul><li>Push: O(1)</li><li>Pop: O(1)</li><li>Peek: O(1)</li><li>Search: O(n)</li><li>Space: O(n)</li></ul><p><strong>Queue (using deque):</strong></p><ul><li>Enqueue: O(1)</li><li>Dequeue: O(1)</li><li>Front: O(1)</li><li>Search: O(n)</li><li>Space: O(n)</li></ul><blockquote><em>💡 Both stacks and queues are O(1) for their core operations. They are wrappers that restrict access to a list — that restriction is what gives them their power.</em></blockquote><h3>Interview classic: Valid Parentheses (LeetCode #20)</h3><p>This is one of the most common stack interview questions:</p><pre>def is_valid(s: str) -&gt; bool:<br>    stack = []<br>    mapping = {&#39;)&#39;: &#39;(&#39;, &#39;}&#39;: &#39;{&#39;, &#39;]&#39;: &#39;[&#39;}</pre><pre>    for char in s:<br>        if char in mapping:<br>            top = stack.pop() if stack else &#39;#&#39;<br>            if mapping[char] != top:<br>                return False<br>        else:<br>            stack.append(char)</pre><pre>    return not stack</pre><pre>print(is_valid(&#39;()[]{}&#39;))   # True<br>print(is_valid(&#39;(]&#39;))         # False<br>print(is_valid(&#39;{[()]}&#39;))   # True</pre><p><strong>Logic:</strong> For every closing bracket, the top of the stack must be its matching open bracket. If the stack is empty at the end, all brackets were matched.</p><h3>When to use Stack vs Queue</h3><p><strong>Use a Stack when:</strong></p><ul><li>You need to reverse something (undo, backtracking, DFS)</li><li>Processing nested structures (brackets, HTML tags, call stack)</li><li>Browser history navigation</li></ul><p><strong>Use a Queue when:</strong></p><ul><li>Order must be preserved (print jobs, message queues)</li><li>Processing level by level (BFS graph traversal — Part 7)</li><li>Any producer-consumer system</li></ul><h3>Real-world applications</h3><p><strong>Stacks:</strong></p><ul><li>Browser back button (call stack of pages)</li><li>Python’s own function call stack</li><li>Expression evaluation in compilers</li><li>DFS graph traversal (Part 7)</li></ul><p><strong>Queues:</strong></p><ul><li>WhatsApp/Slack message delivery (Kafka, RabbitMQ)</li><li>CPU task scheduling in operating systems</li><li>Uber matching drivers to passengers in order</li><li>BFS graph traversal (Part 7)</li></ul><h3>How to support this series</h3><p>If this helped you, the best thing you can do is:</p><ol><li><strong>Clap 50 times</strong> — it takes 2 seconds and helps Medium show this to more people</li><li><strong>Follow RamkumarMrj</strong> on Medium for the next post in the series</li><li><strong>Share it</strong> — send to one person learning Python or preparing for interviews</li></ol><p><em>Keywords: stack queue Python, stack, queue, python, data-structures, dsa, algorithms, beginners, tutorial</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbabe12cde90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BEYOND THE HYPE: MASTERING AI TO BECOME A MODERN EXPERT]]></title>
            <link>https://medium.com/@RamkumarMrj/beyond-the-hype-mastering-ai-to-become-a-modern-expert-504176966ca8?source=rss-b98930cfd831------2</link>
            <guid isPermaLink="false">https://medium.com/p/504176966ca8</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[RamkumarMrj]]></dc:creator>
            <pubDate>Thu, 10 Jul 2025 12:51:18 GMT</pubDate>
            <atom:updated>2025-07-10T12:51:18.802Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wBQGRE_v1iW-DYxO9-uG8w.jpeg" /><figcaption>MASTERING AI TO BECOME A MODERN EXPERT</figcaption></figure><h3>Introduction Concept:</h3><blockquote>Briefly introduce the pervasive presence of AI in today’s world.</blockquote><blockquote>Hook: AI isn’t just for tech gurus; it’s a powerful tool for anyone to amplify their expertise.</blockquote><blockquote>Thesis: This post will explore practical ways to leverage AI to enhance knowledge, improve decision-making, and become an expert in your field.</blockquote><h3>Section 1: Understanding AI’s Core Capabilities for Expertise</h3><h4>Key Points:</h4><ul><li><strong>Information Synthesis:</strong> How AI can quickly process vast amounts of data (articles, reports, research papers) to extract key insights.</li><li><strong>Pattern Recognition:</strong> Identifying trends, anomalies, and correlations that human experts might miss.</li><li><strong>Predictive Analysis:</strong> Using AI to forecast outcomes based on historical data.</li></ul><h3>Section 2: AI as Your Personal Research Assistant</h3><h4>Key Points:</h4><ul><li><strong>Automated Literature Reviews:</strong> AI tools for summarizing academic papers, patents, and industry reports.</li><li><strong>Intelligent Search and Discovery:</strong> Going beyond basic keywords to find nuanced information and relevant sources.</li><li><strong>Data Aggregation and Curation: </strong>How AI can gather and organize information from disparate sources into a coherent knowledge base.</li></ul><h3>Section 3: Leveraging Al for Enhanced Problem-Solving and Decision-Making</h3><h4>Key Points:</h4><ul><li>Simulations and Modeling: Using AI to test hypotheses and predict outcomes in complex scenarios.</li><li>Scenario Planning: Exploring various possibilities and their potential impacts with AI assistance.</li><li>Bias Detection and Mitigation: How AI can help identify and reduce cognitive biases in human decision-making.</li></ul><h3>Section 4: AI for Knowledge Creation and Communication</h3><h4>Key Points:</h4><ul><li>Content Generation and Refinement: Using AI to draft reports, articles, presentations, or even generate initial ideas.</li><li>Personalized Learning Paths: How AI can tailor learning resources to deepen your expertise in specific areas.</li><li>Translating Complex Information: AI’s ability to simplify intricate topics for diverse audiences.</li></ul><h3>Conclusion Concept:</h3><ul><li>Summarize the transformative power of AI in becoming an expert.</li><li>Reiterate that AI is a tool to augment, not replace, human intelligence and critical thinking.</li><li>Call to Action: Encourage readers to start experimenting with AI tools in their respective fields.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=504176966ca8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building the Foundations of Programming: Linked Lists]]></title>
            <link>https://medium.com/@RamkumarMrj/building-the-foundations-of-programming-linked-lists-7641d6b97cfc?source=rss-b98930cfd831------2</link>
            <guid isPermaLink="false">https://medium.com/p/7641d6b97cfc</guid>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[linked-lists]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[RamkumarMrj]]></dc:creator>
            <pubDate>Thu, 03 Oct 2024 00:31:59 GMT</pubDate>
            <atom:updated>2026-03-28T19:27:34.471Z</atom:updated>
            <content:encoded><![CDATA[<h3>Linked Lists in Python: Singly, Doubly, and Circular</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1VToWMXsu0x5aBobzfVX4w.png" /><figcaption>DSA Series #2 of 19</figcaption></figure><p><strong><em>Complete guide with insertion, deletion, and browser history implementation</em></strong></p><p><em>Building the Foundations of Programming · DSA Series by RamkumarMrj</em></p><h3>Introduction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G5tuHwCw-Qw6m_YRW8OgRQ.png" /></figure><p>A linked list is a linear data structure where elements are <strong>not stored in contiguous memory</strong>. Each element (called a <strong>node</strong>) holds two things: the data, and a pointer to the next node. Think of it like a treasure hunt — each clue tells you where the find the next one.</p><h3>Arrays vs Linked Lists — key differences</h3><p><strong>Array:</strong></p><ul><li>Memory stored contiguously (seats in a row)</li><li>Access by index: O(1) — instant</li><li>Insert at beginning: O(n) — shifts everything right</li><li>Fixed or resized in large blocks</li></ul><p><strong>Linked List:</strong></p><ul><li>Memory scattered, connected by pointers</li><li>Access by index: O(n) — must traverse</li><li>Insert at beginning: O(1) — just change pointer</li><li>Grows and shrinks dynamically</li></ul><blockquote><em>💡 Use arrays when you need fast random access. Use linked lists when you need frequent insertions and deletions, especially at the front.</em></blockquote><h3>Types of linked lists</h3><h4>1. Singly Linked List</h4><p>Each node points only forward to the next node.</p><pre>class Node:<br>    def __init__(self, data):<br>        self.data = data<br>        self.next = None   # pointer to next node</pre><pre>class SinglyLinkedList:<br>    def __init__(self):<br>        self.head = None</pre><pre>    def append(self, data):          # Add to end — O(n)<br>        new_node = Node(data)<br>        if self.head is None:<br>            self.head = new_node<br>            return<br>        current = self.head<br>        while current.next:          # traverse to last node<br>            current = current.next<br>        current.next = new_node</pre><pre>    def prepend(self, data):         # Add to front — O(1)<br>        new_node = Node(data)<br>        new_node.next = self.head<br>        self.head = new_node</pre><pre>    def delete(self, data):          # Delete by value — O(n)<br>        if self.head is None:<br>            return<br>        if self.head.data == data:<br>            self.head = self.head.next<br>            return<br>        current = self.head<br>        while current.next:<br>            if current.next.data == data:<br>                current.next = current.next.next  # skip over it<br>                return<br>            current = current.next</pre><pre>    def print_list(self):<br>        current = self.head<br>        while current:<br>            print(current.data, end=&#39; -&gt; &#39;)<br>            current = current.next<br>        print(&#39;None&#39;)</pre><pre># Example usage<br>ll = SinglyLinkedList()<br>ll.append(10)<br>ll.append(20)<br>ll.append(30)<br>ll.prepend(5)<br>ll.print_list()      # 5 -&gt; 10 -&gt; 20 -&gt; 30 -&gt; None<br>ll.delete(20)<br>ll.print_list()      # 5 -&gt; 10 -&gt; 30 -&gt; None</pre><h4>2. Doubly Linked List</h4><p>Each node has <strong>two pointers</strong>: one to the next node and one to the previous. You can traverse in both directions.</p><pre>class DNode:<br>    def __init__(self, data):<br>        self.data = data<br>        self.next = None<br>        self.prev = None   # NEW: pointer backward</pre><pre>class DoublyLinkedList:<br>    def __init__(self):<br>        self.head = None<br>        self.tail = None   # track tail for O(1) append</pre><pre>    def append(self, data):          # O(1) — tail pointer<br>        new_node = DNode(data)<br>        if self.tail is None:<br>            self.head = self.tail = new_node<br>            return<br>        new_node.prev = self.tail<br>        self.tail.next = new_node<br>        self.tail = new_node</pre><pre>    def prepend(self, data):         # O(1)<br>        new_node = DNode(data)<br>        if self.head is None:<br>            self.head = self.tail = new_node<br>            return<br>        new_node.next = self.head<br>        self.head.prev = new_node<br>        self.head = new_node</pre><pre>    def print_forward(self):<br>        cur = self.head<br>        while cur:<br>            print(cur.data, end=&#39; &lt;-&gt; &#39;)<br>            cur = cur.next<br>        print(&#39;None&#39;)</pre><pre>    def print_backward(self):<br>        cur = self.tail<br>        while cur:<br>            print(cur.data, end=&#39; &lt;-&gt; &#39;)<br>            cur = cur.prev<br>        print(&#39;None&#39;)</pre><pre>dll = DoublyLinkedList()<br>dll.append(10)<br>dll.append(20)<br>dll.append(30)<br>dll.prepend(5)<br>dll.print_forward()    # 5 &lt;-&gt; 10 &lt;-&gt; 20 &lt;-&gt; 30 &lt;-&gt; None<br>dll.print_backward()   # 30 &lt;-&gt; 20 &lt;-&gt; 10 &lt;-&gt; 5 &lt;-&gt; None</pre><h4>3. Circular Linked List</h4><p>The last node’s next pointer points back to the head instead of None. Used in round-robin scheduling, carousels, and game loops.</p><pre>class CircularLinkedList:<br>    def __init__(self):<br>        self.head = None</pre><pre>    def append(self, data):<br>        new_node = Node(data)<br>        if self.head is None:<br>            self.head = new_node<br>            new_node.next = self.head   # points to itself<br>            return<br>        current = self.head<br>        while current.next != self.head:<br>            current = current.next<br>        current.next = new_node<br>        new_node.next = self.head       # close the circle</pre><pre>    def print_list(self, steps=8):<br>        if not self.head:<br>            return<br>        current = self.head<br>        for _ in range(steps):<br>            print(current.data, end=&#39; -&gt; &#39;)<br>            current = current.next<br>        print(&#39;(back to head)&#39;)</pre><pre>cll = CircularLinkedList()<br>cll.append(1)<br>cll.append(2)<br>cll.append(3)<br>cll.print_list()    # 1 -&gt; 2 -&gt; 3 -&gt; 1 -&gt; 2 -&gt; 3 -&gt; ... (back to head)</pre><h3>Real-world application: Browser history</h3><p>A doubly linked list is exactly how browser back/forward navigation works. Each page is a node, and you move through pointers.</p><pre>class BrowserHistory:<br>    def __init__(self, homepage):<br>        self.current = DNode(homepage)</pre><pre>    def visit(self, url):<br>        new_page = DNode(url)<br>        new_page.prev = self.current<br>        self.current.next = new_page   # cut off any forward history<br>        self.current = new_page<br>        print(f&#39;Visited: {url}&#39;)</pre><pre>    def back(self):<br>        if self.current.prev:<br>            self.current = self.current.prev<br>            print(f&#39;Back to: {self.current.data}&#39;)<br>        else:<br>            print(&#39;No previous page&#39;)</pre><pre>    def forward(self):<br>        if self.current.next:<br>            self.current = self.current.next<br>            print(f&#39;Forward to: {self.current.data}&#39;)<br>        else:<br>            print(&#39;No next page&#39;)</pre><pre>browser = BrowserHistory(&#39;google.com&#39;)<br>browser.visit(&#39;medium.com&#39;)<br>browser.visit(&#39;github.com&#39;)<br>browser.back()      # Back to: medium.com<br>browser.back()      # Back to: google.com<br>browser.forward()   # Forward to: medium.com</pre><h3>Complexity reference</h3><p><strong>Singly Linked List:</strong></p><ul><li>Access by index: O(n) — must traverse from head</li><li>Insert at head: O(1) — change head pointer only</li><li>Insert at tail: O(n) — traverse to end first</li><li>Delete at head: O(1)</li><li>Delete in middle: O(n) — find it first, then O(1) to unlink</li><li>Search: O(n)</li><li>Space: O(n)</li></ul><p><strong>Doubly Linked List (extra benefits):</strong></p><ul><li>Insert at tail: O(1) — has tail reference</li><li>Delete at tail: O(1) — has prev reference</li><li>Traverse backwards: possible</li></ul><blockquote><em>💡 Doubly linked lists use roughly 2x memory (two pointers per node) but unlock O(1) tail operations. Worth it when you need bidirectional traversal.</em></blockquote><h3>Real-world applications</h3><ul><li><strong>Image carousels</strong> — circular linked list cycles through images endlessly</li><li><strong>Music players</strong> — singly linked list maintains playlist order</li><li><strong>Browser history</strong> — doubly linked list enables back and forward</li><li><strong>Undo/redo stacks</strong> — can be implemented with a linked list</li><li><strong>OS process scheduling</strong> — circular linked list for round-robin</li></ul><h3>Other linked lists you should know</h3><ul><li><strong>Skip list</strong> — multiple layers of linked lists for faster search (used in Redis)</li><li><strong>XOR linked list</strong> — stores XOR of prev and next addresses to save memory</li><li><strong>Unrolled linked list</strong> — each node holds an array (better cache performance)</li></ul><h3>How to support this series</h3><p>If this helped you, the best thing you can do is:</p><ol><li><strong>Clap 50 times</strong> — it takes 2 seconds and helps Medium show this to more people</li><li><strong>Follow RamkumarMrj</strong> on Medium for the next post in the series</li><li><strong>Share it</strong> — send to one person learning Python or preparing for interviews</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7641d6b97cfc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Data Structures and Algorithms in Python]]></title>
            <link>https://medium.com/@RamkumarMrj/building-the-foundations-of-programming-67432293d0d0?source=rss-b98930cfd831------2</link>
            <guid isPermaLink="false">https://medium.com/p/67432293d0d0</guid>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <dc:creator><![CDATA[RamkumarMrj]]></dc:creator>
            <pubDate>Fri, 05 Jul 2024 09:13:16 GMT</pubDate>
            <atom:updated>2026-03-22T07:19:41.167Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Building the Foundations of Programming · DSA Series by RamkumarMrj</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ViX1snyFAqRja19kyf9rw.png" /><figcaption>DSA Series #1 of 19 : The complete beginner’s guide — with code examples and real-world applications</figcaption></figure><h3>Introduction</h3><p>If you want to write code that works <em>well</em> — not just code that runs — you need to understand <strong>data structures and algorithms for beginners</strong>. DSA is the foundation of every software system you’ve ever used: Google Search, Instagram’s feed, Uber’s routing. In this first post of our 19-part series, we build that foundation clearly and practically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EQGvoqolxW3u9Wb3ZCg0rQ.png" /><figcaption>Introduction to Data Structure Algorithm</figcaption></figure><h3>What are Data Structures?</h3><p>A data structure is a way to organise and store data so it can be accessed and modified efficiently. Think of it like choosing the right container for the right item — you wouldn’t carry soup in a paper bag.</p><p>The main types you will learn in this series:</p><ul><li><strong>Arrays</strong> — ordered list, fixed size, O(1) access by index</li><li><strong>Linked Lists</strong> — chain of nodes, dynamic size (Part 2)</li><li><strong>Stacks &amp; Queues</strong> — restricted access structures (Part 3)</li><li><strong>Hash Tables</strong> — key-value lookup in O(1) (Part 4)</li><li><strong>Trees</strong> — hierarchical data (Part 5)</li><li><strong>Heaps</strong> — sorted trees for priority (Part 6)</li><li><strong>Graphs</strong> — connected nodes and edges (Part 7)</li></ul><h3>What are Algorithms?</h3><p>An algorithm is a step-by-step set of instructions to solve a problem. Every time you sort a list, search for a file, or find the shortest route on Google Maps — an algorithm is running.</p><p>The main algorithm types in this series:</p><ul><li><strong>Sorting</strong> — arranging data in order (Part 9)</li><li><strong>Searching</strong> — finding items efficiently (Part 10)</li><li><strong>Recursion</strong> — functions that call themselves (Part 8)</li><li><strong>Greedy</strong> — make the locally best choice at each step (Part 11)</li><li><strong>Dynamic Programming</strong> — break big problems into smaller solved ones (Part 13)</li></ul><h3>Why does DSA matter?</h3><p>Every major tech company uses DSA every single day. And every technical interview at Google, Meta, Amazon, and Microsoft tests DSA directly.</p><p>Here is the practical difference it makes:</p><ul><li><strong>Without DSA:</strong> Loop through 1 million records every search — slow</li><li><strong>With DSA:</strong> Hash table lookup — instant O(1)</li><li><strong>Without DSA:</strong> Sort data every time using O(n²) bubble sort</li><li><strong>With DSA:</strong> Merge sort once — O(n log n)</li><li><strong>Without DSA:</strong> Code that works for 100 users crashes at 1 million</li><li><strong>With DSA:</strong> Scalable by design from the start</li></ul><h3>Big O Notation — your first essential tool</h3><p>Big O notation tells you how your code scales as input grows. This is the single most important concept before writing any DSA code.</p><pre>Notation    Name            1000 items requires...<br>O(1)        Constant        Same as 10 items — hash lookup<br>O(log n)    Logarithmic     ~10 steps — binary search<br>O(n)        Linear          1,000 steps — loop through list<br>O(n log n)  Log-linear      ~10,000 steps — merge sort<br>O(n²)       Quadratic       1,000,000 steps — nested loop<br>O(2ⁿ)       Exponential     Effectively forever — avoid!</pre><blockquote><em>💡 Rule of thumb: the smaller the Big O, the faster the code scales. We cover this deeply in Part 18.</em></blockquote><h3>Python code: your first data structures</h3><h4>Arrays (Python calls them lists)</h4><pre># Create an array<br>my_array = [10, 20, 30, 40, 50]</pre><pre># Access by index — O(1) always<br>print(my_array[0])    # 10<br>print(my_array[-1])   # 50 (last item)</pre><pre># Modify — O(1)<br>my_array[0] = 99<br>print(my_array)       # [99, 20, 30, 40, 50]</pre><pre># Add to end — O(1) amortised<br>my_array.append(60)</pre><pre># Search — O(n) must check each element<br>print(30 in my_array)   # True<br>print(my_array.index(30))  # 2</pre><h4>Your first algorithm: Bubble Sort</h4><pre>def bubble_sort(arr):<br>    n = len(arr)<br>    for i in range(n - 1):<br>        for j in range(n - i - 1):<br>            if arr[j] &gt; arr[j + 1]:<br>                arr[j], arr[j + 1] = arr[j + 1], arr[j]  # swap<br>    return arr</pre><pre>numbers = [64, 34, 25, 12, 22, 11, 90]<br>print(bubble_sort(numbers))<br># Output: [11, 12, 22, 25, 34, 64, 90]</pre><pre># This is O(n²) — good for learning, not for production</pre><h4>Python’s built-in sort — Timsort O(n log n)</h4><pre>numbers = [64, 34, 25, 12, 22, 11, 90]</pre><pre>numbers.sort()                  # in-place sort<br>print(numbers)                  # [11, 12, 22, 25, 34, 64, 90]</pre><pre>sorted_numbers = sorted(numbers)  # returns new list, original unchanged</pre><blockquote><em>💡 Always prefer Python’s built-in </em><em>sorted() or </em><em>.sort() in production — it uses Timsort which is O(n log n) and highly optimised</em></blockquote><h3>Real-world DSA in action</h3><ul><li><strong>Google Search</strong> uses tries and inverted indices (Part 16) to return results in milliseconds across billions of pages</li><li><strong>Instagram’s feed</strong> uses graph algorithms (Part 7) to decide what you see based on who you follow</li><li><strong>Uber</strong> uses Dijkstra’s algorithm (Part 15) to find the shortest route from driver to passenger</li><li><strong>WhatsApp</strong> uses queues (Part 3) to deliver messages in order even when your connection drops</li><li><strong>Spotify’s Discover Weekly</strong> uses dynamic programming patterns (Part 13) to find similar songs</li></ul><h3>How to use this series</h3><ol><li><em>Read each post in order — every blog builds on the previous one</em></li><li><strong><em>Type out every code example yourself</em></strong><em> — do not just read it</em></li><li><em>After each blog, go to LeetCode and search the topic — solve 2 easy problems</em></li><li><em>Come back and re-read the blog after solving problems — it will click differently</em></li><li><em>By Part 19, you will have a complete DSA cheat sheet ready for interviews</em></li></ol><h3>Series overview</h3><ul><li><strong><em>Part 1 — Intro to DSA</em></strong><em> ← you are here</em></li><li><em>Part 2 — Linked Lists</em></li><li><em>Part 3 — Stacks &amp; Queues</em></li><li><em>Part 4 — Hash Tables</em></li><li><em>Part 5 — Trees &amp; BST</em></li><li><em>Part 6 — Heaps &amp; Priority Queues</em></li><li><em>Part 7 — Graphs: BFS &amp; DFS</em></li><li><em>Part 8 — Recursion</em></li><li><em>Part 9 — Sorting Algorithms</em></li><li><em>Part 10 — Searching Algorithms</em></li><li><em>Part 11 — Greedy Algorithms</em></li><li><em>Part 12 — Divide &amp; Conquer</em></li><li><em>Part 13 — Dynamic Programming</em></li><li><em>Part 14 — Backtracking</em></li><li><em>Part 15 — Advanced Graph Algorithms</em></li><li><em>Part 16 — Trie &amp; Segment Tree</em></li><li><em>Part 17 — Bit Manipulation</em></li><li><em>Part 18 — Big O Deep Dive</em></li><li><em>Part 19 — Interview Prep &amp; Cheat Sheet</em></li></ul><h3>How to support this series</h3><p><em>If this helped you, the best thing you can do is:</em></p><ol><li><strong><em>Clap 50 times</em></strong><em> — it takes 2 seconds and helps Medium show this to more people</em></li><li><strong><em>Follow RamkumarMrj</em></strong><em> on Medium for the next post in the series</em></li><li><strong><em>Share it</em></strong><em> — send to one person learning Python or preparing for interviews</em></li></ol><p><em>Keywords: data structures and algorithms for beginners, python, dsa, beginners, programming, tutorial, software-development</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67432293d0d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dockerizing front end as angular and back end as flask]]></title>
            <link>https://medium.com/@RamkumarMrj/dockerizing-front-end-as-angular-and-back-end-as-flask-1e944a0ed77?source=rss-b98930cfd831------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e944a0ed77</guid>
            <category><![CDATA[angularjs]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[flask-framework]]></category>
            <category><![CDATA[hosting]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <dc:creator><![CDATA[RamkumarMrj]]></dc:creator>
            <pubDate>Tue, 01 Aug 2023 05:47:15 GMT</pubDate>
            <atom:updated>2023-08-01T05:47:15.294Z</atom:updated>
            <content:encoded><![CDATA[<h3>Dockerizing Front End as Angular and Back End as Flask</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s1C-RKi_OfXiQ2hOtkEieg.png" /></figure><p><em>Docker is an excellent tool for containerizing applications, providing portability and ease of deployment. In this blog post, we will guide you through the process of dockerizing a front end using Angular and a back end using Flask.</em></p><h4>Installing Docker on Windows and Linux</h4><p><strong>For Windows:</strong></p><ol><li>Visit the Docker website: <a href="https://docs.docker.com/desktop/install/windows-install/">docs.docker.com</a> and download the 64-bit installer for Windows.</li><li>Run the installer and follow the installation instructions.</li></ol><p><strong>For Linux:</strong></p><ol><li>Go to the Docker website: <a href="https://docs.docker.com/desktop/install/linux-install/">docs.docker.com</a> and select the documentation for your Linux distribution.</li><li>Follow the instructions provided to install Docker on your system.</li></ol><blockquote>Once the installation is complete, open a terminal and run the following command to ensure Docker is installed correctly:</blockquote><blockquote>docker run hello-world</blockquote><p>Before we dive into Dockerizing the applications, let’s quickly review some basic Docker commands:</p><ol><li>docker run: This command creates a new container from a Docker image.</li><li>docker build: This command builds an image from a Dockerfile.</li><li>docker images: This command lists all available images on your system.</li><li>docker ps: This command lists all running containers on your system.</li><li>docker stop: This command stops a running container.</li><li>docker start: This command starts a stopped container.</li><li>docker remove: This command removes a container.</li></ol><h3>Dockerizing Flask and Angular</h3><p>To complete the Dockerization process and enable running the Flask and Angular applications on HTTPS port using Nginx, we need to add build and run commands for both Flask and Angular, along with the Nginx configuration.</p><p>Assuming you have the following project structure:</p><pre>project/<br> ├── backend/<br> │ ├── Dockerfile<br> │ ├── app.py<br> │ └── requirements.txt<br> ├── frontend/<br> │ ├── Dockerfile<br> │ ├── package.json<br> │ ├── server.js<br> │ └── (other Angular files)<br> └── nginx/<br> └── nginx.conf</pre><h4>Dockerfile Configuration for Flask</h4><p>To create a Docker image for a Flask application, you can use the following Dockerfile:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/59deaadb3bafa21100277e578c6ab3a3/href">https://medium.com/media/59deaadb3bafa21100277e578c6ab3a3/href</a></iframe><p><strong>Explanation:</strong></p><ul><li>The FROM instruction specifies the base image, which includes Python 3.8 installed in a slim environment.</li><li>The WORKDIR instruction sets the working directory to /app within the container.</li><li>The COPY instruction copies the requirements.txt file to the container&#39;s working directory.</li><li>The RUN instruction installs the Python dependencies specified in requirements.txt.</li><li>The second COPY instruction copies the app.py file to the container&#39;s working directory.</li><li>Finally, the CMD instruction tells Docker to execute the app.py file when the container starts.</li></ul><p><strong>Build and Run Commands for Flask:</strong></p><pre># Build Flask Docker Image<br>docker build -t my_flask_app backend/<br><br># Run Flask Docker Container<br>docker run -d - name flask_app -p 5000:5000 my_flask_app</pre><h4>Nginx Configuration :</h4><p>To create certificates and keys for HTTPS, you can use OpenSSL, a widely used and open-source cryptographic toolkit. Below are the commands to generate a self-signed certificate and key:</p><ul><li>Generate a private key:</li></ul><pre>openssl genpkey -algorithm RSA -out server.key</pre><p>This will generate a new private key and save it in the file server.key.</p><ul><li>Create a certificate signing request (CSR):</li></ul><pre>openssl req -new -key server.key -out server.csr</pre><p>You will be prompted to enter some information about your organization and the server. You can leave the “Challenge Password” field empty.</p><ul><li>Generate a self-signed certificate:</li></ul><pre>openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt</pre><p>This will create a self-signed certificate and save it in the file server.crt. The certificate is valid for 365 days (-days 365), but you can adjust this value as needed.</p><p>After running these commands, you will have the following files:</p><ul><li>server.key: The private key.</li><li>server.csr: The certificate signing request.</li><li>server.crt: The self-signed certificate.</li></ul><blockquote>Please note that self-signed certificates are suitable for testing and development purposes but not recommended for production environments. In production, you should obtain SSL certificates from a trusted Certificate Authority (CA) to ensure security and avoid browser warnings for your users.</blockquote><h4>nginx.conf</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b4e30062083a331d6555c98798e406ac/href">https://medium.com/media/b4e30062083a331d6555c98798e406ac/href</a></iframe><h4>Dockerfile Configuration for Angular</h4><p>To create a Docker image for an Angular application, you can use the following Dockerfile:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b50e198d862c4a99c525472df2f80894/href">https://medium.com/media/b50e198d862c4a99c525472df2f80894/href</a></iframe><p><strong>Explanation:</strong></p><ul><li><strong><em>The first</em></strong> FROM instruction specifies the base image for the build stage, which is Node.js 16 with Alpine Linux. This base image contains a minimal Linux distribution, making it lightweight and suitable for development and production use.</li><li>WORKDIR sets the working directory inside the container to /app, which is where the Angular application will be built.</li><li>COPY package.json ./ copies the package.json file from the local project directory into the container&#39;s working directory.</li><li>RUN npm install installs the Node.js dependencies listed in the package.json file inside the container.</li><li>The next COPY instruction copies the entire Angular application source code (including all files and folders) into the container&#39;s working directory.</li><li>RUN npm run build executes the build script defined in the package.json file, which creates a production build of the Angular application inside the container.</li><li><strong><em>The second</em></strong> FROM instruction specifies the base image for the final stage, which is Nginx with Alpine Linux. This base image provides a lightweight and high-performance web server for serving static content.</li><li>COPY --from=builder /app/dist /usr/share/nginx/html copies the contents of the dist folder (the production build of the Angular application) from the previous build stage (the Node.js-based builder) into the default web server directory of Nginx (/usr/share/nginx/html). This is where Nginx serves the static files of the Angular application.</li><li>COPY ./nginx/nginx.conf /etc/nginx/conf.d/default.conf copies the custom Nginx configuration (located in the nginx directory of the local project) into the container. This configuration file is used to set up the server block for handling requests and enabling HTTPS (if configured).</li><li>EXPOSE 80 and EXPOSE 443 are used to specify that the container will listen on ports 80 and 443, allowing these ports to be accessible from the host machine.</li><li>CMD [&quot;nginx&quot;, &quot;-g&quot;, &quot;daemon off;&quot;] is the command that starts Nginx in the container. The -g &quot;daemon off;&quot; option ensures that Nginx runs in the foreground so that the Docker container doesn&#39;t exit immediately.</li></ul><p><strong>Build and Run Commands for Angular:</strong></p><pre># Build Angular Docker Image<br>docker build -t my_angular_app frontend/<br><br># Run Angular Docker Container with HTTPS port mapped to 443<br>docker run -d - name angular_app -p 80:80 -p 443:443 my_angular_app</pre><h4><strong>Reverse Proxy</strong>: Managing incoming traffic and routing requests to multiple backend services.</h4><ol><li><strong>Serving Angular</strong>: Efficiently serving static files of Angular applications.</li><li><strong>HTTPS Support</strong>: Handling SSL termination and enabling secure HTTPS communication.</li><li><strong>Load Balancing</strong>: Distributing incoming requests across multiple service instances.</li><li><strong>Customizable Routing</strong>: Defining custom routes and rules for handling specific URLs or requests.</li><li><strong>Improved Performance</strong>: Efficiently handling large numbers of concurrent connections with minimal resource usage.</li></ol><p>With these configurations, the Angular application will be served by Nginx on both HTTP and HTTPS ports (80 and 443, respectively). The Flask application will be running on port 5000 inside its Docker container.</p><p>Please ensure that you have valid SSL certificates (certificate.crt and certificate.key) if you want to use HTTPS. Also, don&#39;t forget to replace /path/to/ssl/ with the actual path to the SSL certificates on your system.</p><blockquote>With the provided Dockerfile configurations, you can now containerize your Angular front end and Flask back end applications effortlessly. This will enable you to deploy your applications consistently and efficiently across different environments, ensuring seamless delivery to end-users.</blockquote><blockquote>🥳 Happy Dockerizing!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e944a0ed77" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create EC2 M1 Mac instances for macOS]]></title>
            <link>https://medium.com/@RamkumarMrj/create-ec2-m1-mac-instances-for-macos-1cb9ea962b18?source=rss-b98930cfd831------2</link>
            <guid isPermaLink="false">https://medium.com/p/1cb9ea962b18</guid>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[vnc-viewer]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[m1-chip]]></category>
            <dc:creator><![CDATA[RamkumarMrj]]></dc:creator>
            <pubDate>Wed, 20 Jul 2022 12:32:56 GMT</pubDate>
            <atom:updated>2022-07-27T11:15:36.050Z</atom:updated>
            <content:encoded><![CDATA[<h3>Create an EC2 M1 Mac instances for macOS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*buBntGkOMwBruLcrH5fVPg.jpeg" /><figcaption>AWS EC2 M1 Mac instance</figcaption></figure><h3><strong>EC2 M1 Mac instances are now generally available!</strong></h3><p>Last year <a href="https://reinvent.awsevents.com/">re:Invent</a> 2021 conference AWS EC2 Mac team announced that preview of a new <a href="https://aws.amazon.com/blogs/aws/use-amazon-ec2-m1-mac-instances-to-build-test-macos-ios-ipados-tvos-and-watchos-apps/">EC2 M1 Mac instance</a> to Build &amp; Test Apps for iPhone, iPad, Mac, Apple Watch, and Apple TV. — o<em>n 30 November, 2020, AWS announced that intel CPU(mac1.metal) based EC2 macOS instance.</em></p><p>Now the team officially announced the <em>general availability (GA) of </em><a href="https://aws.amazon.com/blogs/aws/new-amazon-ec2-m1-mac-instances"><em>Amazon EC2 M1 Mac instances for macOS</em></a><em>. — on July 07, 2022, M1 Mac EC2 arrived, i.e., mac2.metal is available in particular regions only.</em></p><h3>How to Launch an AWS EC2 M1 Mac Instance (macOS)</h3><p>Firstly, these instance types must be launched onto<strong> </strong><a href="https://aws.amazon.com/ec2/dedicated-hosts"><strong>Dedicated Hosts</strong></a><strong> </strong>because these are physical Apple Mac minis. <a href="https://aws.amazon.com/blogs/aws/new-amazon-ec2-m1-mac-instances/">EC2 M1 Mac instances</a> are available in the US East (N. Virginia), US West (Oregon), Europe (Dublin), and Asia Pacific (Singapore) AWS Regions, with additional Regions coming soon.</p><blockquote><strong>Note: </strong>On-Demand EC2 Mac Dedicated Hosts have a minimum host allocation and <a href="https://aws.amazon.com/ec2/dedicated-hosts/pricing">billing</a> duration of 24 hours.</blockquote><p><em>For dedicated hosts, there are three </em><a href="https://aws.amazon.com/ec2/dedicated-hosts/pricing"><em>pricing models</em></a><em> to choose from: on-demand pricing, reservation pricing, and a savings plan. For On-Demand, you pay for each second. pricing for mac2 is $0.65 per hr. and mac1 is $1.083 per hr.</em></p><h3><strong>Create Dedicated host for Mac Instance</strong></h3><ul><li>Log in to AWS Console, type EC2 into the search bar (Alt+S), and then choose <em>Dedicated Hosts</em> from the left side menu.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pl-rvfDjGMLSgEkVRTF5uA.png" /><figcaption>EC2 Dedicated Hosts</figcaption></figure><ul><li>Select a region and click the ‘<em>Allocate Dedicated Host’ </em>button.</li><li>For the Dedicated Host Settings page, select the following as input:<br> - <em>Instance family: mac1 <br> - Instance type: </em><a href="https://aws.amazon.com/about-aws/whats-new/2022/07/general-availability-amazon-ec2-m1-mac-instances-macos/"><em>mac2.metal</em></a><em> (available in a particular region only).<br> - Quantity: 1<br> - Name and Availability Zone: Your choice.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IjgLfS10cTeIRt8GL8W-Kw.png" /><figcaption>Allocating a Dedicated Host</figcaption></figure><ul><li>Click ‘<em>Allocate</em>’ or use the CLI command.<strong>🎉</strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1aa357634df9fc3bcc752ee03eb71e1d/href">https://medium.com/media/1aa357634df9fc3bcc752ee03eb71e1d/href</a></iframe><blockquote><strong>Note:</strong> If you face the below error during the allocation of a dedicated host, it means your account doesn’t have a request quota value.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*V7a8OQ9kGYJLN1bZw-61SA.png" /><figcaption>Error message: Exceeded the current request limit</figcaption></figure><p><strong>To solve this problem, request the quota to increase the limit.</strong></p><ul><li>In AWS console Search for <a href="https://ap-south-1.console.aws.amazon.com/servicequotas/home/"><strong><em>Service Quotas</em></strong></a><strong><em>.</em></strong></li><li>Select <em>Amazon Elastic Compute Cloud</em> in the Service quota dashboard.</li><li>Locate and select ‘<em>Running Dedicated mac1 Hosts.’</em></li><li>Under the recent quota increase requests, choose the ‘<em>Request quota increase’</em> button on the right side corner.</li><li>Enter the total amount that you want the quota to be (<em>value as 1</em>) and click <em>‘Request’</em>.</li></ul><blockquote>It may take 3–5 days, but remember the region and the request value must be a number greater than your current quota value.</blockquote><h3><strong>Steps to create an EC2 M1 Mac Instance (macOS)</strong></h3><p>In the previous steps, we successfully created a <em>Dedicated Host</em> for an EC2 M1 Mac Instance. Now, we need to <strong>Launch a Mac Instance</strong>. For that, follow the below steps:</p><ul><li>Go to EC2 service console</li><li>Under instances, click Launch Instances.</li><li>Choose an Amazon Machine Image (AMI) and click next.<br><em>Supported Operating Systems are(2022):<br> - macOS Monterey 12.4–64-bit (Mac)<br> - macOS Big Sur 11.6.6–64-bit (Mac)<br> - macOS Catalina 10.15.7–64-bit (Mac)</em></li><li>Choose an Instance family as mac1 and mac2.metal (verify the region you have selected) and click next.</li><li>Select Dedicated Host that we have already created and click Next.</li><li>Add storage you can leave it as is or increase the volume size.</li><li>Add the tag and click Next.</li><li>In security configuration, we need two rules. <strong><em>Custom TCP Rule</em></strong><em>(port range: 5900) </em>and<em> </em><strong><em>SSH </em></strong><em>(port range: 22) </em>select <strong><em>My IP</em></strong> as source.</li><li>Click to Review and Launch. Choose existing keypair or create a new one, then click Launch Instances.</li></ul><blockquote>SSH for CLI login and to change the password for the default user<br>Custom TCP protocol for VNC connection</blockquote><p><strong>Connect Mac Instance using VNC Viewer</strong></p><ul><li>Download the <a href="https://www.realvnc.com/en/connect/download/viewer">VNC Viewer</a> software and install it on your local machine.</li><li>In the EC2 Instance console, select the Mac instance and click Connect.</li><li>Navigate to the SSH tab. Read the instructions and copy the SSH public DNS command.</li><li>On your local machine, launch PowerShell and change directory to the keyPair file location and paste the SSH command. <br>Ex: ssh -i “macKeyPair.pem” ec2-use@[DNS Name]</li><li>To start VNC, type the below command in PowerShell.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/53de0c6158240337e2c18b5a4a624a55/href">https://medium.com/media/53de0c6158240337e2c18b5a4a624a55/href</a></iframe><ul><li>In VNC Viewer, create a New Connection, enter the public IP address of the Mac Instance and click Connect -&gt; Continue to Insecure Connection.</li><li>Enter your username and password, then click OK to launch <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-mac-instances.html">macOS</a>. 🎉</li></ul><h3>Things to remember:</h3><ul><li>Verify the regions and <a href="https://calculator.aws/#/addService/EC2DedicatedHosts">estimate the total cost</a> before the allocation of <em>Dedicated Hosts</em> and creation of <em>Instances</em>.</li><li>Terminate billing for any specific On-Demand Dedicated Host as soon as possible by releasing it.💰</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1cb9ea962b18" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>