<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Daniyal Haider</title>
    <description>The latest articles on DEV Community by Daniyal Haider (@daniyalhaider99).</description>
    <link>https://dev.to/daniyalhaider99</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1770867%2F6bb467cd-f368-4848-99d9-f7f39d9f1f7a.jpg</url>
      <title>DEV Community: Daniyal Haider</title>
      <link>https://dev.to/daniyalhaider99</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/daniyalhaider99"/>
    <language>en</language>
    <item>
      <title>Prepare for Your Technical Interview: Common Git Questions to Expect</title>
      <dc:creator>Daniyal Haider</dc:creator>
      <pubDate>Wed, 18 Dec 2024 12:38:49 +0000</pubDate>
      <link>https://dev.to/daniyalhaider99/prepare-for-your-technical-interview-common-git-questions-to-expect-37ni</link>
      <guid>https://dev.to/daniyalhaider99/prepare-for-your-technical-interview-common-git-questions-to-expect-37ni</guid>
      <description>&lt;p&gt;Git is an essential tool for version control and collaboration in software development. Employers often evaluate candidates’ proficiency with Git to ensure they can handle branching, merging, and troubleshooting version control issues in real-world scenarios. To assist with your interview prep, here’s a curated list of common Git interview questions you should be ready to answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Level
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;What is Git?&lt;/li&gt;
&lt;li&gt;What is the difference between Git and GitHub?&lt;/li&gt;
&lt;li&gt;What is a repository in Git?&lt;/li&gt;
&lt;li&gt;What is the difference between a local and a remote repository?&lt;/li&gt;
&lt;li&gt;What is a commit in Git?&lt;/li&gt;
&lt;li&gt;What is the purpose of the git init command?&lt;/li&gt;
&lt;li&gt;How do you check the status of a repository in Git?&lt;/li&gt;
&lt;li&gt;What is the staging area in Git?&lt;/li&gt;
&lt;li&gt;What is the difference between git pull and git fetch?&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Intermediate Level
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;What is a branch in Git?&lt;/li&gt;
&lt;li&gt;What is the difference between git merge and git rebase?&lt;/li&gt;
&lt;li&gt;How do you resolve merge conflicts in Git?&lt;/li&gt;
&lt;li&gt;What is a git clone and when would you use it?&lt;/li&gt;
&lt;li&gt;What is the .gitignore file used for?&lt;/li&gt;
&lt;li&gt;What is a commit hash in Git?&lt;/li&gt;
&lt;li&gt;What does the git log command do?&lt;/li&gt;
&lt;li&gt;What is a detached HEAD state in Git?&lt;/li&gt;
&lt;li&gt;What is a fast-forward merge in Git?&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Advanced Level
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;What is the difference between git reset and git revert?&lt;/li&gt;
&lt;li&gt;Explain the concept of cherry pick.&lt;/li&gt;
&lt;li&gt;How do you squash commits in Git?&lt;/li&gt;
&lt;li&gt;How do you change the commit message of the last commit in Git?&lt;/li&gt;
&lt;li&gt;What are Git submodules and when would you use them?&lt;/li&gt;
&lt;li&gt;What is the difference between git stash and git commit?&lt;/li&gt;
&lt;li&gt;How would you view and recover a deleted branch in Git?&lt;/li&gt;
&lt;li&gt;What is an orphan branch in Git?&lt;/li&gt;
&lt;li&gt;What is the purpose of git rebase -i (interactive rebase)?&lt;/li&gt;
&lt;li&gt;How do you handle large binary files in Git?&lt;/li&gt;
&lt;li&gt;Explain the concept of Git hooks.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Expert Level
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;What is Git flow, and how does it differ from GitHub flow?&lt;/li&gt;
&lt;li&gt;Explain how Git works under the hood (SHA-1, objects, and refs).&lt;/li&gt;
&lt;li&gt;How does Git handle conflicts when merging binary files?&lt;/li&gt;
&lt;li&gt;What are reflogs and how are they useful?&lt;/li&gt;
&lt;li&gt;How would you resolve issues caused by a rebase (such as loss of commits or conflicts)?&lt;/li&gt;
&lt;li&gt;What is the git bisect command and how does it work?&lt;/li&gt;
&lt;li&gt;How do you implement continuous integration (CI) with Git?&lt;/li&gt;
&lt;li&gt;What is the purpose of a bare repository in Git?&lt;/li&gt;
&lt;li&gt;How do you deal with large-scale repositories in Git?&lt;/li&gt;
&lt;li&gt;What are Git workflows?&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>git</category>
      <category>learning</category>
      <category>github</category>
      <category>gitlab</category>
    </item>
    <item>
      <title>Essential OOP/Database/Data Structures Interview Questions for Developers</title>
      <dc:creator>Daniyal Haider</dc:creator>
      <pubDate>Wed, 18 Dec 2024 12:20:13 +0000</pubDate>
      <link>https://dev.to/daniyalhaider99/essential-oopdatabasedata-structures-interview-questions-for-developers-480p</link>
      <guid>https://dev.to/daniyalhaider99/essential-oopdatabasedata-structures-interview-questions-for-developers-480p</guid>
      <description>&lt;p&gt;Preparing for software developer interviews often means tackling questions from a variety of domains, including Object-Oriented Programming (OOP), Databases (DB), and Data Structures and Algorithms (DSA). These topics are fundamental to building scalable and efficient software systems, and mastering them can set you apart in the hiring process. Here’s a collection of commonly asked questions across these areas to help you sharpen your knowledge and practice effectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Object-Oriented Programming (OOP)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Basic Questions
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;What are the four main principles of Object-Oriented Programming?&lt;/li&gt;
&lt;li&gt;Define a class and an object with an example.&lt;/li&gt;
&lt;li&gt;What is inheritance? Give an example of single and multiple inheritance.&lt;/li&gt;
&lt;li&gt;What is polymorphism? Explain compile-time and runtime polymorphism.&lt;/li&gt;
&lt;li&gt;Explain the concept of abstraction. How is it implemented in programming?&lt;/li&gt;
&lt;li&gt;What is encapsulation? How does it help in protecting data?&lt;/li&gt;
&lt;li&gt;What is the difference between an interface and an abstract class?&lt;/li&gt;
&lt;li&gt;Define method overloading and method overriding with examples.&lt;/li&gt;
&lt;li&gt;What are access specifiers? Explain public, private, and protected.&lt;/li&gt;
&lt;li&gt;What is a constructor? How is it different from a regular method?&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Intermediate Questions
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Explain the difference between inheritance and composition.&lt;/li&gt;
&lt;li&gt;What is the difference between a shallow and deep copy?&lt;/li&gt;
&lt;li&gt;What is the purpose of a static method and static variables?&lt;/li&gt;
&lt;li&gt;Explain the difference between "is-a" and "has-a" relationships.&lt;/li&gt;
&lt;li&gt;What are design patterns? Name a few common ones used in OOP.&lt;/li&gt;
&lt;li&gt;How does multiple inheritance work? &lt;/li&gt;
&lt;li&gt;What is the purpose of the super keyword in inheritance?&lt;/li&gt;
&lt;li&gt;Explain the SOLID principles of OOP.&lt;/li&gt;
&lt;li&gt;What is a virtual function? How is it used?&lt;/li&gt;
&lt;li&gt;What is the concept of garbage collection in OOP?&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Expert Questions
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;How would you implement a Singleton Design Pattern?&lt;/li&gt;
&lt;li&gt;What are mixins? How do they differ from inheritance?&lt;/li&gt;
&lt;li&gt;What is dependency injection? Why is it used in object-oriented design?&lt;/li&gt;
&lt;li&gt;Explain the concept of method dispatch and its types (static vs dynamic).&lt;/li&gt;
&lt;li&gt;How would you optimize a large OOP-based system for scalability?&lt;/li&gt;
&lt;li&gt;Compare and contrast functional programming with OOP.&lt;/li&gt;
&lt;li&gt;What are the limitations of OOP? How would you overcome them?&lt;/li&gt;
&lt;li&gt;Explain metaprogramming and its significance in languages.&lt;/li&gt;
&lt;li&gt;Discuss the pros and cons of inheritance vs composition.&lt;/li&gt;
&lt;li&gt;How would you refactor a monolithic OOP codebase into a modular one?&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Database
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Basic Questions
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;What is a database? Explain the difference between SQL and NoSQL databases.&lt;/li&gt;
&lt;li&gt;Define a primary key, foreign key, and unique key.&lt;/li&gt;
&lt;li&gt;What are indexes? How do they improve query performance?&lt;/li&gt;
&lt;li&gt;What is normalization? Explain the first, second, and third normal forms.&lt;/li&gt;
&lt;li&gt;What are the differences between DELETE, TRUNCATE, and DROP?&lt;/li&gt;
&lt;li&gt;What is a JOIN in SQL? Explain the types of joins.&lt;/li&gt;
&lt;li&gt;Define ACID properties in database transactions.&lt;/li&gt;
&lt;li&gt;What is a view in SQL? How is it different from a table?&lt;/li&gt;
&lt;li&gt;What is a stored procedure? How is it different from a trigger?&lt;/li&gt;
&lt;li&gt;What is a database schema?&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Intermediate Questions
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Explain the differences between relational and non-relational databases.&lt;/li&gt;
&lt;li&gt;How do you optimize a SQL query? Name some techniques.&lt;/li&gt;
&lt;li&gt;What is a foreign key constraint, and why is it important?&lt;/li&gt;
&lt;li&gt;Explain the difference between a clustered and non-clustered index.&lt;/li&gt;
&lt;li&gt;What is database sharding? When is it used?&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Data Structures
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Basic Questions
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;What is a data structure? Why is it important?&lt;/li&gt;
&lt;li&gt;What is the difference between an array and a linked list?&lt;/li&gt;
&lt;li&gt;What is a stack? How is it used?&lt;/li&gt;
&lt;li&gt;What is a queue? How is it different from a stack?&lt;/li&gt;
&lt;li&gt;What is a linked list? How is it different from an array?&lt;/li&gt;
&lt;li&gt;What are the types of linked lists?&lt;/li&gt;
&lt;li&gt;What is a binary tree?&lt;/li&gt;
&lt;li&gt;What is a hash table?&lt;/li&gt;
&lt;li&gt;What are the differences between linear and non-linear data structures?&lt;/li&gt;
&lt;li&gt;What is a heap? How is it different from a binary tree?&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Intermediate Questions
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;What is the time complexity of inserting an element into a binary search tree (BST)?&lt;/li&gt;
&lt;li&gt;Explain the difference between depth-first search (DFS) and breadth-first search (BFS).&lt;/li&gt;
&lt;li&gt;What is the purpose of a priority queue, and how is it implemented?&lt;/li&gt;
&lt;li&gt;What is a graph? What are the different types of graphs?&lt;/li&gt;
&lt;li&gt;What is a Trie (Prefix Tree)? How is it used?&lt;/li&gt;
&lt;li&gt;What is dynamic programming? How does it relate to recursion?&lt;/li&gt;
&lt;li&gt;What is a balanced binary search tree? Name a few types.&lt;/li&gt;
&lt;li&gt;Explain the concept of hashing and hash collision. How can collisions be handled?&lt;/li&gt;
&lt;li&gt;What is a circular queue? How does it work?&lt;/li&gt;
&lt;li&gt;What is a set data structure? How is it different from a list?&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Expert Questions
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;What are B- trees and B+ trees? How do they differ from binary search trees?&lt;/li&gt;
&lt;li&gt;Explain the concept of a Bloom filter. What are its advantages and disadvantages?&lt;/li&gt;
&lt;li&gt;What is the difference between a depth-first traversal and a breadth-first traversal in a graph?&lt;/li&gt;
&lt;li&gt;What is the time complexity of various operations in a hash table (insert, delete, search)?&lt;/li&gt;
&lt;li&gt;How would you detect a cycle in a directed graph?&lt;/li&gt;
&lt;li&gt;What is the difference between a greedy algorithm and dynamic programming?&lt;/li&gt;
&lt;li&gt;Explain how a red-black tree works. What are its properties?&lt;/li&gt;
&lt;li&gt;What is the purpose of a disjoint-set (union-find) data structure?&lt;/li&gt;
&lt;li&gt;What is a topological sort, and when is it used?&lt;/li&gt;
&lt;li&gt;What is a skip list, and how does it improve performance over linked lists?&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>learning</category>
      <category>database</category>
      <category>oop</category>
      <category>datastructures</category>
    </item>
    <item>
      <title>Setup ElasticSearch Ubuntu / Mac</title>
      <dc:creator>Daniyal Haider</dc:creator>
      <pubDate>Sat, 13 Jul 2024 12:09:29 +0000</pubDate>
      <link>https://dev.to/daniyalhaider99/setup-elasticsearch-ubuntu-mac-2h1p</link>
      <guid>https://dev.to/daniyalhaider99/setup-elasticsearch-ubuntu-mac-2h1p</guid>
      <description>&lt;h2&gt;
  
  
  ElasticSearch on ubuntu
&lt;/h2&gt;

&lt;p&gt;For installation run these commands&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install elasticsearch
sudo systemctl daemon-reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To automatically start elasticsearch when system reboots&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl enable elasticsearch.service 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Navigate to file &lt;code&gt;/etc/elasticsearch/elasticsearch.yml&lt;/code&gt;&lt;br&gt;
Edit the file and uncomment following lines&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# network.host: localhost
# http.port: 9200
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change to the following (make sure not leave any space)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;network.host: localhost
http.port: 9200
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add new line&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;discovery.type: single-node
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Navigate to file &lt;code&gt;/etc/elasticsearch/jvm.options&lt;/code&gt;&lt;br&gt;
Add the following lines&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-Xms2g
-Xmx4g
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can change the above two lines according to your system's memory, here 2g represents 2GB. -Xms2g is a minimum of 2GB assigned to ES and -Xsmx4g is a maximum of 4GB assigned. &lt;/p&gt;

&lt;p&gt;If you want to assign memory in MBs you can use &lt;br&gt;
&lt;code&gt;-Xms512m&lt;/code&gt; will give a minimum of 512MB memory to ES.&lt;/p&gt;

&lt;p&gt;NOTE: While removing comments from the files mentioned above. be careful not to leave any spaces from the line start this would not allow ElasticSearch to start&lt;/p&gt;

&lt;p&gt;Run the following command to start&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl start elasticsearch
curl http://localhost:9200/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run this command to see the health of your ES cluster&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -XGET 'localhost:9200/_cluster/health?pretty=true'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Plugin install in case of error:400&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-icu
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For uninstallation run these commands&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get remove --purge elasticsearch
sudo rm -rf /etc/elasticsearch
sudo rm -rf /var/lib/elasticsearch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  ElasticSearch on MacBook / HomeBrew
&lt;/h2&gt;

&lt;p&gt;Elastic publishes Homebrew formulae so you can install Elasticsearch with the Homebrew package manager.&lt;/p&gt;

&lt;p&gt;To install with Homebrew, you first need to tap the Elastic Homebrew repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew tap elastic/tap
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you’ve tapped the Elastic Homebrew repo, you can use brew install to install the latest version of Elasticsearch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install elastic/tap/elasticsearch-full
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To install the Elasticsearch plugin on Mac use the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/usr/local/var/homebrew/linked/elasticsearch-full/bin/elasticsearch-plugin install &amp;lt;plugin_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that the path to bin may vary according to your system&lt;br&gt;
&lt;code&gt;/usr/local/var/homebrew/linked/elasticsearch-full/bin&lt;/code&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>ubuntu</category>
      <category>macbook</category>
    </item>
  </channel>
</rss>
