Full-Stack Interview Preparation Notes
1. Define semantic tags in HTML. List any three with usage.
Semantic tags clearly describe their meaning to the browser and developer.
Examples:
- <header>: Defines a header section
- <article>: A self-contained piece of content
- <footer>: Defines a footer section
2. What is the difference between id and class in CSS? Give an example.
id: Unique identifier (used once)
class: Reusable style (used many times)
Example:
#main { color: blue; }
.box { border: 1px solid black; }
3. Create a basic responsive layout using HTML and CSS with a header, two-column layout, and footer.
<header>Header</header>
<div class='container'>
<div class='column'>Left</div>
<div class='column'>Right</div>
</div>
<footer>Footer</footer>
CSS: .container { display: flex; flex-wrap: wrap; }
4. Explain the CSS Box Model with a diagram and describe its importance in UI layout.
[ Margin ]
[ Border ]
[ Padding ]
[ Content ]
Importance: Controls layout and spacing in a webpage.
Full-Stack Interview Preparation Notes
5. What are Python lists and dictionaries? Give examples.
List: Ordered collection
Example: fruits = ['apple', 'banana']
Dictionary: Key-value pairs
Example: student = {'name': 'Esther'}
6. What is the purpose of lambda functions in Python? Write a small lambda function.
Used to create small anonymous functions.
Example: square = lambda x: x*x
7. Write a Python program to read a list of numbers and output the second largest number.
nums = list(map(int, input().split()))
nums = list(set(nums))
[Link]()
print(nums[-2])
8. Write a Python class Student with attributes name, roll_no, and method to display details.
class Student:
def __init__(self, name, roll_no):
[Link] = name
self.roll_no = roll_no
def display(self):
print([Link], self.roll_no)
9. Explain try-except-finally in Python with an example.
try:
x = int('abc')
except ValueError:
print('Error')
finally:
Full-Stack Interview Preparation Notes
print('Always runs')
10. What is the difference between method overloading and overriding?
Overloading: Same method name, different parameters
Overriding: Subclass redefines a parent method
11. What is the purpose of constructors in Java? Write a simple example.
Used to initialize objects.
class Student {
Student(String name) {
[Link] = name;
12. Write a Java program to sort an array in ascending order without using built-in methods.
Loop and compare elements, then swap them.
Use nested loops to sort manually.
13. Explain OOP concepts (Encapsulation, Inheritance, Polymorphism, Abstraction) with example.
Encapsulation: Private data with public methods
Inheritance: class B extends A
Polymorphism: Method overriding
Abstraction: Using abstract class or interface
14. What is the difference between synchronous and asynchronous code in JS?
Synchronous: Runs line by line
Asynchronous: Executes in background (e.g., setTimeout)
15. What are JavaScript objects? How do you access their properties?
Objects are key-value pairs.
Full-Stack Interview Preparation Notes
Access with dot or bracket: [Link] or obj['name']
16. Write a JavaScript function that validates if a string is a palindrome or not.
function isPalindrome(str) {
str = [Link]();
return str === [Link]('').reverse().join('');
17. Explain the concept of closures with an example.
function outer() {
let count = 0;
return function() { count++; return count; }