Automation & APIs Interview Preparation Guide covers AWS Lambda, Python, Shell Scripting, PowerShell, Power Automate, Power Apps, REST APIs, SharePoint SPFx, and Node.js. This is not an exhaustive list of every possible question (as interviews vary by role, seniority, and company), but it includes the most common, foundational, scenario-based, and advanced questions with detailed answers.
Focus on understanding concepts, trade-offs, best practices, troubleshooting, and real-world application. Prepare code examples, especially for scripting and Lambda.
1. AWS Lambda Serverless Functions
Common Questions:
- What is AWS Lambda, and how does it work? AWS Lambda is a serverless compute service that runs code in response to events without provisioning or managing servers. You upload code; Lambda handles scaling, patching, and high availability. It executes in a stateless execution environment (container) triggered by events (e.g., S3 upload, API Gateway HTTP request, CloudWatch). Code runs up to 15 minutes (configurable), with pay-per-use billing (duration + requests).
- Explain cold starts vs. warm starts and how to mitigate cold starts. A cold start occurs when Lambda initializes a new execution environment (downloads code, initializes runtime, runs init code). This adds latency (hundreds of ms to seconds). Warm starts reuse environments. Mitigation: Provisioned Concurrency (pre-warm environments), keep functions small/light, use languages with faster cold starts (e.g., Node.js/Python over Java), optimize dependencies, or use SnapStart for Java.
- How does Lambda integrate with API Gateway? What are benefits/limitations? API Gateway acts as a front door, handling HTTP requests, throttling, caching, and routing to Lambda. Benefits: Serverless API, auth (Cognito), custom domains. Limitations: Cold starts affect latency; payload limits (6MB sync); costs for high traffic.
- What are Lambda layers, and when do you use them? Layers package reusable code/libraries (e.g., dependencies) shared across functions. Use for common utilities to reduce deployment package size and improve maintainability.
- Scenario: Process files uploaded to S3. Create Lambda triggered by S3 ObjectCreated event. Use Boto3 (Python) or SDK to read/process the file, then store results (e.g., DynamoDB, another S3). Handle retries with DLQ (Dead Letter Queue).
Other topics: IAM roles/permissions, environment variables/secrets (Secrets Manager), concurrency limits/reserved concurrency, versioning/aliases, monitoring (CloudWatch/X-Ray), stateless design, and integration with Step Functions for orchestration.
2. Python for Automation
Common Questions:
- How do you automate file downloads or REST API interactions in Python? Use requests for APIs: response = requests.get(url, headers=…); handle JSON with .json(). For downloads: requests.get(url, stream=True) + write chunks to file. Add error handling with try/except, retries (tenacity or requests.adapters), and logging.
- Explain error handling and robustness in automation scripts. Use try/except/finally/else. Specific exceptions (e.g., requests.exceptions.Timeout). Logging (logging module), retries, input validation, and graceful degradation.
- How do you work with subprocess, virtual environments, and OS interactions? subprocess.run() for shell commands (safer than os.system). venv for isolated environments. Use pathlib or os/shutil for files.
- Scenario-based: Automate data extraction from PDF/CSV, web scraping (with BeautifulSoup/Selenium), or batch processing.
Key libraries: boto3 (AWS), pandas (data), paramiko/fabric (SSH), schedule/APScheduler for tasks. Best practices: Modular code, config files (YAML/JSON), testing (pytest), and idempotency.
3. Shell Scripting (Bash)
Common Questions:
- What is a shell script, and how do you make one executable? A text file with commands and logic. Shebang (#!/bin/bash), chmod +x script.sh.
- Explain loops, conditionals, functions, and pipelines. for, while, if/elif/else, case. Functions: myfunc() { … }. Pipes: cmd1 | cmd2.
- How do you handle errors, logging, and scheduling? set -euo pipefail. Redirect output (>> log.txt 2>&1). cron for scheduling; debug with crontab -e and logs.
- Scenario: Backup script with compression, checks, and rollback.
Best practices: Use quotes, avoid parsing ls, prefer find/xargs, getopts for args.
4. PowerShell
Common Questions:
- What is PowerShell, and how does it differ from cmd.exe or Bash? Object-oriented shell and scripting language (cross-platform in Core). Cmdlets return objects (not text), enabling powerful pipelining (e.g., Get-Process | Where-Object).
- Explain cmdlets, aliases, modules, and pipeline. Cmdlets (verb-noun, e.g., Get-ChildItem). Aliases (e.g., ls). Modules import reusable code. Pipeline passes objects.
- How do you handle remote execution, errors, and services? Invoke-Command or PSSessions (WinRM). Try/Catch. Start-Service, Get-Service.
- Scenario: Script to manage servers from a list, ping/test services, log results.
Advanced: Advanced functions ([CmdletBinding()]), classes, Desired State Configuration (DSC), error streams.
5. Power Automate & Power Apps
Common Questions:
- What are Power Apps and Power Automate? How do they integrate? Power Apps: Low-code for building apps (Canvas/Model-driven). Power Automate: Low-code workflows/automation (flows: automated, instant, scheduled). Trigger flows from apps via PowerAutomate.Run().
- Explain connectors, triggers, actions, and data sources (e.g., Dataverse, SharePoint). Connectors link services. Triggers start flows. Delegable queries for performance with large data.
- How do you handle performance, approvals, and errors? Minimize data loading, use collections judiciously, move heavy logic to flows. Parallel branches, scopes for error handling.
- Scenario: Build an app with form submission triggering approval flow and notifications.
Governance, licensing, and integration with Azure/Graph are key for senior roles.
6. REST APIs
Common Questions:
- What is REST? Key principles? Representational State Transfer: Stateless, client-server, cacheable, layered, uniform interface (resources via URIs, HTTP methods).
- HTTP methods and idempotency? Differences between PUT/PATCH/POST? GET (read), POST (create), PUT (replace/update, idempotent), PATCH (partial update), DELETE. Idempotent: Same request yields same result (PUT/DELETE).
- Status codes, versioning, authentication? 2xx success, 4xx client error, 5xx server. Versioning (URI, header, query). Auth: OAuth2, JWT, API keys.
- Best practices and differences from SOAP. Nouns for resources, HATEOAS (optional), JSON. SOAP is protocol-based, XML, WS-*, more rigid.
7. SharePoint SPFx
Common Questions:
- What is SPFx? How does it differ from classic add-ins? Client-side development model for SharePoint Online/On-Prem. Runs in browser context (no iFrame like add-ins), uses modern toolchain (Node, React/Angular).
- Key components and setup? Web parts, extensions (Application Customizer, Field, Command Set), libraries. Setup: Node, Yeoman generator, gulp serve/trust-dev-cert.
- Deployment, React integration, and data access? gulp bundle –ship && gulp package-solution –ship. Use @pnp/sp or REST/Graph for data. Context for auth.
- Performance and versioning.
8. Node.js (for APIs/Automation)
Common Questions:
- What is Node.js? Event loop and asynchronous model? Single-threaded, event-driven runtime for JS outside browser. Event loop handles async ops (libuv). Non-blocking I/O.
- How to build a REST API? Modules like Express? Express for routing/middleware. Use async/await, error handling. Clustering/PM2 for scaling.
- Streams, Worker Threads, error handling? Streams for efficient I/O. Workers for CPU-intensive tasks. try/catch + domains or process events.
- Best practices: Environment vars, security (helmet, rate-limiting), testing (Jest), deployment.
Cross-Topic Scenarios:
- Automate deployment pipeline using Lambda + PowerShell/Python + Node scripts + REST calls to SharePoint.
- Integrate Power Apps with Lambda via API Gateway or Power Automate.
- Secure APIs (auth, CORS, validation).
- Troubleshooting: Logging, monitoring, performance (e.g., Lambda cold starts, script timeouts).
Preparation Tips:
- Practice coding: Simple Lambda, Bash/PowerShell scripts, Express API, SPFx web part.
- Understand integrations (e.g., Microsoft Graph, AWS SDKs).
- Discuss trade-offs (serverless vs. servers, low-code vs. pro-code).
- Review official docs and recent updates.
This covers core areas for roles in automation, DevOps, or Microsoft 365/SharePoint/AWS development. Tailor depth to the job (e.g., more architecture for senior roles).
This guide covers the most common interview topics for:
- AWS Lambda (Serverless Functions)
- Python Automation
- Shell Scripting (Linux)
- PowerShell Automation
- Power Automate
- Power Apps
- REST APIs
- SharePoint Framework (SPFx)
- Node.js
- Enterprise Automation Architecture
1. AWS Lambda (Serverless Functions)
Q1. What is AWS Lambda?
Answer
AWS Lambda is a serverless compute service that allows developers to run code without provisioning or managing servers.
Key Features
- Event-driven execution
- Automatic scaling
- Pay per execution
- Supports multiple languages:
- Python
- Node.js
- Java
- .NET
- Go
Real-world Example
When a file is uploaded to S3:
S3 Upload
↓
Lambda Trigger
↓
Data Validation
↓
Store Metadata in DynamoDBQ2. What are Lambda Event Sources?
Answer
Lambda can be triggered by:
| Service | Use Case |
|---|---|
| S3 | File Upload |
| DynamoDB Streams | Data Change |
| EventBridge | Scheduling |
| API Gateway | REST APIs |
| SNS | Notifications |
| SQS | Message Processing |
| Kinesis | Streaming Data |
Q3. What is Cold Start?
Answer
Cold start occurs when Lambda creates a new execution environment.
Causes:
- First invocation
- Scaling up
- Long inactivity
Impact:
Normal Invocation = 20ms
Cold Start = 500ms - 5 secSolutions:
- Provisioned Concurrency
- Smaller packages
- Efficient code
Q4. Difference between Lambda and EC2?
| Feature | Lambda | EC2 |
|---|---|---|
| Server Management | No | Yes |
| Scaling | Automatic | Manual/Auto Scaling |
| Billing | Per Request | Per Hour/Second |
| Long Running Jobs | Limited | Suitable |
| Maintenance | AWS | User |
Q5. Lambda Best Practices
Answer
- Keep functions small
- Use environment variables
- Enable CloudWatch Logs
- Use IAM least privilege
- Reuse database connections
- Use Lambda Layers
2. Python Automation
Q6. Why Python for Automation?
Answer
Python provides:
- Easy syntax
- Large libraries
- Cloud SDKs
- Automation frameworks
Popular Libraries:
boto3
requests
pandas
pyodbc
selenium
openpyxl
scheduleQ7. How do you call REST APIs in Python?
Answer
import requests
response = requests.get(
"https://api.example.com/users"
)
print(response.json())Q8. How do you handle API Authentication?
Answer
Methods:
API Key
headers = {
"x-api-key": "123"
}Bearer Token
headers = {
"Authorization":
"Bearer token"
}OAuth
Used in enterprise applications.
Q9. What is Exception Handling?
Answer
try:
result = 10/0
except ZeroDivisionError:
print("Error")
finally:
print("Completed")Benefits:
- Prevents crashes
- Improves reliability
Q10. How do you automate AWS using Python?
Answer
Using Boto3.
Example:
import boto3
s3 = boto3.client('s3')
s3.upload_file(
'file.csv',
'mybucket',
'file.csv'
)3. Shell Scripting (Linux)
Q11. What is Shell Scripting?
Answer
Shell scripting automates Linux operations.
Example:
#!/bin/bash
echo "Hello World"Q12. Difference between Bash and Shell?
Answer
| Shell | Bash |
|---|---|
| Generic | Specific implementation |
| Multiple variants | Most popular |
Q13. How do you pass arguments?
script.sh file.txtecho $1Output:
file.txtQ14. What are loops in Shell?
For Loop
for i in {1..5}
do
echo $i
doneQ15. How do you schedule jobs?
Cron
crontab -eExample:
0 1 * * *
/scripts/job.shRuns daily at 1 AM.
4. PowerShell Automation
Q16. What is PowerShell?
Answer
PowerShell is Microsoft’s automation and configuration management framework.
Used for:
- Windows administration
- Azure automation
- Active Directory
- Office365
Q17. Difference between CMD and PowerShell?
| CMD | PowerShell |
|---|---|
| Text Output | Objects |
| Basic Commands | Advanced Scripting |
| Limited Automation | Enterprise Automation |
Q18. Get Running Services
Get-ServiceSpecific:
Get-Service SpoolerQ19. Read a CSV
Import-Csv users.csvQ20. Call REST API using PowerShell
Invoke-RestMethod `
-Uri https://api.example.com5. Power Automate
Q21. What is Power Automate?
Answer
Power Automate is Microsoft’s low-code workflow automation platform.
Uses:
- Approval workflows
- Notifications
- Data movement
- Integration
Q22. Types of Flows
Automated
Event triggered.
Instant
Button click.
Scheduled
Time based.
Business Process
Guided workflows.
Q23. Example Workflow
New Email
↓
Extract Attachment
↓
Save to SharePoint
↓
Send NotificationQ24. What are Connectors?
Answer
Connectors connect Power Automate to systems.
Examples:
- Outlook
- SharePoint
- Teams
- SQL Server
- Salesforce
Q25. What are Premium Connectors?
Examples:
- SAP
- ServiceNow
- Dataverse
Require licensing.
6. Power Apps
Q26. What is Power Apps?
Answer
Low-code platform for building business applications.
Types:
- Canvas Apps
- Model Driven Apps
- Portal Apps
Q27. Canvas vs Model Driven
| Canvas | Model Driven |
|---|---|
| UI First | Data First |
| Flexible Design | Standardized |
| Custom Screens | Automatic UI |
Q28. What is Dataverse?
Answer
Microsoft’s cloud database for Power Platform.
Benefits:
- Security
- Relationships
- Business Rules
Q29. How does Power Apps integrate with SharePoint?
Power App
↓
SharePoint List
↓
CRUD OperationsQ30. How do you call APIs from Power Apps?
Answer
Using:
- Custom Connectors
- Power Automate
7. REST APIs
Q31. What is REST API?
Answer
REST = Representational State Transfer
Architecture style for web services.
Uses:
HTTP
JSON
URI
StatelessQ32. What are HTTP Methods?
| Method | Purpose |
|---|---|
| GET | Read |
| POST | Create |
| PUT | Update |
| PATCH | Partial Update |
| DELETE | Remove |
Q33. Difference between PUT and PATCH?
PUT:
{
"name":"John",
"age":30
}Replaces resource.
PATCH:
{
"age":31
}Updates only specified fields.
Q34. Common HTTP Status Codes
| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 500 | Internal Error |
Q35. What is Statelessness?
Answer
Server does not store client state.
Each request contains all information needed.
Benefits:
- Scalability
- Reliability
Q36. What is Idempotency?
Answer
Repeated execution produces same result.
Examples:
GET → Idempotent
PUT → Idempotent
DELETE → Idempotent
POST → Not IdempotentQ37. Authentication vs Authorization?
| Authentication | Authorization |
|---|---|
| Who are you? | What can you access? |
Examples:
- OAuth
- JWT
- API Keys
Q38. What is JWT?
Answer
JSON Web Token.
Structure:
Header.Payload.SignatureUsed in microservices authentication.
Q39. What is OAuth 2.0?
Answer
Industry standard authorization framework.
Flow:
User
↓
Identity Provider
↓
Access Token
↓
API AccessQ40. API Rate Limiting
Answer
Controls request volume.
Example:
1000 Requests / MinutePrevents:
- Abuse
- DDoS
- Overloads
8. SharePoint SPFx
Q41. What is SPFx?
Answer
SharePoint Framework.
Microsoft framework for SharePoint customizations.
Uses:
- Web Parts
- Extensions
- Teams Apps
Q42. SPFx Tech Stack
- TypeScript
- React
- Node.js
- Gulp
- Yeoman
Q43. SPFx Lifecycle
Initialize
↓
Render
↓
DisposeQ44. What is a Web Part?
Answer
Reusable UI component on SharePoint pages.
Examples:
- Dashboard
- Reports
- Forms
Q45. SPFx vs SharePoint Add-ins
| SPFx | Add-ins |
|---|---|
| Modern | Legacy |
| Client Side | External Hosting |
| Faster | More Complex |
9. Node.js
Q46. What is Node.js?
Answer
Node.js is a JavaScript runtime built on Chrome V8 Engine.
Benefits:
- Event-driven
- Non-blocking
- High performance
Q47. Why Node.js for APIs?
Answer
Ideal for:
- REST APIs
- Microservices
- Real-time apps
Q48. What is NPM?
Answer
Node Package Manager.
Install package:
npm install expressQ49. What is Express.js?
Answer
Most popular Node.js web framework.
Example:
const express = require('express');
const app = express();
app.get('/', (req,res)=>{
res.send('Hello');
});
app.listen(3000);Q50. Event Loop in Node.js
Answer
Handles asynchronous operations.
Request
↓
Event Queue
↓
Event Loop
↓
ExecutionAllows thousands of concurrent requests.
Advanced Scenario-Based Questions
Q51. Design a Serverless ETL Pipeline
Answer
Architecture:
S3 Upload
↓
Lambda
↓
Data Validation
↓
SQS
↓
Lambda
↓
RedshiftBenefits:
- Fully serverless
- Scalable
- Cost efficient
Q52. Build an Approval Workflow
Answer
Power Apps Form
↓
Power Automate
↓
Manager Approval
↓
SharePoint Update
↓
Email NotificationQ53. How would you secure APIs?
Answer
Implement:
- OAuth2
- JWT
- API Gateway
- WAF
- Rate Limiting
- Encryption
- Secrets Manager
Q54. How would you automate cloud operations?
Answer
Use:
- Lambda
- EventBridge
- Boto3
- CloudFormation
- Systems Manager
Example:
EventBridge
↓
Lambda
↓
Start EC2
↓
Notify SNSQ55. How would you troubleshoot automation failures?
Answer
Step 1
Review logs:
- CloudWatch
- Splunk
- Power Platform Logs
Step 2
Check:
- Permissions
- API responses
- Network connectivity
Step 3
Retry failed processes.
Step 4
Implement alerting.
Senior-Level Interview Questions
Q56. How would you design enterprise automation architecture?
Q57. How would you implement API versioning?
Q58. Explain webhook vs polling.
Q59. How would you handle millions of API requests?
Q60. Design a low-code + pro-code automation platform.
Q61. Explain event-driven architecture.
Q62. How do you implement CI/CD for serverless applications?
Q63. Explain API Gateway architecture.
Q64. How would you secure secrets across automation platforms?
Q65. Design an enterprise document approval platform using SharePoint, Power Apps, Power Automate, and AWS services.
Most Frequently Asked Real Interview Questions (2025–2026)
- Explain Lambda cold starts and mitigation.
- Difference between REST and GraphQL.
- OAuth2 authorization flow.
- JWT token validation.
- API Gateway vs Load Balancer.
- Power Automate approval workflows.
- Power Apps integration with SharePoint.
- Shell scripting debugging techniques.
- PowerShell remoting.
- Node.js event loop.
- SPFx architecture.
- Lambda concurrency limits.
- API throttling strategies.
- Retry and dead-letter queues.
- Idempotent API design.
- Python multithreading vs multiprocessing.
- Async programming in Node.js.
- Webhooks vs polling.
- Secure secret management.
- Enterprise automation governance.
These 65+ questions cover the majority of Automation Engineer, Cloud Engineer, AWS Engineer, SharePoint Developer, Microsoft Power Platform Developer, DevOps Engineer, and Senior Solutions Architect interviews currently being conducted across U.S. organizations.
This is a comprehensive guide to Automation & APIs interview questions, covering the specific technologies you listed. Each answer is detailed, practical, and includes code snippets where relevant.
1. AWS Lambda (Serverless Functions)
Q1: What is AWS Lambda? How does it handle auto-scaling?
Answer:
AWS Lambda is a compute service that runs code without provisioning servers. It automatically scales from zero to thousands of concurrent executions.
- Scaling: For each event, Lambda launches a separate instance. Concurrency limit defaults to 1000 per region.
- Cold start: First request to a idle function causes latency (1–5 seconds). Keep-alive via CloudWatch Events can mitigate this.
Q2: How do you manage environment-specific configuration in Lambda?
Answer:
Using Environment Variables (encrypted with KMS) + AWS Systems Manager Parameter Store (for secrets).
python
import os
import boto3
def lambda_handler(event, context):
table_name = os.environ['DYNAMODB_TABLE']
ssm = boto3.client('ssm')
api_key = ssm.get_parameter(Name='/prod/api_key', WithDecryption=True)['Parameter']['Value']Q3: How do you handle idempotency in Lambda?
Answer:
Use idempotency keys stored in DynamoDB (TTL based).
python
# Check if event_id already processed
if dynamodb_table.get_item(Key={'id': event['idempotencyKey']}).get('Item'):
return {'statusCode': 200, 'body': 'Already processed'}
else:
process(event)
dynamodb_table.put_item(Item={'id': event['idempotencyKey'], 'ttl': int(time.time())+3600})2. Python for Automation
Q4: How do you parallelize API calls in Python?
Answer:
Using concurrent.futures.ThreadPoolExecutor (I/O-bound tasks).
python
import requests
from concurrent.futures import ThreadPoolExecutor, as_completed
urls = ['https://api1.com', 'https://api2.com']
def fetch(url):
return requests.get(url).json()
with ThreadPoolExecutor(max_workers=5) as executor:
futures = {executor.submit(fetch, url): url for url in urls}
for future in as_completed(futures):
print(future.result())Q5: Write a Python script to retry failed API requests with exponential backoff.
Answer:
python
import requests
from time import sleep
def call_with_retry(url, retries=3, backoff=1):
for i in range(retries):
try:
resp = requests.get(url, timeout=5)
resp.raise_for_status()
return resp.json()
except requests.exceptions.RequestException as e:
if i == retries - 1:
raise
sleep(backoff * (2 ** i))3. Shell Scripting (Bash)
Q6: Write a Bash script to monitor disk usage and send alert if >80%.
Answer:
bash
#!/bin/bash
THRESHOLD=80
CURRENT=$(df -h / | awk 'NR==2 {print $5}' | sed 's/%//')
if [ $CURRENT -gt $THRESHOLD ]; then
echo "Disk usage is at ${CURRENT}%" | mail -s "Alert" admin@example.com
fiQ7: How do you parse JSON in Bash? Give an example with jq.
Answer:
bash
# Extract "name" and "id" from API response
curl -s https://api.github.com/users/octocat | jq '.name, .id'
# Output: "The Octocat", 583231
# Loop through array
curl -s https://api.github.com/users/octocat/repos | jq -r '.[].name' | while read repo; do
echo "Cloning $repo"
done4. PowerShell (Windows Automation)
Q8: How do you call a REST API and handle pagination in PowerShell?
Answer:
Use Invoke-RestMethod with a loop checking @odata.nextLink.
powershell
$uri = "https://graph.microsoft.com/v1.0/users"
$allUsers = @()
do {
$response = Invoke-RestMethod -Uri $uri -Headers $headers -Method Get
$allUsers += $response.value
$uri = $response.'@odata.nextLink'
} while ($uri)
$allUsers | Export-Csv users.csvQ9: Write a PowerShell script to monitor a Windows service and restart if stopped.
Answer:
powershell
$serviceName = "Spooler"
$service = Get-Service -Name $serviceName
if ($service.Status -ne 'Running') {
Start-Service -Name $serviceName
Write-EventLog -LogName Application -Source "MonitorScript" -EntryType Warning -EventId 1 -Message "Restarted $serviceName"
}5. Power Automate (Cloud Flow)
Q10: How do you parse a JSON response from an HTTP action in Power Automate?
Answer:
- Add Parse JSON action after HTTP request.
- Use Generate from sample button → paste actual API response.
- Access data dynamically:
@{body('Parse_JSON')?['propertyName']}
Q11: How do you handle API rate limiting in Power Automate?
Answer:
- Use Configure run after for HTTP action on failure.
- Add Delay action (e.g., 60 seconds) before retry.
- Use Do until loop with incrementing counter.
- For Microsoft Graph API, use
Retry-Afterheader value.
6. Power Apps
Q12: How do you call an authenticated API from Power Apps?
Answer:
powerapps
Set(
token,
'YourCustomConnector'.GetAccessToken().access_token
);
ClearCollect(
apiData,
'HTTP'.Get(
"https://api.example.com/data",
{Authorization: "Bearer " & token}
)
)Better approach: Create a Custom Connector with OAuth 2.0 (Client Credentials) – handles token refresh automatically.
Q13: Explain delegation in Power Apps with a SharePoint data source.
Answer:
Delegation means the operation is passed to the data source (SharePoint, SQL) instead of filtering locally.
- Delegable functions:
Filter(),Sort(),LookUp()on indexed columns. - Non-delegable:
in,exactin,search()on non-indexed columns – fails beyond 500/2000 items. - Fix: Use
StartsWith()on text columns (delegable) or move to Dataverse.
7. REST APIs
Q14: Explain idempotency in REST APIs. Give an example.
Answer:
Idempotency means multiple identical requests have same effect as one.
- Idempotent methods: GET, PUT, DELETE (PUT: replace entire resource with same ID).
- Non-idempotent: POST (creates new resource each time).
Implementation example:
Client sends Idempotency-Key: uuid-1234. Server stores in Redis, returns cached response for same key.
Q15: Design a REST API endpoint to fetch all users with pagination, filtering, sorting.
Answer:
text
GET /api/users?limit=20&offset=40&sort=lastName:asc&filter=role=admin
Response:
json
{
"data": [...],
"pagination": {
"next": "/api/users?limit=20&offset=60",
"previous": "/api/users?limit=20&offset=20",
"total": 250
}
}Best practices: Use limit/offset or cursor-based pagination (after=lastID). Return Link headers for HATEOAS.
Q16: How do you secure a REST API?
Answer:
- Authentication: JWT (stateless), OAuth 2.0 (delegated), API Keys (simple).
- Authorization: Role-based (RBAC) using scopes or claims.
- Other: Rate limiting (e.g., 100 req/min), input validation, HTTPS only, CORS properly configured.
8. SharePoint SPFx (SharePoint Framework)
Q17: What is SPFx? How does it differ from classic SharePoint add-ins?
Answer:
SPFx is a page and web part model using modern web technologies (React, TypeScript) running client-side.
Differences:
| Classic Add-ins | SPFx |
|---|---|
| IFrames, full trust | Client-side, no iframe |
| Hosted on external IIS | Hosted on SharePoint CDN |
| Slower, cross-domain issues | Fast, runs in context of current user |
| Requires tenant admin | Deploy via App Catalog |
Q18: How do you call Microsoft Graph API from SPFx?
Answer:
typescript
import { MSGraphClientV3 } from '@microsoft/sp-http';
public async getUserProfile(): Promise<any> {
const graphClient: MSGraphClientV3 = await this.context.msGraphClientFactory.getClient('3');
const response = await graphClient.api('/me').get();
return response;
}Permissions: Declare in package-solution.json under webApiPermissionRequests.
Q19: How do you deploy an SPFx solution to production?
Answer:
gulp bundle --shipgulp package-solution --ship- Upload
.sppkgto App Catalog (tenant or site collection). - Click Deploy → Make it available to all sites.
- Approve API permissions (Graph/SharePoint) in SharePoint Admin Center → API Access.
- Add web part to modern page via web part picker.
9. Node.js (for APIs & Automation)
Q20: Write an Express.js middleware for JWT authentication.
Answer:
javascript
const jwt = require('jsonwebtoken');
function authenticateToken(req, res, next) {
const authHeader = req.headers['authorization'];
const token = authHeader && authHeader.split(' ')[1];
if (!token) return res.sendStatus(401);
jwt.verify(token, process.env.ACCESS_TOKEN_SECRET, (err, user) => {
if (err) return res.sendStatus(403);
req.user = user;
next();
});
}Q21: How do you handle async errors in Express without try-catch blocks?
Answer:
Wrap route handlers with a higher-order function:
javascript
const asyncHandler = (fn) => (req, res, next) => {
Promise.resolve(fn(req, res, next)).catch(next);
};
app.get('/users/:id', asyncHandler(async (req, res) => {
const user = await db.findUser(req.params.id);
res.json(user);
}));Then add global error handler:
javascript
app.use((err, req, res, next) => {
res.status(500).json({ error: err.message });
});Q22: How do you implement retry logic with exponential backoff in Node.js?
Answer:
javascript
async function fetchWithRetry(url, retries = 3, delayMs = 1000) {
for (let i = 0; i < retries; i++) {
try {
const response = await fetch(url);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return await response.json();
} catch (err) {
if (i === retries - 1) throw err;
await new Promise(resolve => setTimeout(resolve, delayMs * Math.pow(2, i)));
}
}
}10. Cross-Technology Scenario Questions
Q23: You need to build an automated daily report: fetch data from REST API (paginated), filter, store in SharePoint list, and email summary. Design the solution using any of the technologies mentioned.
Sample Answer (Hybrid):
- AWS Lambda (Python) triggered by CloudWatch Events (daily).
- Lambda calls REST API with pagination loop.
- Filters data (e.g., last 24 hours).
- Stores in SharePoint Online via Microsoft Graph API (
/sites/{id}/lists/{id}/items). - Generates HTML email summary via SES or SMTP.
- Alternatively: Power Automate scheduled cloud flow → HTTP + SharePoint connectors → less coding but slower for large data.
Q24: Compare PowerShell, Bash, and Python for automation.
| Feature | Bash | PowerShell | Python |
|---|---|---|---|
| Platform | Linux/macOS/WSL | Windows (cross-platform now) | All |
| Native API handling | curl + jq (text) | Invoke-RestMethod (objects) | requests library |
| Complex logic | Weak (loops, arrays) | Strong | Strongest |
| Best for | Gluing commands, file ops | Windows AD/Exchange/O365 | Cross-platform, data processing |
Q25: How do you handle secrets (API keys, passwords) in automation scripts?
Answer:
- Lambda: Environment variables (encrypted) + Parameter Store.
- PowerShell:
Get-Secretfrom SecretManagement module (Azure Key Vault). - Bash: Read from
.envwithchmod 600, never commit to Git. - Node.js/Python:
dotenv+ environment variables. - CI/CD (GitHub Actions): Use repository secrets.
11. Advanced / Problem-Solving
Q26: Your Lambda function times out after 15 minutes. How do you process 1M records from an API?
Answer:
Use Step Functions with a map state to parallelize:
- Lambda fetches total count of records.
- Step Functions splits into batches (e.g., 10k records per child execution).
- Each child Lambda runs in parallel, stores results in S3.
- Final Lambda consolidates.
Q27: Write a PowerShell script to export all SharePoint Online list items using PnP PowerShell.
Answer:
powershell
Connect-PnPOnline -Url "https://tenant.sharepoint.com/sites/site" -Interactive
$items = Get-PnPListItem -List "LargeList" -PageSize 2000
$items | Select-Object -Property @{N="ID";E={$_["ID"]}}, @{N="Title";E={$_["Title"]}} | Export-Csv "export.csv"Q28: How do you create a reusable Power Automate flow that accepts parameters (like a function)?
Answer:
Create a Child Flow (Instant flow with Manually trigger a flow). Add input parameters:
listName(string)folderPath(string)
Call it from parent flow using Run a child flow action. Return outputs via Respond to Power App action.
Final Tips for Interview
- For senior roles, be ready to discuss error handling, idempotency, idempotency keys, circuit breakers, retry storms.
- For AWS Lambda: cold starts, VPC networking, Lambda layers, provisioned concurrency.
- For REST APIs: idempotency, HATEOAS, versioning strategies (URL vs header).
- For SPFx: web part property pane, dynamic data, application customizers.
- Always ask clarifying questions before jumping to code.


