/DataStructures-Algorithms

This repo contains links of questions and their solution for interview prepration from geeksforgeeks, leetcode, etc.

Primary LanguageC++MIT LicenseMIT

Contributors Forks Stargazers Issues MIT License LinkedIn Portfolio

DATA STRUCTURES & ALGORITHMS

Resources and Solutions ^_^

Table of Contents


Gone are the days when there were only few good companies, Now there are a lot of companies which:

  • Pay Exceptionally Well
  • Good Work Life
  • Great Projects/Learning

🏆 Roadmap to Dream Placement

Language
  • Intent
    • Familiarity with Syntax
    • Familiarity with all keywords & Basic Concepts
    • main focus is on, that are you comfortable in writing code with your preferred language
  • Choices
    • C++
    • Java
    • Python
      • Refrences:
        1️⃣ Tutorialspoint
        2️⃣ w3schools
      • Time Required: same as above
      • Important Callout: Some companies don't allow python as a coice in their online coding test, so prepare accordingly
Data Structure and Algorithms
  • Without this, No Software Engineering Interview, in a tech giant can be cracked
    • Follow the DSA Crack Sheet List given below
    • Time Required:
      1️⃣ 2-3 months
      2️⃣ 6-8 questions/day
      3️⃣ 3-6 hrs/day
Projects
  • You need some projects to showcase your skills to your interviewer
    • Choices:
      1️⃣ Mobile Development
      2️⃣ Web Development
      3️⃣ Machine Leraning
      4️⃣ Some other stuff (like, Blockchain, IOT, etc)
    • Time Required: 3 months (doing on weekends 6-8 hours)
Subjectve Topics
  • Do a Subsequent reading, revision any day you get time
    1️⃣ Operating System
    2️⃣ OOPS, Object Oriented Skills
    3️⃣ DBMS, Databse Management
    4️⃣ Computer Networking
Competitive Programming
  • CP needs time, it's not somthing thant you can master in 2 months, We will get comfortable with online platorms and get a taste of competitive programming
  • Leetcode questions nearly 150-200 questions
    • Category:
      1️⃣ Easy: 30%
      2️⃣ Medium: 50%
      3️⃣ Hard: 20%
  • If time allows then go for Codeforces div2 Level A,B and C question
  • Time Required:
    1️⃣ 150-200 Questions
    2️⃣ 2 months
    3️⃣ 3-4 Ques/day
System Design
  • Tech Level:
    1️⃣ System's overview like we will use this queue with DynamoDB and a acheduler with justification of why we are using this DB, SQS, SNS, multithreading, etc.
    2️⃣ for SDE-1 equivalent positions, this level is somewhat rare
  • Normal Understanding:
    1️⃣ knowledge of dividing system & creating a rough DFD of system
    2️⃣ knowledge of DB Schema creation
    3️⃣ able to create problem-solving logic or not
    4️⃣ Time Required: Just need some reading of artiles/notes, can be pursued parallely
  • Great Resources:
    1️⃣ Grokking
    2️⃣ Primer
Misc Stuff

1️⃣ Operating System

Overview
Process Concept
Thread Concepts
Process Scheduling
  • Why do we need it?
  • CPU Burst Cycle
  • CPU Scheduler
    • Pre-Emptive Scheduling
    • Non PreEmptive
    • Advantages/Disadvantages
  • Dispatch
    • Role of Dispatcher
    • Dispatch Latency
  • Scheduling Criteria
    • CPU Utilisation
    • Throughput
    • TAT [Turn around Time]
    • Waiting Time
    • Response Time
  • Scheduling Algo
    • FCFS
    • SJFC
    • Priority-based
    • Round-Robin
    • MLQS
    • MLFQS
    • Which algo is used in real world OS
  • IMP terms to know
    • Starvation
    • Ageing
  • How to prevent Starvation?
Synchronisation
Deadlocks
  • What is Deadlock?
  • Effects of Deadlock?
  • Necessary Conditions
    • Mutual Exclusion
    • Hold & Wait
    • No Pre-emption
    • Circular Wait
  • Methods for Deadlock handling
    • Prevention or Avoidance
    • Detection or Recovery
      • Banker's Algo
      • Ostrich Algo
      • Resource Per-emption
    • Ignorance
Memory-Management
  • Imp Points
    • CPU can direct access Registers and Main Memory
    • Protection of Memory space is handled by Hardware
    • OS loads Base and Limit registers
    • Mapping from Logical to Physical address is done by MMU[Memory Management Unit]
    • OS memory is categorised into
      • for the resident of OS
      • user processes
  • Logical vs Physical address space
  • What is Swapping
    • Ex-Priority based Scheduling
    • Done by Dispatcher
    • Context Switch time in swapping is very high
    • OS can't swap process that has pending input/output
  • Imp topics to cover
    • Follow youtube videos
    • Memory Allocation
      • Contiguous Memory Allocation
        • Address Translation: Base and limit Register
        • Fixed Partitioning
        • Variable Partitioning
        • Variable Partitioning
        • dynamic storage allocation problem
          • Best Fit
          • Worst Fit
          • First Fit
        • Internal Fragmentation
        • External Fragmentation
          • Compaction
          • Non-Contiguous Allocation
            • Paging
            • Segmentation
      • Paging
        • Page table
        • Page no
        • Page offset
        • Page Table Limit Register (PTLR)
      • Segmentation
        • Segment Table
        • Base Register
        • Limit Register
  • Why paging increases the context-switch time?
  • Page vs Frame?
  • What is TLB miss?
Virtual Memory
  • Goal of mem. Mgmt
    • To keep multiple processes in memory to allow multi-programming
  • Virtual Memory
    • What?
    • Why?
    • Where it is physically located?
    • How it is implemented?
      • Demand Paging
      • Strategy to only load pages when they are needed
      • Paging + Swapping
    • Advantages
      • user can write program for extremely large virtual address space
      • [CPU utilisation & throughput] increases & [Response Time, Turn aruond time, TAT] remains same
      • Less I/O would be needed to load or swap user programs into memory, so each user program would run faster
      • Degree of Multiprogramming increases
      • allows file and memory to be shared by 2 or more processes through page sharing
    • If it is used carelessely, it can decrease performance
  • Demand Paging
    • paging + swapping
    • Lazy Swapper
    • pager
    • page fault
  • Pure Demand Paging
  • Swap Space
    • Section of hard disk used for implementing Virtual Mem. in swap
  • What is Page Fault?
  • Page Replacement Algo
    • FIFO
    • Optimal Page Replacement
    • LRU
  • What is Frame Rate
  • Most Asked Questions (Thrashing)
    • What?
      • Low CPU Utilisation->Degree of Multiprogramming increases->More Page Fault->Cycle Continues->Thrashing occurs->Page fault occurs tremendously->CPU utilisation decrease sharply
    • Cause of Thrashing?
    • Solution to Thrashing?
      • use priority based replacement algo
      • allocate the exact no. of frames that are actually required
  • Can we replace physical memory i.e, RAM with virtual memory?
  • Is performance of virtual memory and physical memory same?
Storage Management (optional)
For College Exams

🔰 Other Notes and Resources

🔖Best book for Coding Interviews - Cracking-The-Coding-Interview

Urls for other Notes, and Reading Resources picked from different editorials.

View Resources/Articles
Last Minute Notes
Notes/Question/Explanations

Data Structures and Algorithms Cracks Sheet contains most necessary questions to learn and grasp about most common and important DS and Algos


This is LeetCode's official curated list of Top classic interview questions to help you land your dream job. Our top interview questions are divided into the following series:

  • Easy Collection
  • Medium Collection
  • Hard Collection
    to help you master Data Structure & Algorithms and improve your coding skills.

Just like any other skills, coding interview is one area where you can greatly improve with deliberate practice.

Most of the classic interview questions have multiple solution approaches. For the best practice result, we strongly advise you to go through this list at least a second time, or even better - a third time.

  • By the second attempt, you may discover some new tricks or new methods.

  • By the third time, you should find that your code appear to be more concise compared to your first attempt. If so, congratulations!

Remember: Deliberate practice does not mean looking for answers and memorizing it. You won't go very far with that approach. The more you are able to solve a problem yourself without any reference to answers, the more you will improve.

It is containing the list of company wise questions available on leetcode premium. Every pdf file corresponds to a list of questions on leetcode for a specific company based on the leetcode company tags. The list of questions within each pdf is further sorted by their frequency, so the most popular question for a specific company is at the top. Download All PDFs


This Challenge is beginner-friendly. It consists of daily problems given by Leetcode. A problem is added here each day.



🏆Sources

Other coding websites

🏆Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

🏆License

Distributed under the MIT License. See LICENSE for more information.

🏆Contact

Project Link: https://github.com/sachuverma/DataStructures-Algorithms

Sachin Verma : sachinverma53121@gmail.com

Drop a ⭐ if you like my work😄