Salesforce OA interview experience sharing|Analysis of two high-frequency algorithm questions

76 Views
No Comment

I just sorted it out recently Salesforce OA, the questions are not biased, but they test the basic stability. I simply record the ideas of the two questions to provide a reference for students who want to do Salesforce OA later. The topic setting of this Salesforce OA is generally basic, but very typical. It's not about relying on special skills to win, but whether you understand common data structures and algorithm models well and whether the implementation is stable.

Judging from what we at ProgramHelp have experienced, the biggest risk of this type of OA is not "not knowing" but losing points in details.

Overview of Salesforce OA overall process and question types

Judging from the feedback from the recent batches of Salesforce OA, the overall form is relatively stable and belongs to the typical online assessment style of large manufacturers that mainly examines the candidates' basic coding ability and algorithm proficiency.

OA is usually completed through a third-party platform, and the number of questions is mainly 2. Some batches may have 3 questions. The overall duration is generally in the range of 60-90 minutes that requires certain time management, but it is not an extremely compressed exam.

In terms of question types, Salesforce OA mainly focuses on classic data structure and algorithm questions. There are rarely any special topics or content that requires complex mathematical derivation. Common examination directions include:

  • Basic data structures such as linked lists, arrays, and strings
  • Reasonable use of HashSet / HashMap
  • Dynamic programming basic models (such as LCS, subsequence problems)
  • Simple boundary conditions and complexity analysis capabilities

The language support is relatively friendly, and mainstream languages ​​​​such as Java, Python, and C++ can be used. The overall coding environment favors "engineering implementation". Rather than pursuing algorithmic difficulty, it pays more attention to the readability, stability and handling of boundary situations of the code.

The screening logic of Salesforce OA is not to use super difficult questions to get candidates, but to use these high-frequency motifs to quickly determine whether candidates have a solid foundation and reliable coding habits. This is why it may not seem difficult, but the actual passing rate is not underestimated.

T1: Single linked list deduplication (retaining the first occurrence)

Salesforce OA interview experience sharing|Analysis of two high-frequency algorithm questions (linked list deduplication & LCS)

The main idea of ​​the title is:
Given a singly linked list, only the node where each value appears for the first time is retained, all subsequent nodes with repeated values ​​are deleted, and finally the head of the linked list is returned.

This is a very typical linked list question, and OAs like Salesforce love to take the test.

The overall idea is HashSet + pointer traversal:

  • Use a HashSet to record the values ​​that have appeared
  • Use the curr pointer to traverse the linked list from the beginning
  • Use the prev pointer to point to the last node currently reserved

There are two situations when traversing:

  • If curr.val does not appear
    • Join HashSet
    • Prev moved to curr
  • If curr.val is already in the HashSet
    • Description is a duplicate node
    • Use prev.next = curr.next to delete the current node

The main point to pay attention to is the pointer update, especially when deleting the node, do not move the prev arbitrarily, otherwise the link will be easily broken.

T2: Longest Common Subsequence (LCS)

Salesforce OA interview experience sharing|Analysis of two high-frequency algorithm questions (linked list deduplication & LCS)

The second question is to find the length of the longest common subsequence given two strings.

This is a standard DP template question. There is nothing complicated. In OA, it just depends on whether you can write it correctly.

A common solution is dynamic programming for n * m:

  • Dp[i][j] means
    • The first i characters of x
    • The first j characters of y
    • The length of the longest common subsequence that can be obtained

Transfer logic:

  • If x[i-1] == y[j-1]
    • Dp[i][j] = dp[i-1][j-1] + 1
  • Otherwise
    • Dp[i][j] = max(dp[i-1][j], dp[i][j-1])

The final answer is dp[n][m].

Some personal feelings

In summary, the style of Salesforce OA is:

  • Don't pursue problems
  • But it’s very easy to get stuck on the details.
  • If the linked list pointer and DP subscript are written incorrectly once, the system will hang up immediately.

If you have used LeetCode for these two questions, you have actually seen the prototypes. However, in the OA environment, time is tight, so it is recommended to familiarize yourself with these basic motifs in advance.

I hope it will be helpful to students preparing for Salesforce OA.

Are you afraid of getting stuck in the details when preparing for Salesforce OA?

ProgramHelp Help you avoid pitfalls accurately and get high scores! You must know that Salesforce OA does not test the difficult questions, but it extremely tests the basic stability. If the linked list pointer is confused or the DP subscript is wrong, it may directly fail. We combine a large number of real tutoring cases to deeply dismantle the high-frequency test points, and provide clear problem-solving ideas and detailed control skills for typical question types such as single linked list deduplication and longest common subsequence, helping you to understand core methods such as HashSet traversal and dynamic programming, and avoid common points such as broken links and subscript confusion. Whether you are worried about the tight schedule of OA or want to understand the basic topics in advance to stabilize your mentality, ProgramHelp can provide you with targeted preparation guidance. There are also services such as OA ghostwriting, real-time interview assistance, and a full set of job search escorts to help you from exam preparation to getting an offer, allowing you to avoid detours, easily overcome the first hurdle of Salesforce job search, and sprint to the big company of your choice!

author avatar
Jory Wang Amazon資深軟體開發工程師
Amazon 資深工程師,專注 基礎設施核心系統研發,在系統可擴充套件性、可靠性及成本最佳化方面具備豐富實戰經驗。 目前聚焦 FAANG SDE 面試輔導,一年內助力 30+ 位候選人成功斬獲 L5 / L6 Offer。
END
 0