Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
Short answer: A good unit test is: Isolated: Tests one unit without external dependencies. Repeatable: Produces the same results every run. Fast: Executes quickly to allow frequent runs. Automated: Runs without manual in…
Short answer: Common database security risks include: SQL Injection: Malicious queries that can compromise the database if the input is not properly validated. Explain a bit more Unauthorized Access: Users gaining access…
Short answer: uthorized users based on roles. Each role defines a set of permissions (what actions can be performed on which database objects). Steps to implement RBAC: Real-world example (ShopNest) ShopNest’s SQL Server…
Short answer: Role-Based Access Control (RBAC) is a method for restricting system access to authorized users based on roles. Each role defines a set of permissions (what actions can be performed on which database objects…
Short answer: And SQL statements in precompiled code, making it harder for attackers to inject malicious code. Explain a bit more Roles in database security: Input Validation: Stored procedures allow you to validate user…
Short answer: Stored Procedures can help improve database security by encapsulating business logic and SQL statements in precompiled code, making it harder for attackers to inject malicious code. Explain a bit more Roles…
Short answer: LTER DATABASE MyDatabase SET ENCRYPTION ON; Column-Level Encryption: For encrypting specific columns. CREATE CERTIFICATE MyCertificate WITH SUBJECT = 'My Certificate'; CREATE SYMMETRIC KEY MySymmetricKey WI…
Short answer: Encryption is essential for protecting sensitive data both at rest (on disk) and in transit (during communication). Explain a bit more SQL Server: Transparent Data Encryption (TDE): Encrypts data at rest wi…
Short answer: Backup and restore security involves ensuring that backup files are stored securely and that access to backup data is tightly controlled. Steps for Secure Backup: Real-world example (ShopNest) ShopNest’s SQ…
Short answer: There are three primary types of database backups: Real-world example (ShopNest) Checkout wraps stock decrement + order insert in a transaction so you never sell stock you do not have. Say this in the inter…
Short answer: SQL Server: To back up a database in SQL Server, you can use the BACKUP DATABASE command. Explain a bit more - Full Backup BACKUP DATABASE MyDatabase TO DISK = 'C:\Backups\MyDatabase.bak'; - Transaction Log…
Short answer: SQL Server: To restore a full backup in SQL Server: - Full Restore RESTORE DATABASE MyDatabase FROM DISK = 'C:\Backups\MyDatabase.bak'; - Transaction Log Restore RESTORE LOG MyDatabase FROM DISK = 'C:\Backu…
Short answer: Automating backups ensures that backups are performed regularly and without manual intervention. You can use the following methods: Real-world example (ShopNest) ShopNest’s SQL Server database stores custom…
Short answer: Database replication is the process of copying and maintaining database objects in multiple databases to ensure high availability and fault tolerance. Types of Replication: Real-world example (ShopNest) Sho…
Short answer: Sharding and partitioning are techniques used to distribute data across multiple servers or tables to improve performance and scalability. Real-world example (ShopNest) ShopNest’s SQL Server database stores…
Short answer: Monitoring database performance is crucial for identifying bottlenecks and ensuring optimal functioning. The following methods are commonly used: Real-world example (ShopNest) ShopNest adds an index on Orde…
Short answer: A connection pool is a cache of database connections that are maintained so that connections can be reused when future requests to the database are made. Explain a bit more Instead of opening and closing a…
Short answer: Multi-tenancy refers to a single instance of a database serving multiple tenants (clients or organizations) while keeping their data isolated. Approaches: Real-world example (ShopNest) ShopNest’s SQL Server…
Short answer: And ensuring consistency across different environments (development, staging, production). pproaches: Real-world example (ShopNest) ShopNest’s SQL Server database stores customers, products, and orders. Goo…
Short answer: Managing and versioning database schema changes is essential in keeping track of updates and ensuring consistency across different environments (development, staging, production). Approaches: Real-world exa…
Short answer: Data migration involves transferring data between systems or platforms, often when changing database engines or moving to the cloud. Steps: Real-world example (ShopNest) ShopNest’s SQL Server database store…
Short answer: The ACID properties ensure reliable processing of database transactions: Real-world example (ShopNest) Checkout wraps stock decrement + order insert in a transaction so you never sell stock you do not have.…
Short answer: Your hike target should be based on market demand, not only your current CTC. If your skill set is niche or revenue-linked, you can justify a stronger jump than a standard lateral move. Always decide a targ…
Short answer: To negotiate a higher CTC, you must demonstrate higher expected impact. Recruiters can stretch budgets when they can justify your value to hiring managers and finance. Build your case around outcomes, not e…
Short answer: Experienced candidates are evaluated on ownership depth, not just technical skills. Your negotiation should show that you can de-risk delivery, mentor teams, and improve business outcomes quickly. The stron…
Unit Testing C# Programming Tutorial · Testing
Short answer: A good unit test is: Isolated: Tests one unit without external dependencies. Repeatable: Produces the same results every run. Fast: Executes quickly to allow frequent runs. Automated: Runs without manual intervention. Clear: Easy to understand and maintain. Independent: Does not depend on other tests.
Arrange a cart with 2 items → Act Checkout() → Assert total and that payment was called once.
SQL & Databases SQL Server Tutorial · SQL
Short answer: Common database security risks include: SQL Injection: Malicious queries that can compromise the database if the input is not properly validated.
Unauthorized Access: Users gaining access to sensitive data without permission. Data Breaches: Exposing sensitive data due to insufficient encryption or weak access controls. Privilege Escalation: Attackers gaining elevated permissions or access levels. Malicious Insiders: Employees or authorized users intentionally or unintentionally leaking or modifying data. Denial of Service (DoS): Attackers overwhelming the database with requests, making it unavailable to legitimate users. Backup Exposure: Unencrypted or improperly secured backup files that are accessible to unauthorized users.
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: uthorized users based on roles. Each role defines a set of permissions (what actions can be performed on which database objects). Steps to implement RBAC:
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: Role-Based Access Control (RBAC) is a method for restricting system access to authorized users based on roles. Each role defines a set of permissions (what actions can be performed on which database objects). Steps to implement RBAC:
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: And SQL statements in precompiled code, making it harder for attackers to inject malicious code.
Roles in database security: Input Validation: Stored procedures allow you to validate user inputs at the database level, preventing malicious input from being executed. UPDATE employees SET salary = new_salary WHERE id = emp_id; END IF; END; And SQL statements in precompiled code, making it harder for attackers to inject malicious code. Roles in database security: Input Validation: Stored procedures allow you to validate user inputs at the database level, preventing malicious input from being executed. UPDATE employees SET salary = new_salary WHERE id = emp_id; END IF; END;
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: Stored Procedures can help improve database security by encapsulating business logic and SQL statements in precompiled code, making it harder for attackers to inject malicious code.
Roles in database security: Input Validation: Stored procedures allow you to validate user inputs at the database level, preventing malicious input from being executed. Preventing Direct Access: By using stored procedures, users can be given permissions to execute specific procedures rather than direct access to the underlying tables. Encapsulation of Business Logic: The logic within stored procedures is not visible to the end-user, reducing the attack surface. Audit Logging: Stored procedures can include logic to log user activity for auditing and compliance purposes. Example: Instead of allowing users to execute arbitrary INSERT or UPDATE statements, you can give them permission to execute a specific stored procedure that does the necessary validation and modification of data. CREATE PROCEDURE update_salary(IN emp_id INT, IN new_salary DECIMAL) BEGIN IF new_salary > 0 THEN
UPDATE employees SET salary = new_salary WHERE id = emp_id; END IF; END;
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: LTER DATABASE MyDatabase SET ENCRYPTION ON; Column-Level Encryption: For encrypting specific columns. CREATE CERTIFICATE MyCertificate WITH SUBJECT = 'My Certificate'; CREATE SYMMETRIC KEY MySymmetricKey WITH ALGORITHM = AES_256 ENCRYPTION BY CERTIFICATE MyCertificate; OPEN SYMMETRIC KEY MySymmetricKey DECRYPTION BY CERTIFICATE MyCertificate; PostgreSQL: pgcrypto extension provides functions for encrypting data.
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: Encryption is essential for protecting sensitive data both at rest (on disk) and in transit (during communication).
SQL Server: Transparent Data Encryption (TDE): Encrypts data at rest without requiring application changes. CREATE DATABASE ENCRYPTION KEY; ALTER DATABASE MyDatabase SET ENCRYPTION ON; Column-Level Encryption: For encrypting specific columns. CREATE CERTIFICATE MyCertificate WITH SUBJECT = 'My Certificate'; CREATE SYMMETRIC KEY MySymmetricKey WITH ALGORITHM = AES_256 ENCRYPTION BY CERTIFICATE MyCertificate; OPEN SYMMETRIC KEY MySymmetricKey DECRYPTION BY CERTIFICATE MyCertificate; PostgreSQL: pgcrypto extension provides functions for encrypting data. SELECT pgp_sym_encrypt('Sensitive Data', 'encryption_key'); MySQL: Encryption Functions: MySQL provides functions like AES_ENCRYPT and AES_DECRYPT. SELECT AES_ENCRYPT('Sensitive Data', 'encryption_key'); SELECT AES_DECRYPT(encrypted_data, 'encryption_key'); For all databases, consider using SSL/TLS for encrypting data in transit.
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: Backup and restore security involves ensuring that backup files are stored securely and that access to backup data is tightly controlled. Steps for Secure Backup:
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: There are three primary types of database backups:
Checkout wraps stock decrement + order insert in a transaction so you never sell stock you do not have.
SQL & Databases SQL Server Tutorial · SQL
Short answer: SQL Server: To back up a database in SQL Server, you can use the BACKUP DATABASE command.
- Full Backup BACKUP DATABASE MyDatabase TO DISK = 'C:\Backups\MyDatabase.bak'; - Transaction Log Backup BACKUP LOG MyDatabase TO DISK = 'C:\Backups\MyDatabase_log.trn'; PostgreSQL: In PostgreSQL, you can use the pg_dump command for backing up the database. - Full Backup pg_dump mydatabase > /path/to/backup/mydatabase.sql For backing up with compression or other options: pg_dump -Fc mydatabase > /path/to/backup/mydatabase.dump For transactional backups, you can use WAL (Write-Ahead Logging) archiving, typically managed through archive_mode and archive_command settings in the postgresql.conf. MySQL: In MySQL, you can use the mysqldump command for backing up the database. - Full Backup mysqldump -u username -p mydatabase > /path/to/backup/mydatabase.sql For binary logging (transaction logs), MySQL uses binlog: - Enabling binary log [mysqld] log-bin=mysql-bin
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: SQL Server: To restore a full backup in SQL Server: - Full Restore RESTORE DATABASE MyDatabase FROM DISK = 'C:\Backups\MyDatabase.bak'; - Transaction Log Restore RESTORE LOG MyDatabase FROM DISK = 'C:\Backups\MyDatabase_log.trn'; To restore a database to a specific point in time (using point-in-time recovery), you would restore the full backup and apply transaction logs.
RESTORE DATABASE MyDatabase FROM DISK = 'C:\Backups\MyDatabase.bak'; RESTORE LOG MyDatabase FROM DISK = 'C:\Backups\MyDatabase_log.trn' WITH STOPAT = '2023-09-14T15:30:00'; -- Restore to a specific time PostgreSQL: To restore a backup from a pg_dump: - Full Restore from SQL dump psql -U username -d mydatabase < /path/to/backup/mydatabase.sql For binary dump (pg_dump -Fc): pg_restore -U username -d mydatabase /path/to/backup/mydatabase.dump MySQL: To restore a MySQL database: - Full Restore from SQL dump mysql -u username -p mydatabase < /path/to/backup/mydatabase.sql For restoring binary logs: mysqlbinlog /path/to/binlog/mysql-bin.000001 | mysql -u username -p
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: Automating backups ensures that backups are performed regularly and without manual intervention. You can use the following methods:
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: Database replication is the process of copying and maintaining database objects in multiple databases to ensure high availability and fault tolerance. Types of Replication:
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: Sharding and partitioning are techniques used to distribute data across multiple servers or tables to improve performance and scalability.
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: Monitoring database performance is crucial for identifying bottlenecks and ensuring optimal functioning. The following methods are commonly used:
ShopNest adds an index on Orders(CustomerId, CreatedAt) because “my recent orders” is queried constantly.
SQL & Databases SQL Server Tutorial · SQL
Short answer: A connection pool is a cache of database connections that are maintained so that connections can be reused when future requests to the database are made.
Instead of opening and closing a new connection each time a query is executed, the application can reuse existing connections from the pool. How it helps with scaling: Improves efficiency: Reusing connections reduces the overhead of establishing new connections, leading to faster query execution. Reduces resource consumption: By limiting the number of connections to the database, the pool avoids overloading the database with too many open connections. Improves scalability: Connection pools help handle a large number of requests without overwhelming the database. The pool can be scaled by adjusting the maximum number of connections based on the workload. Example: A connection pool size can be set to 100, meaning up to 100 connections to the database can be active at once, with others waiting in line for an available connection.
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: Multi-tenancy refers to a single instance of a database serving multiple tenants (clients or organizations) while keeping their data isolated. Approaches:
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: And ensuring consistency across different environments (development, staging, production). pproaches:
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: Managing and versioning database schema changes is essential in keeping track of updates and ensuring consistency across different environments (development, staging, production). Approaches:
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: Data migration involves transferring data between systems or platforms, often when changing database engines or moving to the cloud. Steps:
ShopNest’s SQL Server database stores customers, products, and orders. Good indexes and clear foreign keys keep checkout queries fast and safe.
SQL & Databases SQL Server Tutorial · SQL
Short answer: The ACID properties ensure reliable processing of database transactions:
Checkout wraps stock decrement + order insert in a transaction so you never sell stock you do not have.
Salary Negotiation Career & HR Interview Guide · Salary Negotiation
Short answer: Your hike target should be based on market demand, not only your current CTC. If your skill set is niche or revenue-linked, you can justify a stronger jump than a standard lateral move. Always decide a target, an acceptable minimum, and a walk-away number before interviews close.
Ananya, a backend engineer at Infosys, got interview calls from Zoho and Freshworks. She realized one role included architecture ownership and weekend release responsibility, so she increased her expected hike ask. Vikram reviewed her compensation sheet and helped her compare fixed pay versus variable components. She negotiated a stronger final number at Zoho with better in-hand salary and accepted.
Hi [Recruiter Name], thank you for the offer details. Based on current market compensation for this scope and my recent outcomes in [domain], I am targeting a total CTC in the range of [X]-[Y], with stronger fixed pay preference. I am very interested in joining and would appreciate if we can review the offer once.
Decide your walk-away number before negotiation starts.
Salary Negotiation Career & HR Interview Guide · Salary Negotiation
Short answer: To negotiate a higher CTC, you must demonstrate higher expected impact. Recruiters can stretch budgets when they can justify your value to hiring managers and finance. Build your case around outcomes, not effort or tenure.
Meera interviewed at CRED for a senior Android role while working at Freshworks. She prepared a scorecard showing app crash-rate reduction, payment success uplift, and release turnaround improvements from her past projects. The recruiter said the band was tight, so Meera offered two structure options. CRED approved a higher CTC with a better fixed portion and a joining bonus to close quickly.
I am very positive about this role. Based on interview scope and the outcomes I have delivered in similar responsibilities, is there flexibility to move the offer closer to [target range]? I am open to discussing structure options to make this workable.
Give alternatives; flexibility increases approval probability.
Salary Negotiation Career & HR Interview Guide · Salary Negotiation
Short answer: Experienced candidates are evaluated on ownership depth, not just technical skills. Your negotiation should show that you can de-risk delivery, mentor teams, and improve business outcomes quickly. The stronger your leadership evidence, the more room you have to negotiate compensation structure.
Vikram, a senior engineer at HCL, interviewed for a staff role at PhonePe. He highlighted how he mentored 11 engineers and reduced release rollback incidents by 41% across two quarters. Neha from Flipkart helped him frame this as leadership leverage rather than only coding output. PhonePe revised his package with better fixed pay, a buyout component, and clearer bonus terms.
For experienced roles, negotiate based on scope leverage.