Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Web Scraping & Browser Automation (Python and JavaScript) Module 9

Office automation: Excel, PDF and email interview questions

Interview questions on “Office automation: Excel, PDF and email”: warm-ups, then what each harder question tests and how a good answer starts.

11 questions: 3 warm-ups and 8 with model answers · Levels: Fresher to senior

Warm-up questions

Short questions with short answers, each answered in full.

  1. Fresher

    openpyxl or XlsxWriter for a weekly report, and why?

    Answered in the lesson Excel automation: openpyxl, XlsxWriter, ExcelJS

  2. Fresher

    Why is getting a table out of a PDF harder than getting its text?

    Answered in the lesson PDFs: extract text and tables, merge, generate

  3. Fresher

    What is the difference between the SMTP envelope and a message's To and From headers?

    Answered in the lesson Email reports: build, send and read safely

Questions with model answers

What each question tests, the first step of a good answer and the follow-ups to expect.

  1. Fresher to mid

    A weekly job writes a sales workbook with XlsxWriter. People who open it in a spreadsheet app see the right totals, but a dashboard that loads the same file with pandas shows every total as 0. What is happening, how do you confirm it, and what do you change?

    What it tests
    Knowing that these libraries never calculate formulas, what a formula's cached value is and who reads it, and storing computed results instead of relying on a recalculation.
    First step
    Open one report as the ZIP file it is and look at a total cell in the sheet's XML. If its value element holds 0 next to the formula, the dashboard reads exactly what the file stores. Then ask how the dashboard reads: anything that does not calculate sees only that stored value.
    Follow-ups

    From the lesson Excel automation: openpyxl, XlsxWriter, ExcelJS

    Model answer, Pro. Model answers open with any pass; prices are in the notice on this page.

    Opening the model answers with your pass…

    Model answers open with any MySmartCoPilot pass.

    • Pro pass · 1 week₹79$2.99
    • 30 days₹179$5.99
    • 1 year₹1,699$45

    One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.

    It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  2. Mid to senior

    A nightly job builds one workbook of about 300,000 rows by 20 columns with XlsxWriter, and since the data grew it runs out of memory on a machine with 2 GB. How do you change the job, and what do you give up?

    What it tests
    The memory models of XlsxWriter and openpyxl, their constant_memory and write-only modes and what those modes cannot do, and knowing when a workbook is the wrong file for the data.
    First step
    Estimate before changing anything: memory per cell in XlsxWriter's normal mode times six million cells. Then list what the workbook needs. If the rows can be written in order and the sheet needs no table and no merged ranges, constant_memory keeps memory flat; if it needs a table, that mode is not available.
    Follow-ups

    From the lesson Excel automation: openpyxl, XlsxWriter, ExcelJS

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  3. Mid to senior

    A nightly job extracts a supplier's price table from its PDF bulletins. After the supplier changed its template, about a third of the stored prices sit in the wrong columns, and nothing failed. How do you find the cause, repair the data and make the job catch this next time?

    What it tests
    Seeing that table extraction fails quietly, reading positions and settings instead of guessing, and checks that use the document's own header, counts and totals.
    First step
    Take one bad night's PDF and look at what the extractor returned for each page, before any cleaning: the number of cells per row and the header row. When they differ from the table the page prints, the reading broke when the template changed, and the stored prices are only as good as that reading.
    Follow-ups

    From the lesson PDFs: extract text and tables, merge, generate

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  4. Fresher to mid

    A job reads the totals of PDF invoices that suppliers email in. For about a fifth of them it finds no text at all, and their totals are stored as empty. What is going on, and how should the job handle those files?

    What it tests
    Recognising pages without a text layer, routing them instead of guessing, and keeping empty values out of the stored data.
    First step
    Open a few failing invoices and count, per page, the characters and the images a library such as pdfplumber reports. Pages with images and no characters are scans or photos: there is no text to extract, and the empty totals are the job's bug, not the supplier's.
    Follow-ups

    From the lesson PDFs: extract text and tables, merge, generate

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 2 minutes
  5. Mid to senior

    A service extracts text from PDFs that users upload. One upload of under 100 KB made a worker use all its memory and stop, and the queue behind it stalled. How do you make the service safe against such files?

    What it tests
    Treating documents as untrusted input: limits before and during parsing, isolation in a child process with time and memory limits, and handling a refused file without stopping the queue.
    First step
    Keep the file and learn what it does before changing code: which step of the parsing used the memory, and how large the data inside the file became. Then list every point where the service trusts an upload: its size, its type, what reading it may cost, and how long it may take.
    Follow-ups

    From the lesson PDFs: extract text and tables, merge, generate

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 2 minutes
  6. Fresher to mid

    A colleague's weekly report script has the mailbox password written in it, and it sends one message with all 60 recipients in the To line. It has been in the team's repository for a year. What risks do you see, and how do you change the script?

    What it tests
    Treating a committed password as leaked, moving secrets out of code, provider login rules, recipient privacy and testing against a sink before the first real send.
    First step
    Treat the password as already leaked: it is in the repository's history, and deleting the line does not remove it from there. Change it, or revoke the app password, first. Then list everything else the script exposes: 60 addresses visible to every reader, and a login that may give access to a whole mailbox.
    Follow-ups

    From the lesson Email reports: build, send and read safely

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  7. Mid to senior

    A report job started failing with "certificate verify failed" against the company's SMTP server, and someone fixed it by switching certificate checks off. Why is that dangerous, and what is the right fix?

    What it tests
    What certificate verification protects, reading the actual TLS error, fixing trust properly, and catching the regression with a test.
    First step
    Read the full error before changing anything: an unknown authority, an expired certificate and a name that does not match are three different faults with three different owners. Then remember what the check protects here: the login, sent right after the handshake, which anyone between the job and the server could read if the job trusts any certificate.
    Follow-ups

    From the lesson Email reports: build, send and read safely

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 2 minutes
  8. Mid to senior

    A weekly report goes to 400 people who signed up for it. About 30 messages bounce every week, a few people reply asking to stop, and the provider has begun to delay the job's mail. What do you build?

    What it tests
    Reading delivery reports and auto-replies safely, keeping the list honest, respecting stop requests, and staying within a provider's limits.
    First step
    Look at the answers before writing code: read a week's bounces and replies in the mailbox and sort them by kind, the delivery reports with their action and status codes, the auto-replies, the requests to stop. The kinds decide the rules, and the counts say how much the list has decayed.
    Follow-ups

    From the lesson Email reports: build, send and read safely

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 2 minutes

All Web Scraping & Browser Automation (Python and JavaScript) interview questions · The Web Scraping & Browser Automation (Python and JavaScript) track

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.