Computer Science interview questions
500 questions with model answers, in four levels. Start with Basic, check yourself honestly, then move up.
Basic questions
- Data Structures (13)
- Algorithms & Complexity (13)
- OOP & Design Patterns (13)
- Programming Languages (C/C++/Java/Python) (13)
- Operating Systems (13)
- DBMS & SQL (13)
- Computer Networks (12)
- System Design (12)
- Software Engineering & Testing (12)
- Computer Security (12)
- Computer Architecture (12)
- Cloud & Distributed Systems (12)
Intermediate questions
- Data Structures (13)
- Algorithms & Complexity (13)
- OOP & Design Patterns (13)
- Programming Languages (C/C++/Java/Python) (13)
- Operating Systems (13)
- DBMS & SQL (13)
- Computer Networks (12)
- System Design (12)
- Software Engineering & Testing (12)
- Computer Security (12)
- Computer Architecture (12)
- Cloud & Distributed Systems (12)
Advanced questions
- Data Structures (11)
- Algorithms & Complexity (11)
- OOP & Design Patterns (11)
- Programming Languages (C/C++/Java/Python) (11)
- Operating Systems (11)
- DBMS & SQL (10)
- Computer Networks (10)
- System Design (10)
- Software Engineering & Testing (10)
- Computer Security (10)
- Computer Architecture (10)
- Cloud & Distributed Systems (10)
Tricky questions
- Data Structures (7)
- Algorithms & Complexity (7)
- OOP & Design Patterns (7)
- Programming Languages (C/C++/Java/Python) (6)
- Operating Systems (6)
- DBMS & SQL (6)
- Computer Networks (6)
- System Design (6)
- Software Engineering & Testing (6)
- Computer Security (6)
- Computer Architecture (6)
- Cloud & Distributed Systems (6)
Sample questions
- What is the difference between an array and a linked list?
- What is space complexity?
- What is a lambda or anonymous function?
- What is the difference between a candidate key and a super key?
- What is database sharding?
- What is HTTPS?
- How does a hash map handle collisions?
- What is backtracking?
- What does the volatile keyword do in Java?
- What is two-phase locking (2PL)?
- Estimate the average QPS for 100 million daily requests.
- What is the difference between an IDS and an IPS?
- Design a set supporting insert, delete and getRandom, all in O(1).
- How would you implement undo/redo in an editor?
- Why is epoll more scalable than select or poll?
- Design a URL shortener.
- What is forward secrecy?
- "Hash map lookup is always O(1)." Can it be O(n)?
- Inside a C function void f(int arr[]), does sizeof(arr) give the array's size?
- "Average latency is the best measure of user experience." Agree?