Arcesium interview questions & answers

20 real Arcesium interview questions with full model answers — Coding, Technical, Product & growth. Drawn from the same verified bank ChannelPulse drills from (34 Arcesium questions in total).

CodingMediumArcesiumSoftware Engineer

1. Beautiful Towers II (LeetCode)

Model answer

The task

Choose a height for each tower that does not exceed its individual maximum, so the heights rise to a peak and then fall. Return the largest possible sum of the chosen heights.

Key idea

For each possible peak, compute the best sum extending left and right while respecting the mountain shape. A monotonic stack finds where each side’s height is limited by a previous or next tower, allowing all peak totals to be computed in linear time.

Approach

  1. Scan left to right, maintaining a stack of indices with nondecreasing maximum heights.
  2. For each index, use the nearest earlier height no greater than its own to calculate the best left-side sum.
  3. Scan right to left in the same way to calculate the best right-side sum.
  4. Treat each tower as the peak; add its left and right sums, subtracting its height once because it appears in both.
  5. Return the largest resulting total.
from typing import List

class Solution:
    def maximumSumOfHeights(self, maxHeights: List[int]) -> int:
        n = len(maxHeights)
        left = [0] * n
        right = [0] * n

        # Best sum from the start through each index,
        # with heights nondecreasing toward that index.
        stack = []
        for i, height in enumerate(maxHeights):
            while stack and maxHeights[stack[-1]] > height:
                stack.pop()

            if stack:
                prev = stack[-1]
                left[i] = left[prev] + height * (i - prev)
            else:
                left[i] = height * (i + 1)

            stack.append(i)

        # Best sum from each index through the end,
        # with heights nonincreasing away from that index.
        stack = []
        for i in range(n - 1, -1, -1):
            height = maxHeights[i]

            while stack and maxHeights[stack[-1]] > height:
                stack.pop()

            if stack:
                nxt = stack[-1]
                right[i] = right[nxt] + height * (nxt - i)
            else:
                right[i] = height * (n - i)

            stack.append(i)

        return max(left[i] + right[i] - maxHeights[i] for i in range(n))

Complexity:

  • Time: O(n), since each index is pushed and popped at most once in each scan.
  • Space: O(n), for the two sum arrays and the stacks.

Common follow-ups

  • Can the auxiliary arrays be reduced? Yes; process candidate peaks while keeping only the needed stack sums.
  • What if multiple peaks give the same maximum? Any of them is valid; the algorithm returns their shared maximum sum.
  • Why subtract the peak height? It is included in both the left-side and right-side sums.
CodingMediumArcesiumSoftware Engineer

2. Maximum Length of Subarray With Positive Product (LeetCode)

Model answer

The task

Find the maximum length of a contiguous part of an integer array whose product is positive. The product’s magnitude is irrelevant; only its sign matters.

Key idea

Track the lengths of the longest positive-product and negative-product subarrays ending at the current position. A negative number swaps their roles, while zero breaks any subarray that includes it.

Approach

  1. Keep positive and negative lengths for subarrays ending at the current index, plus the best positive length seen.
  2. On zero, reset both lengths.
  3. On a positive value, extend each existing state; the positive state can also start a new subarray.
  4. On a negative value, extend the negative state to become positive, and the positive state to become negative. If there was no positive state, the current value starts a negative subarray.
  5. Update the best answer from the positive state.
class Solution:
    def getMaxLen(self, nums: list[int]) -> int:
        positive = 0  # Longest positive-product subarray ending here
        negative = 0  # Longest negative-product subarray ending here
        best = 0

        for value in nums:
            if value == 0:
                # No subarray containing zero has a positive product.
                positive = 0
                negative = 0
            elif value > 0:
                # A positive value preserves the product sign.
                positive += 1
                if negative > 0:
                    negative += 1
            else:
                # A negative value flips the product sign.
                old_positive, old_negative = positive, negative
                positive = old_negative + 1 if old_negative > 0 else 0
                negative = old_positive + 1

            best = max(best, positive)

        return best

Complexity:

  • Time: O(n), processing each array element once.
  • Space: O(1), using a fixed number of variables.

Common follow-ups

  • How would you find the longest negative-product subarray? Track the maximum negative length in the same scan.
  • How would you count positive-product subarrays? Track counts of positive- and negative-product subarrays ending at each index, resetting both at zero.
  • What if the array contains only positive values? The algorithm naturally returns the full array length.
CodingMediumArcesiumSoftware Engineer

3. Number of People Aware of a Secret (LeetCode)

Model answer

The task

Track how many people learn a secret each day. A person starts sharing only after a delay, and stops sharing once they forget; return how many still remember it on day n.

Key idea

Let learned[d] be the number of people who learn the secret on day d. Maintain the number of people currently able to share: each cohort joins that count when its delay ends and leaves when it forgets.

Approach

  1. Set learned[1] = 1, since the first person knows the secret on day 1.
  2. For each later day, add the cohort that has just reached its sharing delay.
  3. Remove the cohort that forgets on that day.
  4. The active sharers determine how many people learn the secret that day.
  5. Sum cohorts that have not yet forgotten on day n.
class Solution:
    def peopleAwareOfSecret(self, n: int, delay: int, forget: int) -> int:
        mod = 10**9 + 7
        learned = [0] * (n + 1)
        learned[1] = 1
        sharing = 0

        for day in range(2, n + 1):
            # This cohort can now share.
            start = day - delay
            if start >= 1:
                sharing = (sharing + learned[start]) % mod

            # This cohort forgets today and can no longer share.
            stop = day - forget
            if stop >= 1:
                sharing = (sharing - learned[stop]) % mod

            learned[day] = sharing

        # Count everyone who still remembers on day n.
        first_remembering_day = max(1, n - forget + 1)
        return sum(learned[first_remembering_day:n + 1]) % mod

Complexity:

  • Time: O(n), processing each day once.
  • Space: O(n), storing the number of new learners for each day.

Common follow-ups

  • Can the space be reduced? Yes; a circular buffer can retain only the recent cohorts needed for sharing and forgetting.
  • What if each person shares with only a fixed number of others? Multiply each day’s new learners by that number when computing the next cohort.
  • Why remove the forgetting cohort before assigning today’s learners? People who forget that day cannot share on that day.
CodingMediumArcesiumSoftware Engineer

4. House Robber IV (LeetCode)

Model answer

The task

Choose at least k houses from a row without choosing neighbors. Minimize the largest value among the chosen houses.

Key idea

For a proposed capability x, a house can be chosen only if its value is at most x. Greedily take each eligible house and skip the next one; this gives the maximum number of non-adjacent eligible houses. Feasibility is monotonic, so binary search for the smallest feasible x.

Approach

  1. Set the search range to the smallest and largest house values.
  2. For a candidate capability, scan from left to right.
  3. When an eligible house is found, count it and skip its neighbor.
  4. If the count reaches k, the candidate is feasible.
  5. Binary search for the first feasible capability.
class Solution:
    def minCapability(self, nums: list[int], k: int) -> int:
        def can_rob(capability: int) -> bool:
            count = 0
            i = 0

            while i < len(nums):
                if nums[i] <= capability:
                    count += 1
                    if count >= k:
                        return True
                    i += 2  # The adjacent house cannot be chosen.
                else:
                    i += 1

            return False

        low = min(nums)
        high = max(nums)

        while low < high:
            mid = (low + high) // 2

            if can_rob(mid):
                high = mid
            else:
                low = mid + 1

        return low

Complexity:

  • Time: O(n log R), where R is the range of house values; each feasibility check scans the array.
  • Space: O(1), using only a few counters.

Common follow-ups

  • Return which houses to choose? Store the greedy selections for the final capability.
  • What if houses form a circle? Check the cases that exclude one of the two endpoint houses.
  • What if exactly k houses must be chosen? The same feasibility test works: being able to choose at least k also permits selecting exactly k.
CodingMediumArcesiumSoftware Engineer

5. Maximize the Confusion of an Exam (LeetCode)

Model answer

The task

Given a string of T and F answers and a limit on how many answers can be changed, find the longest consecutive block that can be made entirely one answer.

Key idea

For a chosen target answer, a window is valid if it contains at most k answers that differ from the target. Use a sliding window to find the longest valid window, once targeting T and once targeting F.

Approach

  1. Define a helper that scans the string for a particular target answer.
  2. Expand the right edge of the window, counting answers that would need changing.
  3. If that count exceeds k, move the left edge until the window is valid again.
  4. Track the longest valid window.
  5. Return the larger result for the two possible target answers.
class Solution:
    def maxConsecutiveAnswers(self, answerKey: str, k: int) -> int:
        def longest_for(target: str) -> int:
            left = 0
            changes = 0
            best = 0

            for right, answer in enumerate(answerKey):
                if answer != target:
                    changes += 1

                # Restore the window invariant: at most k changes needed.
                while changes > k:
                    if answerKey[left] != target:
                        changes -= 1
                    left += 1

                best = max(best, right - left + 1)

            return best

        return max(longest_for("T"), longest_for("F"))

Complexity:

  • Time: O(n), scanning the string twice.
  • Space: O(1), using only a few counters.

Common follow-ups

  • Can both targets be handled in one pass? Yes; maintain separate windows and counters for T and F.
  • What if the alphabet has more than two answers? For each target symbol, find the longest window with at most k non-target symbols.
  • What if k is larger than the string length? The whole string can be made uniform, so the answer is its length.
CodingMediumArcesiumSoftware Engineer

6. Minimum Swaps to Group All 1's Together II (LeetCode)

Model answer

The task

Given a circular binary array, find the fewest swaps needed to make all its 1s consecutive. The consecutive group may wrap around the end of the array.

Key idea

If there are k ones, any group containing them must occupy a circular window of length k. The swaps needed for a window equal the number of zeros inside it, so find the window with the fewest zeros.

Approach

  1. Count the ones; if there are none, no swaps are needed.
  2. Count the ones in the window of length k starting at index 0.
  3. Slide that window through all n circular starting positions, removing the outgoing value and adding the incoming value.
  4. Track the maximum number of ones in any window.
  5. Return k minus that maximum.
class Solution:
    def minSwaps(self, nums: list[int]) -> int:
        n = len(nums)
        if n == 0:
            return 0

        k = sum(nums)
        if k == 0:
            return 0

        # Count the ones in the initial circular window of length k.
        window_ones = sum(nums[i] for i in range(k))
        max_ones = window_ones

        # Consider each remaining circular window start.
        for start in range(1, n):
            outgoing = nums[start - 1]
            incoming = nums[(start + k - 1) % n]
            window_ones += incoming - outgoing
            max_ones = max(max_ones, window_ones)

        return k - max_ones

Complexity:

  • Time: O(n), since each circular window is handled in constant time.
  • Space: O(1), using only a fixed amount of extra storage.

Common follow-ups

  • What if the array is not circular? Check only windows that fit within the array; there are n - k + 1 of them.
  • What if the array contains no ones or all ones? The answer is 0 in either case.
  • Can the window be counted using zeros instead? Yes; slide a length-k window and minimize its zero count.
CodingMediumArcesiumSoftware Engineer

7. Count Collisions on a Road (LeetCode)

Model answer

The task

Given a string describing cars moving left, moving right, or already stopped, count the total number of collisions. Each collision leaves the involved cars stopped.

Key idea

Cars moving left at the far left, and cars moving right at the far right, can escape without colliding. Between those boundaries, every moving car eventually collides, contributing one collision per moving car.

Approach

  1. Find the first position that is not L.
  2. Find the last position that is not R.
  3. Count L and R between those positions, inclusive.
  4. Return that count; stopped cars do not add to it.
class Solution:
    def countCollisions(self, directions: str) -> int:
        n = len(directions)
        left = 0
        right = n - 1

        # Leading left-moving cars and trailing right-moving cars escape.
        while left < n and directions[left] == "L":
            left += 1
        while right >= left and directions[right] == "R":
            right -= 1

        # Every moving car in the remaining segment collides once.
        collisions = 0
        for i in range(left, right + 1):
            if directions[i] != "S":
                collisions += 1

        return collisions

Complexity:

  • Time: O(n), for the scans and count.
  • Space: O(1), using only a few indices and a counter.

Common follow-ups

  • Can this be done in one pass? Yes; track the active segment and count moving cars that cannot escape.
  • What if cars have different speeds? The boundary-trimming argument may no longer hold; simulate collision times or use an event-driven approach.
  • Does a head-on collision count as two? Yes: both moving cars contribute one collision each.
CodingMediumArcesiumSoftware Engineer

8. Longest Consecutive Sequence (LeetCode)

Model answer

The task

Given an integer array, return the length of its longest run of consecutive values, regardless of their order in the array.

Key idea

Put the values in a set for fast membership checks. Only start counting from a value whose predecessor is absent, so each consecutive run is scanned once.

Approach

  1. Convert the array to a set, removing duplicates.
  2. For each distinct value, check whether its predecessor is in the set.
  3. If not, count upward while consecutive values remain present.
  4. Track and return the longest count.
from typing import List

class Solution:
    def longestConsecutive(self, nums: List[int]) -> int:
        values = set(nums)
        longest = 0

        for value in values:
            # Only begin counting at the start of a consecutive run.
            if value - 1 not in values:
                current = value
                length = 1

                while current + 1 in values:
                    current += 1
                    length += 1

                longest = max(longest, length)

        return longest

Complexity:

  • Time: O(n) on average; each distinct value is checked a constant number of times.
  • Space: O(n) for the set of distinct values.

Common follow-ups

  • How should an empty array be handled? The implementation returns 0.
  • What if the input contains duplicates? The set removes them without affecting the run length.
  • Can this be solved with sorting? Yes; sort the values and scan adjacent differences, taking O(n log n) time.
  • How could Union-Find be used? Treat each value as a node, union neighboring values that exist, then find the largest component.
CodingMediumArcesiumSoftware EngineerRound 1 Technical Interview

9. Given a Student table with Name and RollNo columns and a Marks table with RollNo and Score columns, write a query to return the name of the student…

The full question

Given a Student table with Name and RollNo columns and a Marks table with RollNo and Score columns, write a query to return the name of the student with the maximum score.

Model answer

The JavaScript below implements the equivalent of joining students to marks by RollNo and returning the name or names with the highest score. It returns all tied students and an empty array if no matching records exist.

function studentsWithMaximumScore(students, marks) {
  const nameByRollNo = new Map(
    students.map(({ Name, RollNo }) => [RollNo, Name])
  );

  let maxScore = -Infinity;
  const result = [];

  for (const { RollNo, Score } of marks) {
    // Ignore marks that do not have a corresponding student.
    if (!nameByRollNo.has(RollNo)) continue;

    if (Score > maxScore) {
      maxScore = Score;
      result.length = 0;
      result.push(nameByRollNo.get(RollNo));
    } else if (Score === maxScore) {
      result.push(nameByRollNo.get(RollNo));
    }
  }

  return result;
}

const students = [
  { Name: "Asha", RollNo: 101 },
  { Name: "Ben", RollNo: 102 },
  { Name: "Chen", RollNo: 103 }
];
const marks = [
  { RollNo: 101, Score: 88 },
  { RollNo: 102, Score: 95 },
  { RollNo: 103, Score: 95 }
];

console.log(studentsWithMaximumScore(students, marks)); // ["Ben", "Chen"]
  • Index students by RollNo, then scan marks and keep the highest score seen.
  • The result includes ties; unmatched marks are ignored.

Complexity: Time: O(n + m); space: O(n + k), where n is the number of students, m is the number of marks, and k is the number of tied winners.

CodingMediumArcesiumSoftware EngineerRound 2 Part 1 Technical Interview

10. Given a binary tree, write an algorithm to replace each node's value with the sum of its own value and the values of its children.

Model answer

// A node has a value and optional left and right children.
class TreeNode {
  constructor(value, left = null, right = null) {
    this.value = value;
    this.left = left;
    this.right = right;
  }
}

function replaceWithChildSum(root) {
  if (root === null) return null;

  // Visit the parent before its children so child values are still original.
  const stack = [root];
  while (stack.length > 0) {
    const node = stack.pop();

    // Save the immediate children's original values before they are updated.
    node.value += (node.left?.value ?? 0) + (node.right?.value ?? 0);

    if (node.right !== null) stack.push(node.right);
    if (node.left !== null) stack.push(node.left);
  }

  return root;
}

// Example:        5                 12
//               /   \             /    \
//              3     4     ->     5      4
const root = new TreeNode(5, new TreeNode(3), new TreeNode(4));
replaceWithChildSum(root);
console.log(root.value, root.left.value, root.right.value); // 12 5 4
  • Traverse in preorder so each node reads its children before they are modified.
  • Leaves remain unchanged because they have no children.

Complexity: Time O(n); auxiliary space O(h) for the traversal stack in a balanced tree, up to O(n) in the worst case.

Product & growthMediumArcesiumSoftware EngineerRound 2 Part 2 Technical Interview

11. Estimate what percentage of your hometown's population would be using Facebook at 1 p.m.

Model answer

Clarify & scope

I’ll interpret “using Facebook at 1 p.m.” as residents actively using it at that moment on a typical weekday, not everyone with an account. Since I don’t know which hometown to use, I’ll estimate for a representative mid-sized city and give a percentage that can scale to another population.

Define the metric

The metric is concurrent users at 1 p.m. divided by the city’s total resident population. I’ll use a population of 1 million for convenient arithmetic; the percentage does not depend on that choice.

Break down

I’d estimate the active users in three steps:

  • About 78% of residents are adults: 780,000.
  • Assume 90% of adults have reliable internet access: 702,000.
  • Assume 55% of those adults use Facebook regularly: about 386,000 regular users.
  • At a specific weekday time, assume 12% of regular users are actively on the app or site: about 46,000 people.

So my estimate is 46,000 / 1,000,000, or about 5% of the hometown population.

Hypotheses & uncertainty

The largest uncertainty is the share of regular users who are active at precisely 1 p.m. It could be higher during a lunch break or lower if most residents are at work or school. If that concurrent share were 8–15%, the estimate would be roughly 3–6% of the total population. Age mix, local Facebook adoption, and whether “using” includes background app activity could shift it further.

How I’d investigate

I’d validate the estimate using local demographic and internet-access data, then Facebook’s audience estimates or a representative survey. I’d keep the time window and definition of “active” consistent, since a one-minute snapshot is different from anyone who opens the app during the whole hour.

Decision & guardrails

I’d report about 5%, with a plausible range of 3–6%, rather than imply false precision. For a different hometown, I’d replace the adoption assumptions while keeping the same funnel and denominator.

TechnicalEasyArcesiumSoftware EngineerRound 2 Part 1 Technical Interview

12. What is virtual address space?

Model answer

A virtual address space is the range of memory addresses that a process can use, as presented by the operating system. A program uses these virtual addresses rather than directly addressing physical RAM.

The operating system and hardware translate virtual addresses to physical addresses using page tables. Memory is divided into fixed-size pages in virtual memory and corresponding frames in physical memory. A mapping can point to RAM, or to backing storage such as a memory-mapped file or swap. The TLB caches recent translations to make this process faster.

flowchart LR
    P[Process virtual address] --> T[TLB lookup]
    T -->|Hit| R[Physical RAM]
    T -->|Miss| PT[Page table walk]
    PT -->|Mapped| R
    PT -->|Not resident| F[Page fault handler]
    F -->|Load or map page| R
Diagram

Virtual address spaces provide several important properties:

  • Isolation: one process generally cannot read or overwrite another process’s memory.
  • Protection: pages can have permissions such as read-only or executable; invalid access can raise a fault.
  • Convenience: each process can use a contiguous-looking address range even when its physical pages are scattered.
  • Controlled sharing: the OS can map the same physical pages into multiple processes, for example for shared libraries.

A virtual address is not necessarily backed by a physical page at every moment. Accessing an unmapped or non-resident page can trigger a page fault; the OS then either arranges the mapping or reports an invalid access to the process.

TechnicalEasyArcesiumSoftware EngineerRound 1 Technical Interview

13. What does the extern keyword mean?

Model answer

  1. In C and C++, extern declares a name that is defined elsewhere. It gives the declaration external linkage, allowing other translation units to refer to the same variable or function.
   // file_a.cpp
   int tradeCount = 0;  // definition: storage is allocated

   // file_b.cpp
   extern int tradeCount;  // declaration: refers to the definition above
  1. A declaration is not usually a definition. extern int tradeCount; tells the compiler the type and name; the linker must find a matching definition. If none exists, linking fails. A global function declaration normally has external linkage already, so extern is often optional for functions.
  2. An initializer makes an extern variable declaration a definition in C++. For example, extern int tradeCount = 10; defines the variable. Define a shared global in exactly one source file and put an extern declaration in a header included by the others.
  3. In C++, extern "C" is a separate, related use. It requests C language linkage, commonly to expose a C++ function to C code or to link against a C library. It typically prevents C++ name mangling; it does not mean that the function body is written in C.
TechnicalEasyArcesiumSoftware EngineerRound 2 Part 2 Technical Interview

14. What is the difference between HTTP and HTTPS?

Model answer

HTTP sends application data between a client and server without encrypting it. Someone able to observe the network path could read or modify that traffic, and the client has no built-in way to verify the server's identity.

HTTPS is HTTP carried over TLS. TLS authenticates the server using a certificate, encrypts data in transit, and detects tampering. In practice, this protects things like login credentials and financial data from network eavesdroppers and modification.

sequenceDiagram
    participant C as Client
    participant S as Server
    C->>S: HTTP request and response in cleartext
    Note over C,S: HTTP provides no TLS protection
    C->>S: TLS handshake and certificate validation
    C->>S: HTTP request encrypted inside TLS
    S->>C: HTTP response encrypted inside TLS
Diagram

HTTPS protects the connection, not necessarily the site or device: a malicious site can still use HTTPS, and compromised endpoints can expose data.

TechnicalEasyArcesiumSoftware EngineerRound 2 Part 1 Technical Interview

15. What is the difference between a procedure and a function in PL/SQL?

Model answer

A procedure performs an operation, while a function computes and returns a value.

  • Return value: A function must declare a return type and return a value with RETURN. A procedure does not return a value in that way, but can provide results through OUT or IN OUT parameters.
  • How it is called: A function can be used in an expression, and some functions can be called from SQL statements. A procedure is invoked as a statement, for example with EXEC or from a PL/SQL block.
  • Restrictions: A function called from SQL must meet SQL-callable requirements; for example, it cannot freely perform transaction control. Procedures are commonly used for workflows that modify data or manage transactions.

Both can accept parameters, raise exceptions, and contain procedural logic.

TechnicalEasyArcesiumSoftware EngineerRound 2 Part 1 Technical Interview

16. What is a binary tree, and what is a binary search tree?

The full question

What is a binary tree, and what is a binary search tree? Draw an example.

Model answer

A binary tree is a tree data structure in which each node has at most two children, conventionally called the left and right child. It does not impose any ordering on the node values.

A binary search tree (BST) is a binary tree with an ordering rule: for every node, values in its left subtree are smaller than the node’s value, and values in its right subtree are larger. A common variant allows duplicates by consistently placing them on one side.

graph TD
    A[8] --> B[3]
    A --> C[10]
    B --> D[1]
    B --> E[6]
    C --> F[14]
Diagram

This is a BST: values below 8 are on its left, and values above 8 are on its right. The same shape would be a binary tree even if those ordering rules did not hold.

TechnicalEasyArcesiumSoftware EngineerRound 1 Technical Interview

17. What does the register keyword mean in the context of operating systems?

Model answer

In operating-systems discussions, register usually refers to a small, fast storage location inside the CPU. The OS saves and restores key register values—such as the program counter and stack pointer—when switching between processes or threads, so each can resume its execution.

If you mean the register keyword in C, it is a storage-class hint asking the compiler to keep a variable in a CPU register for faster access. It does not guarantee that placement; modern compilers generally make that decision themselves. A C variable declared with register also cannot have its address taken with &.

TechnicalEasyArcesiumSoftware EngineerRound 2 Part 1 Technical Interview

18. What is a database trigger?

Model answer

A database trigger is stored code that the database automatically runs when a specified event occurs. For example, a trigger might run before or after an insert, update, or delete on a table.

Triggers can be row-level (run once for each affected row) or statement-level (run once for the whole statement). Depending on the database, they can also respond to events such as DDL changes or logon. They are useful for enforcing rules or recording audit information, but hidden side effects can make data changes harder to understand and troubleshoot.

TechnicalEasyArcesiumSoftware EngineerRound 2 Part 1 Technical Interview

19. What is a circular linked list?

Model answer

A circular linked list is a linked list in which the last node links back to an earlier node—typically the first node—instead of pointing to null.

  • In a circular singly linked list, each node has a value and a next pointer.
  • Starting at any node and repeatedly following next eventually returns to that node.
  • An empty list has no nodes; a one-node list has its next pointer pointing to itself.
  • It is useful for cyclic traversal, such as round-robin scheduling, and can support efficient queue operations when a tail pointer is maintained.
TechnicalMediumArcesiumSoftware EngineerRound 2 Part 1 Technical Interview

20. What steps occur from the time you enter a URL such as http://www.google.com in a browser until the page loads?

Model answer

  1. Parse the URL. The browser identifies the scheme (http), host (www.google.com), path, and default port (80). It may also check its cache, service workers, and stored connection state.
  2. Resolve the hostname. The browser or operating system checks DNS caches. On a miss, a DNS resolver looks up the host’s IP address and returns it; the browser may receive multiple addresses for load balancing or IPv4/IPv6.
  3. Connect to the server. For HTTP/1.1 or HTTP/2, the browser establishes a TCP connection to the selected IP and port. If the URL were HTTPS, it would then negotiate TLS and verify the certificate. Since this URL says http, the browser initially sends plain HTTP; Google commonly responds with a redirect to HTTPS, after which the browser establishes a secure connection. HTTP/3 can instead use QUIC over UDP.
  4. Send the request. The browser sends an HTTP request with headers such as Host, accepted content types, and cookies. The request may pass through proxies, load balancers, and server-side services.
  5. Receive the response. The server returns a status code, headers, and a body. A redirect causes the browser to repeat navigation for the new URL; otherwise, it processes the response, often HTML.
  6. Render the page. The browser parses HTML into the DOM, fetches referenced resources, builds the CSSOM, and runs JavaScript. It calculates layout, paints pixels, and composites layers. Additional scripts or resources can cause more network requests and rendering updates.
flowchart TD
    A[Enter URL] --> B[Parse URL and check caches]
    B --> C[Resolve hostname with DNS]
    C --> D[Connect to server]
    D --> E[Send HTTP request]
    E --> F[Receive response]
    F --> G{Redirect?}
    G -->|Yes| H[Follow new URL, often HTTPS]
    H --> C
    G -->|No| I[Parse HTML, CSS, and JavaScript]
    I --> J[Fetch page resources]
    J --> K[Layout, paint, and display]
Diagram

Practice these out loud, don't memorise them

Reading an answer is not the same as being able to give one under pressure. ChannelPulse plays the interviewer, asks the follow-ups, and scores each answer with feedback and a model answer so you can hear the gap between what you said and what lands.

Get ChannelPulse Browse all questions