Automation & APIs Interview Questions and Answers (Comprehensive Guide)

Automation & APIs Interview

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 DynamoDB

Q2. What are Lambda Event Sources?

Answer

Lambda can be triggered by:

ServiceUse Case
S3File Upload
DynamoDB StreamsData Change
EventBridgeScheduling
API GatewayREST APIs
SNSNotifications
SQSMessage Processing
KinesisStreaming 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 sec

Solutions:

  • Provisioned Concurrency
  • Smaller packages
  • Efficient code

Q4. Difference between Lambda and EC2?

FeatureLambdaEC2
Server ManagementNoYes
ScalingAutomaticManual/Auto Scaling
BillingPer RequestPer Hour/Second
Long Running JobsLimitedSuitable
MaintenanceAWSUser

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
schedule

Q7. 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

ShellBash
GenericSpecific implementation
Multiple variantsMost popular

Q13. How do you pass arguments?

script.sh file.txt
echo $1

Output:

file.txt

Q14. What are loops in Shell?

For Loop

for i in {1..5}
do
echo $i
done

Q15. How do you schedule jobs?

Cron

crontab -e

Example:

0 1 * * *
/scripts/job.sh

Runs 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?

CMDPowerShell
Text OutputObjects
Basic CommandsAdvanced Scripting
Limited AutomationEnterprise Automation

Q18. Get Running Services

Get-Service

Specific:

Get-Service Spooler

Q19. Read a CSV

Import-Csv users.csv

Q20. Call REST API using PowerShell

Invoke-RestMethod `
-Uri https://api.example.com

5. 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 Notification

Q24. 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

CanvasModel Driven
UI FirstData First
Flexible DesignStandardized
Custom ScreensAutomatic 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 Operations

Q30. 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
Stateless

Q32. What are HTTP Methods?

MethodPurpose
GETRead
POSTCreate
PUTUpdate
PATCHPartial Update
DELETERemove

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

CodeMeaning
200Success
201Created
400Bad Request
401Unauthorized
403Forbidden
404Not Found
500Internal 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 Idempotent

Q37. Authentication vs Authorization?

AuthenticationAuthorization
Who are you?What can you access?

Examples:

  • OAuth
  • JWT
  • API Keys

Q38. What is JWT?

Answer

JSON Web Token.

Structure:

Header.Payload.Signature

Used in microservices authentication.


Q39. What is OAuth 2.0?

Answer

Industry standard authorization framework.

Flow:

User

Identity Provider

Access Token

API Access

Q40. API Rate Limiting

Answer

Controls request volume.

Example:

1000 Requests / Minute

Prevents:

  • 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

Dispose

Q44. What is a Web Part?

Answer

Reusable UI component on SharePoint pages.

Examples:

  • Dashboard
  • Reports
  • Forms

Q45. SPFx vs SharePoint Add-ins

SPFxAdd-ins
ModernLegacy
Client SideExternal Hosting
FasterMore 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 express

Q49. 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

Execution

Allows thousands of concurrent requests.


Advanced Scenario-Based Questions

Q51. Design a Serverless ETL Pipeline

Answer

Architecture:

S3 Upload

Lambda

Data Validation

SQS

Lambda

Redshift

Benefits:

  • Fully serverless
  • Scalable
  • Cost efficient

Q52. Build an Approval Workflow

Answer

Power Apps Form

Power Automate

Manager Approval

SharePoint Update

Email Notification

Q53. 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 SNS

Q55. 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)

  1. Explain Lambda cold starts and mitigation.
  2. Difference between REST and GraphQL.
  3. OAuth2 authorization flow.
  4. JWT token validation.
  5. API Gateway vs Load Balancer.
  6. Power Automate approval workflows.
  7. Power Apps integration with SharePoint.
  8. Shell scripting debugging techniques.
  9. PowerShell remoting.
  10. Node.js event loop.
  11. SPFx architecture.
  12. Lambda concurrency limits.
  13. API throttling strategies.
  14. Retry and dead-letter queues.
  15. Idempotent API design.
  16. Python multithreading vs multiprocessing.
  17. Async programming in Node.js.
  18. Webhooks vs polling.
  19. Secure secret management.
  20. 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
fi

Q7: 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"
done

4. 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.csv

Q9: 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:

  1. Add Parse JSON action after HTTP request.
  2. Use Generate from sample button → paste actual API response.
  3. 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-After header 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: inexactinsearch() 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-insSPFx
IFrames, full trustClient-side, no iframe
Hosted on external IISHosted on SharePoint CDN
Slower, cross-domain issuesFast, runs in context of current user
Requires tenant adminDeploy 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:

  1. gulp bundle --ship
  2. gulp package-solution --ship
  3. Upload .sppkg to App Catalog (tenant or site collection).
  4. Click Deploy → Make it available to all sites.
  5. Approve API permissions (Graph/SharePoint) in SharePoint Admin Center → API Access.
  6. 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):

  1. AWS Lambda (Python) triggered by CloudWatch Events (daily).
  2. Lambda calls REST API with pagination loop.
  3. Filters data (e.g., last 24 hours).
  4. Stores in SharePoint Online via Microsoft Graph API (/sites/{id}/lists/{id}/items).
  5. Generates HTML email summary via SES or SMTP.
  6. Alternatively: Power Automate scheduled cloud flow → HTTP + SharePoint connectors → less coding but slower for large data.

Q24: Compare PowerShell, Bash, and Python for automation.

FeatureBashPowerShellPython
PlatformLinux/macOS/WSLWindows (cross-platform now)All
Native API handlingcurl + jq (text)Invoke-RestMethod (objects)requests library
Complex logicWeak (loops, arrays)StrongStrongest
Best forGluing commands, file opsWindows AD/Exchange/O365Cross-platform, data processing

Q25: How do you handle secrets (API keys, passwords) in automation scripts?

Answer:

  • Lambda: Environment variables (encrypted) + Parameter Store.
  • PowerShell: Get-Secret from SecretManagement module (Azure Key Vault).
  • Bash: Read from .env with chmod 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:

  1. Lambda fetches total count of records.
  2. Step Functions splits into batches (e.g., 10k records per child execution).
  3. Each child Lambda runs in parallel, stores results in S3.
  4. 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 handlingidempotencyidempotency keyscircuit breakersretry 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.

🤞 Sign up for our newsletter!

We don’t spam! Read more in our privacy policy

Scroll to Top