Wednesday, 15 October 2025

SQL Server Interview Question Answer

1. Find duplicate records in a table (Amazon)

SELECT column1, column2, COUNT(*)
FROM your_table
GROUP BY column1, column2
HAVING COUNT(*) > 1;

 

2. Retrieve the second highest salary from Employee table ()

SELECT MAX(salary) AS SecondHighestSalary
FROM Employee
WHERE salary < (SELECT MAX(salary) FROM Employee);

 

3. Find employees without department (Uber)

SELECT e.*
FROM Employee e
LEFT JOIN Department d ON e.department_id = d.department_id
WHERE d.department_id IS NULL;

 

4. Calculate the total revenue per product (PayPal)

SELECT product_id, SUM(quantity * price) AS total_revenue FROM Sales
GROUP BY product_id;

 

5. Get the top 3 highest-paid employees (Google)

SELECT TOP 3 * FROM Employee
ORDER BY salary DESC;

 

6. Customers who made purchases but never returned products (Walmart)

SELECT DISTINCT c.customer_id
FROM Customers c
JOIN Orders o ON c.customer_id = o.customer_id
WHERE c.customer_id NOT IN (SELECT customer_id FROM Returns);

 

7. Show the count of orders per customer (Meta)

SELECT customer_id, COUNT(*) AS
rder_count
FROM Orders
GROUP BY customer_id;

 

8. Retrieve all employees who joined in 2023 (Amazon)

SELECT * FROM Employee
WHERE YEAR(hire_date) = 2023;

 

9. Calculate average order value per customer (Microsoft)

SELECT customer_id, AVG(total_amount) AS avg_order_value
FROM Orders
GROUP BY customer_id;

 

10. Get the latest order placed by each customer (Uber)

SELECT customer_id, MAX(order_date) AS latest_order_date FROM Orders
GROUP BY customer_id;

 

11. Find products that were never sold ()

SELECT p.product_id FROM Products p
LEFT JOIN Sales s ON p.product_id = s.product_id
WHERE s.product_id IS NULL;

 

12. Identify the most selling product (Adobe/Walmart)

SELECT TOP 1 product_id, SUM(quantity) AS total_qty
FROM Sales
GROUP BY product_id
ORDER BY total_qty DESC;

 

13. Get total revenue and number of orders per region (Meta)

SELECT region, SUM(total_amount) AS total_revenue, COUNT(*) AS order_count

FROM Orders

GROUP BY region;

 

14. Count customers with more than 5 orders (Amazon)

SELECT COUNT(*) AS customer_count

FROM (

 SELECT customer_id FROM Orders

 GROUP BY customer_id

 HAVING COUNT(*) > 5

) AS subquery;

 

15. Retrieve customers with orders above average order value (PayPal)

SELECT *

FROM Orders

WHERE total_amount > (SELECT AVG(total_amount) FROM Orders);

 

16. Find all employees hired on weekends (Google)

SELECT *

FROM Employee

WHERE DATENAME(WEEKDAY, hire_date) IN ('Saturday', 'Sunday');

 

17. Find all employees with salary between 50000 and 100000 (Microsoft)

SELECT *

FROM Employee

WHERE salary BETWEEN 50000 AND 100000;

 

18. Get monthly sales revenue and order count (Google)

SELECT FORMAT(date, 'yyyy-MM') AS month,

 SUM(amount) AS total_revenue,

 COUNT(order_id) AS order_count

FROM Orders

GROUP BY FORMAT(date, 'yyyy-MM');

 

19. Rank employees by salary within each department (Amazon)

SELECT employee_id, department_id, salary,

 RANK() OVER (PARTITION BY department_id ORDER BY salary DESC) AS salary_rk

FROM Employee;

 

20. Find customers who placed orders every month in 2023 (Meta)

SELECT customer_id

FROM Orders

WHERE YEAR(order_date) = 2023

GROUP BY customer_id

HAVING COUNT(DISTINCT FORMAT(order_date, 'yyyy-MM')) = 12;

 

21. Find moving average of sales over the last 3 days (Microsoft)

SELECT order_date,

 AVG(total_amount) OVER (ORDER BY order_date ROWS BETWEEN 2 PRECEDING AND CURRENT ROW)

FROM Orders;

 

22. Identify the first and last order date for each customer (Uber)

SELECT customer_id, MIN(order_date) AS first_order, MAX(order_date) AS last_order

FROM Orders

GROUP BY customer_id;

 

23. Show product sales distribution (percent of total revenue) (PayPal)

WITH TotalRevenue AS (

 SELECT SUM(quantity * price) AS total FROM Sales

)

SELECT s.product_id,

 SUM(s.quantity * s.price) AS revenue,

 SUM(s.quantity * s.price) * 100 / t.total AS revenue_pct

FROM Sales s

CROSS JOIN TotalRevenue t

GROUP BY s.product_id, t.total;

 

24. Retrieve customers who made consecutive purchases (2 Days) (Walmart)

WITH cte AS (

 SELECT id, order_date,

 LAG(order_date) OVER (PARTITION BY id ORDER BY order_date) AS prev_order_date

 FROM Orders

)

SELECT id, order_date, prev_order_date

FROM cte

WHERE DATEDIFF(DAY, prev_order_date, order_date) = 1;

 

25. Find churned customers (no orders in the last 6 months) (Amazon)

SELECT customer_id

FROM Orders

GROUP BY customer_id

HAVING MAX(order_date) < DATEADD(MONTH, -6, GETDATE());

 

26. Calculate cumulative revenue by day (Adobe)

SELECT order_date,

 SUM(total_amount) OVER (ORDER BY order_date) AS cumulative_revenue

FROM Orders;

 

27. Identify top-performing departments by average salary (Google)

SELECT department_id, AVG(salary) AS avg_salary

FROM Employee

GROUP BY department_id

ORDER BY avg_salary DESC;

 

28. Find customers who ordered more than the average number of orders per

customer (Meta)

WITH customer_orders AS (

 SELECT customer_id, COUNT(*) AS order_count

 FROM Orders

 GROUP BY customer_id

)

SELECT * FROM customer_orders

WHERE order_count > (SELECT AVG(order_count) FROM customer_orders);

 

29. Calculate revenue generated from new customers (first-time orders) (Microsoft)

WITH first_orders AS (

 SELECT customer_id, MIN(order_date) AS first_order_date

 FROM Orders

 GROUP BY customer_id

)

SELECT SUM(o.total_amount) AS new_revenue

FROM Orders o

JOIN first_orders f ON o.customer_id = f.customer_id

WHERE o.order_date = f.first_order_date;

 

30. Find the percentage of employees in each department (Uber)

SELECT department_id, COUNT(*) AS emp_count,

 COUNT(*) * 100.0 / (SELECT COUNT(*) FROM Employee) AS pct

FROM Employee

GROUP BY department_id;

 

31. Retrieve the maximum salary difference within each department (PayPal)

SELECT department_id,

 MAX(salary) - MIN(salary) AS salary_diff

FROM Employee

GROUP BY department_id;

 

32. Find products that contribute to 80% of the revenue (Pareto Principle)

(Walmart)

WITH sales_cte AS (

 SELECT product_id, SUM(qty * price) AS revenue

 FROM Sales

 GROUP BY product_id

),

total_revenue AS (

 SELECT SUM(revenue) AS total FROM sales_cte

)

SELECT s.product_id, s.revenue,

 SUM(s.revenue) OVER (ORDER BY s.revenue DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURR

FROM sales_cte s, total_revenue t

WHERE SUM(s.revenue) OVER (ORDER BY s.revenue DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRE

 

33. Calculate average time between two purchases for each customer (Meta)

WITH cte AS (

 SELECT customer_id, order_date,

 LAG(order_date) OVER (PARTITION BY customer_id ORDER BY order_date) AS prev_date

 FROM Orders

)

SELECT customer_id,

 AVG(DATEDIFF(DAY, prev_date, order_date)) AS avg_gap_days

FROM cte

WHERE prev_date IS NOT NULL

GROUP BY customer_id;

 

34. Show last purchase for each customer along with order amount (Google)

WITH ranked_orders AS (

 SELECT customer_id, order_id, total_amount,

 ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY order_date DESC) AS rn

 FROM Orders

)

SELECT customer_id, order_id, total_amount

FROM ranked_orders

WHERE rn = 1;

 

35. Calculate year-over-year growth in revenue (Microsoft)

SELECT FORMAT(order_date, 'yyyy') AS year,

 SUM(total_amount) AS revenue,

 SUM(total_amount) - LAG(SUM(total_amount)) OVER (ORDER BY FORMAT(order_date, 'yyyy'))

FROM Orders

GROUP BY FORMAT(order_date, 'yyyy');

 

36. Detect customers whose purchase amount is higher than their historical 90th

percentile (Amazon)

WITH ranked_orders AS (

 SELECT customer_id, order_id, total_amount,

 NTILE(10) OVER (PARTITION BY customer_id ORDER BY total_amount) AS decile

 FROM Orders

)

SELECT customer_id, order_id, total_amount

FROM ranked_orders

WHERE decile = 10;

 

37. Retrieve the longest gap between orders for each customer (Meta)

WITH cte AS (

 SELECT customer_id, order_date,

 LAG(order_date) OVER (PARTITION BY customer_id ORDER BY order_date) AS prev_order_da

 FROM Orders

)

SELECT customer_id,

 MAX(DATEDIFF(DAY, prev_order_date, order_date)) AS max_gap

FROM cte

WHERE prev_order_date IS NOT NULL

GROUP BY customer_id;

 

38. Identify customers with revenue below the 10th percentile (Google)

WITH cte AS (

 SELECT customer_id, SUM(total_amount) AS total_revenue

 FROM Orders

 GROUP BY customer_id

)

SELECT customer_id, total_revenue

FROM cte

WHERE total_revenue < (

 SELECT PERCENTILE_CONT(0.1) WITHIN GROUP (ORDER BY total_revenue) FROM cte

);

 


Friday, 1 August 2025

R1RCM Interview for RPA AA360

 Interviewer :  Abhishek and Panday & Baijnath HR


Q1- Introduction yourself and professional experience

Q2-what is controler in MVC

Q3-What is viewbag

Q4-whats your current project

Q5-whats your Role

Q6-Automation Life Cycle

Q7-Automation Best Practice

Q8-AARI Framework

Q9-what is Trigeer 

Q10- how you will handle if any event occurs for folder or file or others

Q11-Exception handling
Q12-Credential mamager
Q13-whats the othersway to credential manager other then CyberArk

Q14-CyberArk Architecture in behind
Q15-How you can manage credentail in Automation Anywhere
Q16-Whats the Encryption
Q17-Types the Encrption
Q18-Different name of Encrytion algorithm and how to do that
Q19-whats the challenges you face ith RPA
Q20-Types of Exceptions
Q21-Who is responsible for Logical error
Q22-whats the best way to find element on  web page
Q23- How you will handle for issue if Element position change in page in future    then how you fix and whats the best way
Q24-how you will design Automation framework
Q25-have you install AA in your machine now
Q26-in which language you are comfortable
Q-27 write C# code to check prime number in compiler

Q-28  We are Done you want to ask something
Q-29 You need .Net mostly question so de we are working on .net or Automation?
Q30-Are we using Automation advance like API Gen AI and cloud
Q31- are we Product base company or Service Base
Q32- its a support work or Development work , because you ask mostly support suestion


Here’s a complete and professional set of interview answers tailored for your profile (13+ years in IT, 9+ years in RPA with AA, .NET knowledge, working in BFSI and healthcare domains):


Q1. Introduce yourself and your professional experience.

Hi, my name is Rakesh Kumar. I have 13+ years of overall IT experience, including over 9 years in Robotic Process Automation. I’ve worked extensively with Automation Anywhere (both v11 and A360), and I’m certified at both the Advanced and Master levels. My core expertise lies in architecting automation solutions, developing bots, and integrating with APIs and external systems. I’ve worked in BFSI, healthcare, and life sciences domains and had overseas experience in Malaysia and Uruguay. I’ve led multiple end-to-end automation implementations and currently work as a Senior RPA Specialist.


Q2. What is a Controller in MVC?

In MVC, a Controller handles incoming user requests, processes the data via business logic or model, and returns the appropriate view. It's the main decision-maker that connects the Model and the View.


Q3. What is ViewBag?

ViewBag is a dynamic property in ASP.NET MVC used to pass data from Controller to View during runtime without using a strongly typed model.


Q4. What's your current project?

I’m currently working on automating financial reconciliation and document processing workflows using Automation Anywhere A360, integrating it with APIs, Excel automation, and SQL Server. It includes audit trail, logging, exception handling, and secure credential management.


Q5. What’s your role?

I’m playing the role of Solution Architect and lead developer. I’m responsible for requirement analysis, bot design, review, deployment, performance optimization, client demos, and mentoring junior developers.


Q6. Automation Life Cycle?

  1. Opportunity Identification

  2. Process Assessment

  3. Solution Design

  4. Development

  5. Testing (UAT & SIT)

  6. Deployment

  7. Monitoring & Support

  8. Maintenance & Enhancements


Q7. Automation Best Practices

  • Use config files for dynamic values

  • Implement proper exception handling

  • Create reusable sub-bots

  • Maintain proper logging and audit trail

  • Use credential vaults for security

  • Follow naming conventions and documentation


Q8. What is AARI Framework?

AARI (Automation Anywhere Robotic Interface) allows users to trigger bots via a web-based or desktop interface for attended automation. It helps in human-in-the-loop scenarios.


Q9. What is a Trigger?

A trigger is an event that initiates the bot, such as:

  • File creation/modification

  • Email arrival

  • Schedule-based

  • Database event


Q10. How to handle file/folder events?

Use the Trigger Package in A360, set it for a folder path, and define which event (create/delete/modify) should trigger the bot. Use error handling and logs for robustness.


Q11. Exception Handling

I use Try-Catch blocks and ErrorHandler sub-bots to log error details like:

  • Form/Function Name

  • Line Number

  • Screenshot

  • Error Message
    I also send email alerts using the Email package.


Q12. Credential Manager

In AA, the Credential Vault securely stores credentials. You can create lockers, assign access, and fetch credentials using the Credential package.


Q13. Alternatives to CyberArk

  • Azure Key Vault

  • AWS Secrets Manager

  • HashiCorp Vault

  • AA Credential Vault

  • KeePass (in small orgs)


Q14. CyberArk Architecture

CyberArk stores credentials in a secure Vault Server. Bots authenticate via a connector or plugin, retrieve credentials using policies, and never expose them in plain text. It uses secure APIs and logs all access.


Q15. How to manage credentials in AA?

Use Credential Vault:

  • Create a locker

  • Add credentials

  • Assign access

  • Use the “Get Credential” action to fetch values during bot execution securely


Q16. What is Encryption?
Encryption is the process of converting readable data into an unreadable format to protect it from unauthorized access.


Q17. Types of Encryption

  • Symmetric Encryption (Same key)

  • Asymmetric Encryption (Public/Private key pair)


Q18. Encryption Algorithms

  • AES (Advanced Encryption Standard)

  • RSA (Rivest–Shamir–Adleman)

  • DES (Data Encryption Standard)

  • Blowfish
    Example in .NET:

csharp
using System.Security.Cryptography;


Q19. Challenges faced in RPA

  • Unstable UI selectors

  • Credential management

  • Handling unstructured data (PDFs/emails)

  • Delay in backend response

  • Process changes post-deployment


Q20. Types of Exceptions

  • Application Exception

  • Business Rule Exception

  • System Exception

  • Timeout Exception


Q21. Who is responsible for Logical Errors?

The developer is responsible for logical errors due to incorrect flow or calculations.


Q22. Best way to find a web element?

  • Use stable attributes like id, name, class

  • Prefer XPath or CSS selectors

  • Use AA's Object Cloning or Universal Recorder with fallback logic


Q23. How to handle element position change?

Use dynamic locators, wildcards, or anchor-based methods. Maintain a central selector repository or config and use retry with timeout logic.


Q24. How do you design an automation framework?

I use modular architecture:

  • Main bot calls reusable sub-bots

  • Config-driven design

  • Separate folders for Logs, Screenshots, Inputs

  • ErrorHandler sub-bot

  • Credential locker access

  • Audit Trail DB logging


Q25. Have you installed AA in your machine?

Yes, I have Automation Anywhere A360 Community Edition and enterprise experience. I use it for PoCs and testing.


Q26. Which language are you comfortable with?

Primarily C#, VB.NET, Python, and scripting in Automation Anywhere.


Q27. C# Code to Check Prime Number

csharp
int number = 29; bool isPrime = true; for (int i = 2; i <= number / 2; i++) { if (number % i == 0) { isPrime = false; break; } } Console.WriteLine(isPrime ? "Prime" : "Not Prime");

Q28. Do you have any questions for us?

Yes, I’d like to know:

  • What is the team structure?

  • Are there any plans to integrate GenAI or advanced analytics into your automation roadmap?

  • What would success look like in this role within the first 3 months?


Q29. Are we working on .NET or Automation?

From the discussion, I sense both technologies are important. Could you clarify the percentage of work expected on .NET and Automation?


Q30. Are we using advanced Automation like API, GenAI, Cloud?

That’s great if the organization is exploring these. I have experience in REST APIs and am exploring GenAI integrations for document understanding. Would love to contribute.


Q31. Is it a Product or Service-based company?

Just to align better, could you please confirm if it's a product-based company or a service provider?


Q32. Is it Support or Development work?

That’s a helpful distinction. Since many questions were support-oriented, I’d love to confirm if the role is focused more on support or on development and design.

Monday, 14 July 2025

Power Automate Interview Questions & Answers for Experienced Developers & Solution Architects

 

Power Automate Interview Questions & Answers for Experienced Developers & Solution Architects

Technical Depth Questions

Q: Explain how to handle concurrency issues in Power Automate flows?

A: To handle concurrency:

  1. Use the "Configure run after" settings to add retry logic when actions fail due to concurrency

  2. Implement locking mechanisms using SharePoint list items or Dataverse rows as semaphores

  3. For critical operations, use the "Do until" loop with proper exit conditions

  4. Consider using Azure Service Bus queues to serialize operations

  5. Implement proper error handling with scope blocks and parallel branch isolation

Q: How would you optimize a flow that processes thousands of records daily?

A: Optimization strategies:

  1. Implement batch processing with appropriate limits (e.g., 100 records per batch)

  2. Use filter queries at the trigger level to reduce dataset size

  3. Replace multiple individual actions with array operations where possible

  4. Implement parallel processing with appropriate degree of parallelism

  5. Cache frequently accessed data using variables or compose actions

  6. Consider moving complex logic to Azure Functions

  7. Monitor and analyze performance using Flow Analytics

Architecture Questions

Q: When would you recommend using Power Automate vs Logic Apps?

A: The choice depends on:

  1. Power Automate is better for:

    • Citizen developer scenarios

    • Departmental workflows

    • SharePoint/Dynamics 365-centric automation

    • Scenarios requiring UI flows

    • Simpler, more frequent triggers

  2. Logic Apps is better for:

    • Enterprise-scale integrations

    • Complex transformation scenarios

    • When advanced connectors are needed

    • Scenarios requiring VNET integration

    • More sophisticated error handling patterns

    • When ISE (Integration Service Environment) is required

Q: Describe your approach to error handling in complex flow architectures

A: Comprehensive error handling approach:

  1. Implement a multi-layered strategy with scope blocks for logical sections

  2. Use parallel branches with individual error handling

  3. Create a centralized error logging system (e.g., SharePoint list, Log Analytics)

  4. Implement retry policies with exponential backoff

  5. Design compensation logic for partial failures

  6. Create alert mechanisms for critical failures

  7. Document expected exceptions and business continuity procedures

  8. Consider implementing a circuit breaker pattern for external system failures

Advanced Scenario Questions

Q: How would you implement an approval process with dynamic approvers based on business rules?

A: Solution approach:

  1. Use the Office 365 Approvals connector as foundation

  2. Create a metadata store (SharePoint list/Dataverse) for approval rules

  3. Implement a preprocessing flow to determine approvers based on:

    • Amount thresholds

    • Department/cost center

    • Requester's manager hierarchy

    • Delegation rules

  4. Use adaptive cards for rich approval experiences

  5. Implement escalation paths for overdue approvals

  6. Consider integrating with Azure AD for organizational data

  7. Add conditional branching for multi-stage approvals

Q: Explain how you would migrate complex flows between environments

A: Robust migration strategy:

  1. Use solutions with managed/unmanaged components for proper ALM

  2. Implement export/import of solutions with all dependencies

  3. For non-solution aware flows, use Power Automate CLI or PowerShell

  4. Create environment variables for configuration differences

  5. Implement a post-deployment configuration step

  6. Document all connection references and security requirements

  7. Consider using Azure DevOps pipelines for CI/CD

  8. Always test in a staging environment before production

Performance & Monitoring

Q: What techniques do you use to troubleshoot performance issues in production flows?

A: Troubleshooting methodology:

  1. Start with Flow Analytics to identify bottlenecks

  2. Check action durations and API call response times

  3. Analyze trigger frequency and concurrency patterns

  4. Review run history for timeout patterns

  5. Check for N+1 query problems (many individual calls instead of batches)

  6. Monitor connector throttling indicators

  7. Use Application Insights integration for advanced telemetry

  8. Consider implementing custom logging to Azure Log Analytics

  9. Review action counts against service limits

Integration Patterns

Q: How would you design a solution that integrates Power Automate with on-premises systems?

A: Integration approaches:

  1. Use the on-premises data gateway for supported connectors

  2. Implement Azure Service Bus as an integration broker

  3. Create custom connectors wrapping on-prem APIs

  4. Use Azure API Management as a facade

  5. Consider Azure Logic Apps as an intermediary for complex transformations

  6. For file-based integrations, use Azure Blob Storage as a staging area

  7. Implement proper security with certificate-based authentication

  8. Design for resiliency with retry patterns and dead-letter queues

Governance & Best Practices

Q: What governance policies would you implement for Power Automate in a large organization?

A: Governance framework:

  1. Environment strategy (dev/test/prod separation)

  2. Naming conventions for flows and connections

  3. Solution management policies

  4. Connection sharing and security model

  5. Approval processes for production deployments

  6. Monitoring and alerting standards

  7. Documentation requirements

  8. Retention policies for flow run history

  9. Training and certification requirements

  10. Center of Excellence oversight model

Q: How do you approach solution documentation for complex Power Automate implementations?

A: Documentation approach:

  1. Architecture diagrams showing system boundaries

  2. Data flow diagrams for complex processes

  3. Decision logs for key design choices

  4. Dependency matrices for connectors and systems

  5. Error handling specifications

  6. Runbook for operational support

  7. Business process mapping

  8. Security and compliance documentation

  9. Maintenance procedures

  10. Known limitations and workarounds

These questions and answers cover the depth expected for experienced Power Automate developers and solution architects, focusing on both technical implementation and architectural considerations.