Development Questions:
Q1. Which HTTP status code means "Unauthorized"?
A. 403
B. 401
C. 402
D. 500
Q2. Which CSS property controls the stacking order of positioned elements?
A. position
B. display
C. z-index
D. float
Q3. Find Second Largest Element (Without Sorting) (Language of your choice)
Given an array of integers, find the second largest distinct element in the array without
sorting.
Example:
Input: [10, 5, 20, 8]
Output: 10
Q4. You are given the following data:
const arr1 = [10, 20, 30];
const arr2 = [40, 50, 60];
const user = { name: "Bob", age: 30, city: "New York" };
Tasks:
Combine arr1 and arr2 into a single array called allNumbers using the spread
operator.
From the user object, extract name and city into separate variables using
destructuring.
Print allNumbers, name, and city to the console.
Expected Output:
[10, 20, 30, 40, 50, 60]
Bob New York
Q5. Create a Greeting Message
You are given a user object:
const user = { name: "Diana", age: 22, city: "London" };
Task:
Write a function greetUser that returns a greeting string in this format:
"Hello, my name is Diana. I am 22 years old and I live in London."
Use template literals to construct the string.
Don’t use string concatenation (+).
Expected Output:
[Link](greetUser(user));
// "Hello, my name is Diana. I am 22 years old and I live in London."
Q6. You are given an array of numbers. Create a new array where each element is the sum
of all the numbers from the start up to that position.
In simple words:
First element stays the same
Second element = first + second
Third element = first + second + third
and so on...
Example:
Input: [1, 2, 3, 4]
Expected Output: [1, 3, 6, 10]
Q7. Write the detailed steps involved (algorithm) to implement user registration and login
APIs, where a user first registers using email and password, and then logs in using those
credentials.
Q8. Your company is launching a new website. You are asked to create a simple HTML
boilerplate for the homepage.
The marketing team wants the website link to show a preview with a title, description, and
an image whenever someone shares the link on social media or messaging apps (like
Facebook, LinkedIn, or WhatsApp).
Task:
Write a simple HTML boilerplate for the homepage.
Include the meta tag(s) required so that the preview works correctly when the link is shared.
Q9. Your application has recently scaled and is now handling a large number of users and
API requests. You are observing the following issues:
APIs are becoming slow under high traffic
Database queries are taking longer than expected
JWT tokens are large, increasing request/response size
The system is making repeated database calls for the same data
How would you optimize the backend system to improve performance and scalability?
Q10. You are working as a frontend developer for a large e-commerce React application.
The homepage shows:
100+ products, each with an image, description, and reviews.
A carousel of promotional banners.
A “Top Sellers” sidebar with user reviews and ratings.
Filters and sorting options for categories and prices.
Users are complaining that:
The homepage takes 8–10 seconds to load.
The initial bundle size is too large, causing slow first paint.
Some API requests, like reviews and ratings, are fetched unnecessarily even when
the user doesn’t scroll to that section.
Switching filters and sorting feels laggy, with some UI flickering.
What are the different ways you would apply to optimize the performance of this page?