Q1SQLWhat is the difference between WHERE and HAVING?
WHERE filters individual rows before grouping and cannot use aggregate functions. HAVING filters groups after GROUP BY and can use aggregates like SUM() or COUNT().
SELECT dept, COUNT(*) AS staff FROM employees WHERE status = 'Active' GROUP BY dept HAVING COUNT(*) > 10;
Q2SQLExplain INNER JOIN vs LEFT JOIN.
INNER JOIN returns only rows that have a match in both tables. LEFT JOIN returns every row from the left table, plus matching rows from the right; where there is no match, the right-side columns are NULL. Use LEFT JOIN when you must not lose records, for example all customers including those with no orders.
Q3SQLHow do you find the second highest salary?
Two common ways:
-- Subquery SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees); -- Window function (handles ties, any Nth) SELECT DISTINCT salary FROM ( SELECT salary, DENSE_RANK() OVER (ORDER BY salary DESC) AS rnk FROM employees) t WHERE rnk = 2;
Q4SQLWhat is the difference between ROW_NUMBER, RANK and DENSE_RANK?
All three number rows in an ordered window. ROW_NUMBER gives unique numbers even for ties (1,2,3). RANK gives ties the same number and then skips (1,1,3). DENSE_RANK gives ties the same number without skipping (1,1,2).
Q5ExcelVLOOKUP vs XLOOKUP: which would you use and why?
VLOOKUP only searches the first column and returns values to its right, and breaks if columns are inserted when you hard-code the column number. XLOOKUP can look left or right, defaults to exact match, has a built-in 'if not found' argument and can search from the bottom. Prefer XLOOKUP where available; INDEX + MATCH is the classic alternative.
Q6ExcelWhen would you use a Pivot Table?
To summarise large data quickly without formulas: totals, counts and averages by category, month or region, sliced with filters and slicers. Example: total sales by region and product for each quarter, built in seconds from 50,000 rows.
Q7Power BIWhat is the difference between a calculated column and a measure?
A calculated column is computed row by row at data refresh and stored in the model, so it uses memory and can be used in slicers. A measure is calculated at query time based on the current filter context, is not stored, and is used for aggregations like Total Sales = SUM(Sales[Amount]). Prefer measures for aggregations.
Q8Power BIWhat is a star schema and why is it preferred?
A central fact table (transactions such as sales) linked to dimension tables (date, product, customer, region). It keeps the model simple, makes relationships one-to-many, improves performance and makes DAX easier to write.
Q9StatisticsWhen is the median a better measure than the mean?
When data is skewed or has outliers. Salaries are a classic example: a few very high salaries pull the mean up, while the median shows what a typical employee earns.
Q10StatisticsDoes correlation mean causation?
No. Two variables can move together because of a third factor or by coincidence. Ice-cream sales and drowning cases both rise in summer because heat drives both. Proving causation needs controlled experiments such as A/B tests.
Q11Data cleaningHow do you handle missing values in a dataset?
First understand why they are missing. Then drop rows or columns if the missing share is small or the field is unimportant; fill (impute) with mean, median, mode or a fixed value like 'Unknown'; or use forward-fill for time series. Always document the choice, because it affects results.
Q12PythonHow do you remove duplicates and check nulls in pandas?
df.isnull().sum() # nulls per column df = df.drop_duplicates() # remove duplicate rows df = df.drop_duplicates(subset=['email'], keep='first')
subset limits the check to chosen columns; keep decides which copy stays.
Q1Testing basicsWhat is the difference between verification and validation?
Verification asks 'are we building the product right?': reviews, walkthroughs and inspections against requirements, without running the code. Validation asks 'are we building the right product?': executing the software to confirm it meets user needs.
Q2Testing basicsExplain severity vs priority with an example.
Severity is the impact of a defect on the system; priority is how soon it must be fixed. A spelling mistake in the company name on the home page is low severity but high priority. A crash in a rarely used admin report is high severity but may be lower priority.
Q3PlaywrightWhy choose Playwright over Selenium?
Playwright has built-in auto-waiting (fewer flaky tests), supports Chromium, Firefox and WebKit from one API, ships with its own test runner, parallel execution, tracing and screenshots, and makes network interception and API testing easy. Selenium has a larger ecosystem and supports more languages and older browsers.
Q4PlaywrightWhat is auto-waiting in Playwright?
Before acting on an element, Playwright automatically waits until it is attached, visible, stable, enabled and able to receive events. Web-first assertions such as expect(locator).toBeVisible() also retry until the condition is met or a timeout occurs, so you rarely need manual sleeps.
Q5PlaywrightWhich locator strategies does Playwright recommend?
User-facing locators first: getByRole, getByLabel, getByPlaceholder, getByText, then getByTestId for stable test IDs. CSS and XPath are supported but more brittle.
await page.getByRole('button', { name: 'Login' }).click();Q6PlaywrightHow do you handle a new tab or popup in Playwright?
Start waiting for the event before the click that opens it:
const [newPage] = await Promise.all([
page.waitForEvent('popup'),
page.getByText('Open report').click()
]);
await newPage.waitForLoadState();Q7PlaywrightHow do you run tests in parallel in Playwright?
Playwright runs test files in parallel using worker processes by default. Set the number with workers in playwright.config, and set fullyParallel: true to also parallelise tests inside a single file. Keep tests independent so they can run in any order.
Q8PlaywrightHow do you do API testing in Playwright?
Use the built-in request fixture (APIRequestContext):
test('get user', async ({ request }) => {
const res = await request.get('/api/users/1');
expect(res.ok()).toBeTruthy();
expect((await res.json()).id).toBe(1);
});It is also useful to set up test data or log in via API before UI tests.
Q9SeleniumWhat is the difference between implicit and explicit wait?
An implicit wait is a global setting: the driver polls for up to N seconds whenever it looks for any element. An explicit wait (WebDriverWait + ExpectedConditions) waits for a specific condition on a specific element, such as clickable or visible. Prefer explicit waits, and don't mix the two.
Q10FrameworkWhat is the Page Object Model (POM)?
A design pattern where each page or component gets its own class holding its locators and actions (e.g. LoginPage.login(user, pass)). Tests call these methods instead of raw locators, so a UI change is fixed in one place, which makes the suite easier to maintain and read.
Q11Testing basicsRetesting vs regression testing?
Retesting re-runs the specific failed test cases after a bug fix to confirm the fix. Regression testing checks that the fix or a new change has not broken existing, previously working features, which makes it ideal for automation.
Q12Testing basicsSmoke testing vs sanity testing?
Smoke testing is a broad, shallow check that a new build's critical paths work and it is stable enough to test further. Sanity testing is a narrow, focused check of a specific feature or fix after a minor change.
Q1JavaScriptWhat is the difference between == and ===?
== compares values after type conversion, so '5' == 5 is true. === compares value and type with no conversion, so '5' === 5 is false. Use === by default to avoid surprises.
Q2JavaScriptExplain var, let and const.
var is function-scoped, hoisted and can be redeclared. let and const are block-scoped and sit in the temporal dead zone until declared. let can be reassigned; const cannot be reassigned, although the contents of a const object or array can still change.
Q3JavaScriptWhat are Promises and async/await?
A Promise represents a value that will be available later: pending, then fulfilled or rejected. async/await is cleaner syntax on top of Promises:
async function getUser() {
try {
const res = await fetch('/api/user');
return await res.json();
} catch (err) { console.error(err); }
}Q4ReactWhat is the Virtual DOM?
A lightweight in-memory copy of the real DOM. When state changes, React builds a new virtual tree, compares it with the previous one (diffing) and applies only the minimum changes to the real DOM.
Q5ReactProps vs state?
Props are read-only inputs passed from a parent component. State is data a component owns and can change with useState; changing state triggers a re-render. Data flows down through props; changes flow up through callback functions.
Q6ReactWhat does useEffect do? How do you run it only once?
useEffect runs side effects after render: API calls, subscriptions, timers. The dependency array controls when it re-runs: [] runs it once after the first render; [id] re-runs when id changes. Return a function to clean up.
Q7Node & ExpressWhat is middleware in Express?
A function with access to req, res and next that runs between the request and the route handler, for logging, authentication, parsing JSON, error handling and so on. It must call next() to pass control on, or send a response.
app.use((req, res, next) => {
console.log(req.method, req.url);
next();
});Q8APIsPUT vs PATCH?
PUT replaces the whole resource with the data sent and is idempotent: sending it twice gives the same result. PATCH updates only the fields sent and is not guaranteed to be idempotent, for example a patch that increments a counter. POST creates and is not idempotent.
Q9MongoDBWhen would you choose MongoDB over a SQL database?
MongoDB stores flexible JSON-like documents, suits changing or nested data, and scales horizontally easily. SQL databases suit structured data with strong relationships and complex joins and transactions, such as banking. Many real systems use both.
Q10SecurityHow do you secure a REST API?
Authenticate with JWT or sessions and check authorisation on every route; hash passwords with bcrypt; validate and sanitise all input; use HTTPS; configure CORS narrowly; add rate limiting; keep secrets in environment variables; and never return stack traces to clients.