Add office photos
Employer?
Claim Account for FREE

Salesforce

4.0
based on 929 Reviews
Video summary
Filter interviews by

Silicon Facilities Services Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. Factorial Trailing Zeros Problem

You are provided with a positive integer N. Your goal is to determine the smallest number whose factorial has at least N trailing zeros.

Example:

Input:
N = 1
Output:
5
Explanat...read more
Ans.

Find the smallest number whose factorial has at least N trailing zeros.

  • Calculate the number of 5's in the prime factorization of the factorial to determine the trailing zeros.

  • Use binary search to find the smallest number with at least N trailing zeros.

  • Consider edge cases like N = 0 or N = 1 for factorial trailing zeros problem.

Add your answer

Q2. Combination Sum Problem Statement

Given three integers X, Y, and Z, calculate the sum of all numbers that can be formed using the digits 3, 4, and 5. Each digit can be used up to a maximum of X, Y, and Z times ...read more

Ans.

Calculate the sum of all numbers that can be formed using the digits 3, 4, and 5 with given constraints.

  • Iterate through all possible combinations of 3, 4, and 5 based on the given constraints.

  • Calculate the sum of each combination and add them up.

  • Return the final sum modulo 10^9 + 7.

Add your answer

Q3. Reverse Linked List Problem Statement

Given a singly linked list of integers, your task is to return the head of the reversed linked list.

Example:

Input:
The given linked list is 1 -> 2 -> 3 -> 4 -> NULL.
Outp...read more
Ans.

To reverse a singly linked list of integers, return the head of the reversed linked list.

  • Iterate through the linked list, reversing the pointers to point to the previous node instead of the next node.

  • Keep track of the previous, current, and next nodes while traversing the list.

  • Update the head of the reversed linked list to be the last element of the original list.

Add your answer

Q4. Longest Path In Directed Graph Problem Statement

Given a Weighted Directed Acyclic Graph (DAG) comprising 'N' nodes and 'E' directed edges, where nodes are numbered from 0 to N-1, and a source node 'Src'. Your ...read more

Ans.

The task is to find the longest distances from a source node to all nodes in a weighted directed acyclic graph.

  • Implement a function that takes the number of nodes, edges, source node, and edge weights as input.

  • Use a topological sorting algorithm to traverse the graph and calculate the longest distances.

  • Return an array of integers where each element represents the longest distance from the source node to the corresponding node.

Add your answer
Discover Silicon Facilities Services interview dos and don'ts from real experiences

Q5. Largest BST Subtree Problem

Given a binary tree with 'N' nodes, determine the size of the largest subtree that is also a BST (Binary Search Tree).

Input:

The first line contains an integer 'T', representing the...read more
Ans.

The problem involves finding the size of the largest subtree that is also a Binary Search Tree in a given binary tree.

  • Traverse the binary tree in a bottom-up manner to check if each subtree is a BST.

  • Keep track of the size of the largest BST subtree encountered so far.

  • Use recursion to solve the problem efficiently.

  • Consider edge cases like empty tree or single node tree.

  • Example: For input 1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1, the largest BST subtree has size 3.

Add your answer

Q6. Implementing a Priority Queue Using Heap

Ninja has been tasked with implementing a priority queue using a heap data structure. However, he is currently busy preparing for a tournament and has requested your ass...read more

Ans.

Implement a priority queue using a heap data structure by completing the provided functions: push(), pop(), getMaxElement(), and isEmpty().

  • Understand the operations: push() to insert element, pop() to remove largest element, getMaxElement() to return largest element, and isEmpty() to check if queue is empty.

  • Implement a heap data structure to maintain the priority queue.

  • Handle different types of queries based on the input provided.

  • Ensure correct output for each type 3 query.

  • Te...read more

Add your answer
Q7. Can you design a system similar to Splitwise and identify three features that you would change or improve?
Ans.

Design a system similar to Splitwise and suggest three features for improvement.

  • Implement a real-time notification system for updates on shared expenses

  • Integrate a feature for automatic currency conversion for international transactions

  • Enhance the user interface with data visualization tools for better expense tracking

Add your answer

More about working at Salesforce

#12 Best Mid-Sized Company - 2022
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Associate Software Engineer Interview Questions from Similar Companies

3.8
 • 159 Interview Questions
3.7
 • 27 Interview Questions
3.4
 • 18 Interview Questions
3.7
 • 11 Interview Questions
4.0
 • 10 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter